You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Razor Runtime Compilation appears to be loading views of other apps
#25093
Please note that this is not yet a full bug report (hence not an issue), more like we have hunches that point in a strange direction. Any help in narrowing it down would be appreciated.
We're seeing signs of concurrently running apps getting their views mixed up, i.e. App A using App B's views with Razor Runtime Compilation. Precompiled views without Razor Runtime Compilation don't have this issue.
Details
Our CI environment runs multiple versions of the same app (from multiple branches) in parallel for UI testing. dotnet build is used to build the app, dotnet publish to publish it to a folder. Then, dotnet test executes UI tests (xUnit tests) which all will start the same app's web app project with dotnet My.App.dll (which is then interacted with from an automated browser).
We see occasions that two concurrently running instances of the app (which are built from slightly different codebases, from different branches of the same repository) get mixed up views if Razor Runtime Compilation is enabled. I.e. App A loads App B's views (so views built from the templates with modifications from App B's branch). Note that the two running apps mostly only differ in a few lines, so e.g. all the DLLs are named the same.
If we turn off Razor Runtime Compilation the issue goes away.
Is this something that can actually happen within Razor Runtime Compilation? We've resolved the issue by turning it off (it was a mistake having it on anyway since the views are actually precompiled) but we figured this is worth bringing it up if there is a chance we encountered a bug.
Further technical details
ASP.NET Core version: The app targets 3.1.
IDE: VS 2019 16.7.2 but where the app is built in our CI environment there's only Visual Studio Build Tools 2019
Output of dotnet --info:
.NET Core SDK (reflecting any global.json):
Version: 3.1.302
Commit: 41faccf259
Runtime Environment:
OS Name: Windows
OS Version: 10.0.14393
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\3.1.302\
Host (useful for support):
Version: 3.1.6
Commit: 3acd9b0cd1
.NET Core SDKs installed:
3.1.302 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
I'm not sure how that would be related. The app is not served via IIS.
Could it be though that somehow the apps clash due to some environment variables? The build doesn't set any (well, it sets one custom one for our own code but nothing else).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Please note that this is not yet a full bug report (hence not an issue), more like we have hunches that point in a strange direction. Any help in narrowing it down would be appreciated.
We're seeing signs of concurrently running apps getting their views mixed up, i.e. App A using App B's views with Razor Runtime Compilation. Precompiled views without Razor Runtime Compilation don't have this issue.
Details
Our CI environment runs multiple versions of the same app (from multiple branches) in parallel for UI testing.
dotnet buildis used to build the app,dotnet publishto publish it to a folder. Then,dotnet testexecutes UI tests (xUnit tests) which all will start the same app's web app project withdotnet My.App.dll(which is then interacted with from an automated browser).We see occasions that two concurrently running instances of the app (which are built from slightly different codebases, from different branches of the same repository) get mixed up views if Razor Runtime Compilation is enabled. I.e. App A loads App B's views (so views built from the templates with modifications from App B's branch). Note that the two running apps mostly only differ in a few lines, so e.g. all the DLLs are named the same.
If we turn off Razor Runtime Compilation the issue goes away.
Is this something that can actually happen within Razor Runtime Compilation? We've resolved the issue by turning it off (it was a mistake having it on anyway since the views are actually precompiled) but we figured this is worth bringing it up if there is a chance we encountered a bug.
Further technical details
dotnet --info:All reactions