2.8 KiB
Debugging with experimental ASP.NET Core bits
Sometimes it may be necessary to make changes in dotnet/aspnetcore
, and react to the changes in this repo. The following are steps which outline the general process in using ASP.NET Core development nupkg
s with Razor Tooling.
Steps
-
Checkout
dotnet/aspnetcore
, and follow the initialization instructions in the Build From Source guide. -
./restore.cmd
-
Make the desired changes in
dotnet/aspnetcore
. -
./eng/build.cmd -pack
. The-pack
option causes the creation of NuGet packages. -
You should see the generated packages in the
aspnetcore\artifacts\packages\Debug\NonShipping
directory. The packages should end withx.0.0-dev.nupkg
wherex
is the current .NET version. -
Open
razor/NuGet.config
and add the local package sources:<add key="ASPNETCORE_SHIPPING" value="<PATH_TO_ASPNET_CORE_REPO>\artifacts\packages\Debug\Shipping\" />
<add key="ASPNETCORE_NONSHIPPING" value="<PATH_TO_ASPNET_CORE_REPO>\artifacts\packages\Debug\NonShipping\" />
-
Open
razor/eng/Versions.props
and note the version forMicrosoftCodeAnalysisRazorPackageVersion
. Ex.5.0.0-rc.1.20380.7
. -
Do a find in
Versions.props
for the version in step 7 and replace withx.0.0-dev
. -
Get the assembly version of the
aspnetcore
packages.- Assembly version can be found by openning the
.dll
inILSpy
- Ex.
~/.nuget\packages\microsoft.aspnetcore.razor.language\6.0.0-dev\lib\netstandard2.0.nuget\packages\microsoft.aspnetcore.razor.language\{VERSION}.0.0-dev\lib\netstandard2.0\Microsoft.AspNetCore.Razor.Language.dll
- This is likely going to be the dev version
42.42.42.42
- Ex.
- Assembly version can be found by openning the
-
Update the
OldVersionUpperBound
andNewVersion
, of the Razor assemblies insrc\Razor\src\Microsoft.VisualStudio.RazorExtension\AssemblyBindingRedirects.cs
with the assembly version from the step above.
Notes
- ⚠️ Ensure you do not commit the changes to
razor/NuGet.config
&razor/eng/Versions.props
! - If you're still seeing build errors after performing the above steps, you may have to temporarily modify
OldVersionUpperBound
andNewVersion
of the first five assemblies in AssemblyBindingRedirects.cs to match the assembly version of the aspnetcore packages above. You can find the assembly version by opening one of the packages with ILSpy or similar tool. - If you find the old packages are still being used after this change, purge the nuget cache here:
~\.nuget\packages