-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Embedded views doesn't works after updating to .net core 3 #14374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@javiercn I have push a sample here : https://github.com/geotinc/AspNetCore Try to access /Test/Index => View not found Thanks for helping |
#14359 has similar issues with a sample that are not fixed by just |
@geotinc Have you tried adding your class library as a razor class library instead of making it a netcore app? |
@taori Yes, I try without success |
Hi, i have a library that transforms views to pdf, with the views in the fileprovider i have the same exception "Cannot find reference assembly 'Microsoft.AspNetCore.Antiforgery.dll'", when using the "Physical" views i dont have the issue. I have tried some debugging, but the farthest i can go without breaking was here The code is in this repo
And the branch
|
@geotinc Seems like your project is not correctly setup. Id recommend you follow the guidance from https://docs.microsoft.com/en-us/aspnet/core/razor-pages/ui-class?view=aspnetcore-3.0&tabs=visual-studio Is there any specific reason why you are trying to embed the pages in the assembly directly? |
@geotinc Our recommendation is that you use Razor Class Libraries instead of plain class libraries for razor, as they provide more features and a better experience. If there's an scenario that you can't achieve with Razor Class Libraries feel free to open a new issue describing the requirement. I'm closing this issue as there's nothing else for us to do here. |
@javiercn how would you solve my problem? #14374 (comment) I don't have any views in the library, but i need to process them dynamically |
@fpanaccia Could you please open a separate issue so that we can track and prioritize your issue appropriately? Could you also include more details on what you are trying to accomplish and how? |
@javiercn I just dont now that there is other way to do that. |
@javiercn I confirm that everything seems to work well after migrating to RCL. |
@mkArtakMSFT , @javiercn, @geotinc I do also have some issues with the Embedded Views. Here I provide a solution with .NET Core 2.2 working and .NET Core 3.0 not working. Could someone give me a hand please? I'm struggling to make my RazorViewToStringRenderer to find the View from the Embedded Razor Class Library. Source Code: https://dev.azure.com/okyselov/_git/ConsoleAppEmbeddedRazorViews |
@alextof could you please file a separate issue? |
In other to migrate from asp.net core 2.2 to asp.net core 3
I change the code for loading external views as the following :
When running the project, I have the following error :
InvalidOperationException: The view 'Login' was not found. The following locations were searched: /Views/Account/Login.cshtml /Views/Shared/Login.cshtml /Pages/Shared/Login.cshtml
The text was updated successfully, but these errors were encountered: