question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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 issue

Is 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:closed
  • Created a year ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
javiercncommented, Sep 11, 2022

@StanislavPrusac thanks for contacting us.

I can’t set to use customize Identity UI Razor Pages after copying release in the publish folder,

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.

0reactions
msftbot[bot]commented, Oct 3, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to work custom Identity UI Razor Page of ASP.NET ...
I create publish release files Start WebAppApplication.exe, form publish folder, go to /Identity/Account/Login and also I do not see changes in ...
Read more >
Reusable Razor UI in class libraries with ASP.NET Core
Create reusable UI using the Razor class library project in ASP. ... NET Core templates assume the RCL content is in the Areas...
Read more >
Working with Razor Class Libraries in ASP.NET Core
The Identity UI RCL includes the Razor pages, filters, a stub EmailService class that Identity uses, and local versions of both Bootstrap 3...
Read more >
Customising the ASP.NET Core default UI without editing ...
In this post I show how you can replace the Razor views for the default UI, without taking ownership of the business logic...
Read more >
Razor Pages for ASP.NET Core - Full Course (.NET 6)
Learn the basics of Razor Pages for ASP.NET Core. This course is for anyone who is familiar with ASP.NET Core basics and wants...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found