Fixed: "If You're Having Issues with This App, Try the Desktop Version" in a Teams Dialog
A Teams dialog that should have shown a web page stayed empty, and a few seconds later Teams on the web put a warning over it: If you're having issues with this app, try the desktop version, with an Open In Desktop button. The page was fine. Its domain was missing from the app's manifest, so Teams never loaded it.
What I Was Doing
An agent built with the Microsoft 365 Agents SDK sends a card with a Show Wi-Fi details button. The button asks the agent for a dialog, and the agent answers with the address of a page it serves itself, through a dev tunnel:
{"task":{"type":"continue","value":{"title":"Guest Wi-Fi","width":400,"height":160,"url":"https://cdzngt35-3980.inc1.devtunnels.ms/wifi.html"}}}
The app package came from the manifest.json I write by hand for bots, as in How to Create a Teams App Package for a Bot. That manifest has no validDomains. I uploaded it in Teams on the web and selected Show Wi-Fi details.
What I Expected
A dialog titled Guest Wi-Fi, showing the page: the network's name and how to get the password.
What I Got
The dialog opened with the right title, but the page area stayed white. A few seconds later, Teams added its warning:

Twenty seconds later, nothing had changed.
What I Checked
Whether Teams got the agent's answer. It did: the title, Guest Wi-Fi, comes from that answer. The agent's request log showed the dialog request answered with 200:
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/1.1 POST http://localhost:3980/api/messages - application/json;+charset=utf-8 1420
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished HTTP/1.1 POST http://localhost:3980/api/messages - 200 - application/json;+charset=utf-8 41.5003ms
Whether Teams asked for the page. It didn't. No request for /wifi.html followed, then or later. ASP.NET Core writes these request lines when its Microsoft.AspNetCore.Hosting.Diagnostics log category is set to Information, which you can do in appsettings.Development.json:
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning",
"Microsoft.AspNetCore.Hosting.Diagnostics": "Information"
}
}
}
Whether the page worked on its own. It did. Requesting it through the tunnel returned it:
curl -s -o /dev/null -w "%{http_code} %{content_type}\n" https://cdzngt35-3980.inc1.devtunnels.ms/wifi.html
200 text/html
What Microsoft's documentation says. Invoke and dismiss dialogs describes the url value as the URL of the page loaded as an <iframe> inside the dialog, and adds: The dialog feature requires that the domains of any URLs you want to load are included in the validDomains array in your app's manifest. My manifest had no validDomains at all.
Why It Happens
Teams loads a page into a dialog only from a domain the app's manifest lists in validDomains. With the tunnel's domain missing, Teams never requested the page, so the dialog stayed empty.
The warning fits what Microsoft's requirements for tabs describe: a page must call microsoftTeams.app.initialize() to avoid seeing a warning in the new domain, and a page that never loads can't call anything.
The Fix
Add the page's domain to validDomains in manifest.json, give the manifest a higher version, and upload the package again:
"version": "1.0.1",
"validDomains": [
"cdzngt35-3980.inc1.devtunnels.ms"
]
- The domain is your page's host name alone, with no
https://and no path. For a dev tunnel, it's the host in the address thatdevtunnel hostprints, such ascdzngt35-3980.inc1.devtunnels.ms. - List your own host, never a wildcard such as
*.devtunnels.ms. The manifest reference is clear: Don't add domains that are outside your control, either directly or through wildcards (*). A tunnel service's domain covers everyone's tunnels. - The
versionwent from1.0.0to1.0.1, so the new package is a new version of the app.
How to Add a Valid Domain to a Microsoft Teams App Manifest walks through the whole change: editing the manifest, building the package and uploading it.
After the Fix
With the domain listed, Teams requested the page. The agent's log now showed it right after the dialog request:
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/1.1 GET http://localhost:3980/wifi.html - - -
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished HTTP/1.1 GET http://localhost:3980/wifi.html - 200 734 text/html 14.9381ms
The first time, the dialog showed the dev tunnel's own warning page, which Fixed: "You Are About to Connect to a Developer Tunnel" in a Teams Dialog explains. After that, the page opened, and Teams' warning didn't come back:

Another Cause: The Page Doesn't Call app.initialize()
The same warning came up for a page that did load. That page never called microsoftTeams.app.initialize(). It showed its own first line, Connecting to Teams..., and about 30 seconds later Teams added the warning on top:

That's the case the tab requirements describe. Call microsoftTeams.app.initialize() as soon as the library has loaded. How to Add the Teams JavaScript Library (TeamsJS) to a Web Page from the CDN shows the script tag and the call.
To tell the two causes apart, watch the dialog:
| What you see | Cause |
|---|---|
| The dialog stays empty, and the warning appears within seconds | The page's domain isn't in validDomains |
| The page shows, and the warning appears about 30 seconds later | The page doesn't call app.initialize() |
Common Mistakes
| Mistake | What happens | Do this instead |
|---|---|---|
| Making the package from a bot-only manifest | It has no validDomains, so no page loads in a dialog | Add validDomains with your page's host |
Writing https:// or a path in validDomains | The list is for domains | Write the host name alone |
Adding *.devtunnels.ms | Every tunnel on the service becomes trusted, which the manifest reference forbids | List your own tunnel's host |
Editing manifest.json without uploading the package again | Teams keeps using the package it has | Build the package and upload it again |
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| Empty dialog, the warning within seconds, and no request for the page in the agent's log | The domain isn't in validDomains | Add it, raise version, upload again |
| The page shows, then the warning arrives about 30 seconds later | No microsoftTeams.app.initialize() call | Load TeamsJS and call it |
| The dialog shows You are about to connect to a developer tunnel | The dev tunnel's warning, shown the first time a browser opens the tunnel | Select Continue |
FAQ
Do I list the domain of the agent's /api/messages endpoint too?
No. With no validDomains at all, the agent still received and answered every message and dialog request: those reach it through the bot's messaging endpoint. validDomains is for content Teams loads, such as a dialog's page.
Can I list more than one domain?
Yes. validDomains is a list, and the manifest reference allows up to 100 entries.
Conclusion
If you're having issues with this app, try the desktop version over an empty Teams dialog meant Teams never loaded the page, because the page's domain wasn't in the manifest's validDomains. Add the exact host, raise the manifest's version and upload the package again. If the page does show and the warning arrives later, the page isn't calling microsoftTeams.app.initialize().
Additional Resources
- Invoke and dismiss dialogs, on Microsoft Learn.
- validDomains in the app manifest, on Microsoft Learn.
- Requirements for building tabs, on Microsoft Learn.
