The custom Identity UI Razor Page source should be used in the publish folder, instide of the default UI from RCL after setting RazorCompileOnPublish setup to false.
See original GitHub issueIs there an existing issue for this?
- I have searched the existing issues
Describe the bug
I can’t set to use customize Identity UI Razor Pages after copying release in the publish folder, although I tried various settings with RazorCompileOnPublish = false. I apply the scaffolder to all source code contained in the Identity Razor Class Library (RCL) and I modify the generated source code.
Links such as “Identity/Account/Login”, “/Identity/Account/Manage” always display the default UI from Razor Class Library (RCL) from ASP.NET Core Identity
Expected Behavior
My goal is to have customize Identity UI Razor Page source instead of the compiled views dll in the publish folder.
Steps To Reproduce
• Create ASP.NT Core Razor Page Web App with Frameworks: I try with both .NET 7.22377.5 preview and .NET 6.0.8 Authentication type: Individual Accounts
• I create full Identity UI source to maintain full control of the Identity UI: run the Identity scaffolder and select Override all files.
• In csproj file I add:
<PropertyGroup>
<RazorCompileOnBuild>false</RazorCompileOnBuild>
<RazorCompileOnPublish>false</RazorCompileOnPublish>
</PropertyGroup>
I also tried various combinations of these settings:
<PropertyGroup>
<RazorCompileOnBuild>false</RazorCompileOnBuild>
<CopyRefAssembliesToPublishDirectory>true</CopyRefAssembliesToPublishDirectory>
<CopyRazorGenerateFilesToPublishDirectory>true</CopyRazorGenerateFilesToPublishDirectory>
<PreserveCompilationReferences>true</PreserveCompilationReferences>
<PreserveCompilationContext>true</PreserveCompilationContext>
</PropertyGroup>
• In csproj file I include package (to enable runtime compilation for Razor pages): Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation • In Program.cs (to enable runtime compilation for Razor pages ) I add: builder.Services.AddRazorPages().AddRazorRuntimeCompilation();
• Change something in generated Identity file e.g. in "\Areas\Identity\Pages\Account\Login.cshtml
• I run Visual Studio and can’t see the changes in the Login.cshtml. Instead I see the default UI from Razor Class Library (RCL) from ASP.NET Core Identity.
• I create publish release files Start WebAppApplication.exe, from publish folder, go to /Identity/Account/Login and also I do not see changes in Login.cshtml, instead I see default Identity UI from Razor Class Library (RCL) from ASP.NET Core Identity.
Exceptions (if any)
No response
.NET Version
7.0.100-preview.7.22377.5
Anything else?
• Visual Studio 2022 (64-bit) 17.4.0 Preview 1.0
• dotnet --info
.NET SDK:
Version: 7.0.100-preview.7.22377.5
Commit: ba310d9309
Runtime Environment:
OS Name: Windows
OS Version: 10.0.19044
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\7.0.100-preview.7.22377.5\
Host:
Version: 7.0.0-preview.7.22375.6
Architecture: x64
Commit: eecb028078
.NET SDKs installed:
5.0.202 [C:\Program Files\dotnet\sdk]
6.0.400 [C:\Program Files\dotnet\sdk]
7.0.100-preview.7.22377.5 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.28 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.5 [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.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.0-preview.7.22376.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.28 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.5 [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.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.0-preview.7.22375.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.28 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.5 [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.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.0-preview.7.22377.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Issue Analytics
- State:
- Created a year ago
- Comments:7 (6 by maintainers)
@StanislavPrusac thanks for contacting us.
Are you trying to modify the views after they have been published? If so, you need to use runtime compilation for that, and even then, I am not 100% sure view overriding + runtime compilation is something we support.
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.
See our Issue Management Policies for more information.