active-directory-aspnetcore-webapp-openidconnect-v2
active-directory-aspnetcore-webapp-openidconnect-v2 copied to clipboard
3-WebApp-multi-APIs Sample Broken - site doesn't load when targetting: .net 6.0 framework
3-WebApp-multi-APIs no longer works after changing from .net core 3.1 to .net framework 6.0 target runtime
This issue is for a: (mark with an x
)
- [] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [X ] regression (a behavior that used to work and stopped in a new release)
The issue was found for the following scenario:
3-WebApp-multi-APIs no longer works after changing from .net core 3.1 to .net framework 6.0 target runtime
Please add an 'x' for the scenario(s) where you found an issue
- Web app that signs in users
- [ ] with a work and school account in your organization: 1-WebApp-OIDC/1-1-MyOrg
- [ ] with any work and school account: /1-WebApp-OIDC/1-2-AnyOrg
- [ ] with any work or school account or Microsoft personal account: 1-WebApp-OIDC/1-3-AnyOrgOrPersonal
- [ ] with users in National or sovereign clouds 1-WebApp-OIDC/1-4-Sovereign
- [ ] with B2C users 1-WebApp-OIDC/1-5-B2C
- Web app that calls Microsoft Graph
- [ ] Calling graph with the Microsoft Graph SDK: 2-WebApp-graph-user/2-1-Call-MSGraph
- [ ] With specific token caches: 2-WebApp-graph-user/2-2-TokenCache
- [X] 2-3 Multi-tenant
- [ ] Calling Microsoft Graph in national clouds: 2-WebApp-graph-user/2-4-Sovereign-Call-MSGraph
- [X] Web app calling several APIs 3-WebApp-multi-APIs
- [ ] Web app calling your own Web API
- [ ] with a work and school account in your organization: 4-WebApp-your-API/4-1-MyOrg
- [ ] with B2C users: 4-WebApp-your-API/4-2-B2C
- [ ] with any work and school account: 4-WebApp-your-API/4-3-AnyOrg
- Web app restricting users
- [ ] by Roles: 5-WebApp-AuthZ/5-1-Roles
- [ ] by Groups: 5-WebApp-AuthZ/5-2-Groups
- [ ] Deployment to Azure
- [ ] Other (please describe)
Repro-ing the issue
Repro steps
- Clone repository
- install min. requirements
- Follow steps to set up the app, populate config etc.
- Build (on VS2022) and deploy (F5)
- Try to log in as a valid user
Expected behavior Site loads. tabs work.
Actual behavior Site doesn't load. Unable to find index.cshtml
Internal Server Error
InvalidOperationException: The view 'Index' was not found. The following locations were searched:
/Views/Home/Index.cshtml
/Views/Shared/Index.cshtml
/Pages/Shared/Index.cshtml
Microsoft.AspNetCore.Mvc.ViewEngines.ViewEngineResult.EnsureSuccessful(IEnumerable
Possible Solution
-
revert back to .netcore3.1 ie. back to <TargetFramework>netcoreapp3.1</TargetFramework> from <TargetFramework>net6.0</TargetFramework> doing this - confirmed that the site loads once again.
-
If using .net 6.0 - unsure -> Ensure the route registration works or .cshtml are always deployed?
Additional context/ Error codes / Screenshots
Any log messages given by the failure
Add any other context about the problem here, such as logs. N/A
OS and Version?
Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?) Windwos 10
Versions
of ASP.NET Core, of MSAL.NET not sure - the project says .net core but the targeting framework is .net framework x64 runtime as of the change https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/commit/2607df1338a9f7c06fe228c87644b8b456ca708b
Attempting to troubleshooting yourself:
- did you go through the README.md in the folder where you found the issue? Yes.
- did you go through the documentation:
- Scenario: Web app that signs in users. Yes Read it - don't think the issue is there (since I auth'ed in properly)
- Scenario: Web app that calls web APIs
Mention any other details that might be useful
Thanks! We'll be in touch soon.
It works when I start the app via dotnet run
instead of F5. Not sure why though.