-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Razor runtime compilation produces errors if running on a shared runtime that's rolled forward #7969
Comments
The issue is two parts:
|
FYI @rynowak |
@wdmeeste1 could you run |
Is there a fix for this? |
@pranavkm Is there a solution now? |
dotnet --info
|
Updating all the Microsoft.* nuget packages from 2.1.0 to 2.1.1 seems to fix the problem: <PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="2.1.1" />
<PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="2.1.1" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.1.1">
<PrivateAssets>All</PrivateAssets>
</PackageReference> |
We'll try and address this in the runtime. In the meantime, the fix is to ensure your app's compiling against the runtime it'll target. Like I mentioned in my earlier comment, this problem crops up because your app's compiling against an older version of the runtime, but running against a newer one. Making sure the two are in sync should fix this. Here's what you would need to do to ensure that, some of which are re-iterations of https://docs.microsoft.com/en-us/aspnet/core/migration/20_21?view=aspnetcore-2.1#rules-for-projects-targeting-the-shared-runtime
|
Solution it worked out! Version with bug NEW |
…ime that's rolled forward Do not provide compilation references from runtime MVC assemblies. This avoids cases where the app is compiled against an older MVC but running against a newer one (e.g. shared fx roll forward) resulting in compiling against multiple versions of MVC assemblies Fixes #7969
…ime that's rolled forward Do not provide compilation references from runtime MVC assemblies. This avoids cases where the app is compiled against an older MVC but running against a newer one (e.g. shared fx roll forward) resulting in compiling against multiple versions of MVC assemblies Fixes #7969
2.1.3 - #7989. Tracking release verification via https://github.com/aspnet/Release/issues/316 |
…ime that's rolled forward Do not provide compilation references from runtime MVC assemblies. This avoids cases where the app is compiled against an older MVC but running against a newer one (e.g. shared fx roll forward) resulting in compiling against multiple versions of MVC assemblies Fixes #7969
Still not working, having SDK version 2.1.400 with Runtime 2.1.2 installed ONLY and same exception occurs when trying to edit cshtml while debugging in VS Code. |
This issue continues to occur for me, randomly, as I build my application on the command-line while Visual Studio 2017 is open. SDK: 2.1.403 |
@BeePM \ @csharpfritz, could you file a new issue with a repro app? The original issue happened all the time with runtime compilation and I just verified it does not repro with the latest runtime. |
dotnet new Mvc
. Update the project file to specify a version for the shared runtime. Specify an older runtime e.g.<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.0" />
The compilation produces an error:
The text was updated successfully, but these errors were encountered: