Open flatproject opened 2 years ago
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
I just wasted a huge amount of time trying to troubleshoot why Razor runtime compilation was not working for a Razor class library. Then I stumbled on this issue and found its the exact problem I have.
The documentation around this is frustrating because it implies it is very simple. Yet it doesn't actually work, and having to dig into the guts of MSBuild properties and GitHub issues around this is painful.
I have a similar issue like this, my RCL library is referenced to main project which hosts the services and runtime compilation, the rcl library works for most part except the partial view after 17 hours nonstop digging i came here to drop an issue and saw this, and this was something that was working ok in .net 5 which made me assume that some setting was changed and i was doing something wrong with newer dotnet version oblivious to the bug. Guess i can only remove all partial views from common UI library :( ironic how something already working gets break with newer-better version.
Is there an existing issue for this?
Describe the bug
When the setting AddRazorSupportForMvc is added to an RCL like below it stops the runtime compilation from working. If it is removed then no partial views are published on Release.
This is my RCL:
This is how I add runtime compilation in the Startup file of the project that references the RCL:
This is how my launchSettings.json looks like:
Expected Behavior
I would have expected either adding the AddRazorSupportForMvc setting not to break the runtime compilation OR if the setting was not available my RCL partial views to get published when I do a release.
Steps To Reproduce
https://github.com/flatproject/AddRazorSupportForMvc
Enable the AddRazorSupportForMvc setting in the RCL and try to edit the Index1.cshtml page in the RCL and refresh to see your change. It will not work.
Disable the AddRazorSupportForMvc setting in the RCL and do a production release. The partial view is not published.
Exceptions (if any)
No response
.NET Version
6.0.301
Anything else?
Microsoft Visual Studio Community 2022 (64-bit) - Current Version 17.2.5
`C:\WINDOWS\system32>dotnet --info .NET SDK (reflecting any global.json): Version: 6.0.301 Commit: 43f9b18481
Runtime Environment: OS Name: Windows OS Version: 10.0.19044 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\6.0.301\
Host (useful for support): Version: 6.0.6 Commit: 7cca709db2
.NET SDKs installed: 6.0.301 [C:\Program Files\dotnet\sdk]
.NET runtimes installed: Microsoft.AspNetCore.App 3.1.26 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 3.1.26 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.26 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]`