Skip to main content

Fixed: "If You're Having Issues with This App, Try the Desktop Version" in a Teams Dialog

· 8 min read
Jagdish Kumawat
Founder @ Dewiride

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:

The agent's answer
{"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:

A Teams dialog titled Guest Wi-Fi from the app Dialog Page Demo: under the title, a warning bar says If you're having issues with this app, try the desktop version, with an Open In Desktop button, and the area below it is empty.

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:

Agent output
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:

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:

Terminal
curl -s -o /dev/null -w "%{http_code} %{content_type}\n" https://cdzngt35-3980.inc1.devtunnels.ms/wifi.html
Output
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:

manifest.json (excerpt)
"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 that devtunnel host prints, such as cdzngt35-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 version went from 1.0.0 to 1.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:

Agent output
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:

The same Guest Wi-Fi dialog, now showing the page: Network: Contoso-Guest, Password: ask at the front desk. It changes every day., and The guest network reaches the internet only.

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:

A Teams dialog titled Host check: the warning bar If you're having issues with this app, try the desktop version, with Open In Desktop, above the page's own text, Connecting to Teams...

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 seeCause
The dialog stays empty, and the warning appears within secondsThe page's domain isn't in validDomains
The page shows, and the warning appears about 30 seconds laterThe page doesn't call app.initialize()

Common Mistakes​

MistakeWhat happensDo this instead
Making the package from a bot-only manifestIt has no validDomains, so no page loads in a dialogAdd validDomains with your page's host
Writing https:// or a path in validDomainsThe list is for domainsWrite the host name alone
Adding *.devtunnels.msEvery tunnel on the service becomes trusted, which the manifest reference forbidsList your own tunnel's host
Editing manifest.json without uploading the package againTeams keeps using the package it hasBuild the package and upload it again

Troubleshooting​

SymptomLikely causeFix
Empty dialog, the warning within seconds, and no request for the page in the agent's logThe domain isn't in validDomainsAdd it, raise version, upload again
The page shows, then the warning arrives about 30 seconds laterNo microsoftTeams.app.initialize() callLoad TeamsJS and call it
The dialog shows You are about to connect to a developer tunnelThe dev tunnel's warning, shown the first time a browser opens the tunnelSelect 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​