OfficeDev / teams-toolkit

Developer tools for building Teams apps
Other
454 stars 183 forks source link

Error on Preparing Teams App Dependencies #12252

Closed LALITAMITTAL18 closed 2 weeks ago

LALITAMITTAL18 commented 3 weeks ago

I am creating new Teams Template project using Microsoft Visual Studio Professional 2022 (64-bit) - Current Version 17.11.0 and when I click on "Preparing Teams App Dependencies", I get below error: { "errorType": "SystemError", "source": "Fx-VS", "name": "UnknownError", "message": "The given key was not present in the dictionary.", "stack": " at System.ThrowHelper.ThrowKeyNotFoundException()\r\n at System.Collections.Generic.Dictionary`2.get_Item(TKey key)\r\n at TeamsFx.VisualStudio.Commonlib.M365TokenProvider.d__7.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at TeamsFx.VisualStudi... "innerError": null, "userData": null, "timestamp": "2024-08-20T14:56:23.0584746+02:00", "displayMessage": "The given key was not present in the dictionary.", "helpLink": null, "issueLink": null }

image

lijie-lee commented 3 weeks ago

Hi @LALITAMITTAL18,

I'll help to track this issue and figure out why the Error occurs. By the way, could you share which Teams Template you created?

LALITAMITTAL18 commented 3 weeks ago

I am trying Echo Bot

image

lijie-lee commented 3 weeks ago

Got it. I'll have a try for this template. Thanks.

lijie-lee commented 3 weeks ago

Hi @LALITAMITTAL18,

It seems your UPN is not configured. To verify this, you could try:

  1. Retrieve UPN locally by following this sample
  2. Go to the Microsoft Admin Center to check if necessary configration is set.

The best solution we recommended is to register a M365 test account and use the new account to develop and test teams app locally.

lijie-lee commented 2 weeks ago

Hi @LALITAMITTAL18, does the solution work for you?

Hi @LALITAMITTAL18,

It seems your UPN is not configured. To verify this, you could try:

  1. Retrieve UPN locally by following this sample
  2. Go to the Microsoft Admin Center to check if necessary configration is set.

The best solution we recommended is to register a M365 test account and use the new account to develop and test teams app locally.

LALITAMITTAL18 commented 2 weeks ago

Yes it worked. There was some issue with logged in user. I have to sign out and sign in again using embedded browser.

image

lijie-lee commented 2 weeks ago

Hi @LALITAMITTAL18, Thanks for you feedback and glad to see the solution works for you.

For the logging issue, It seems out the scope of "Preparing Teams App Dependencies". Could you file another issue for that? And I'll close this one then.

LALITAMITTAL18 commented 2 weeks ago

Thanks a lot.