Open AraHaan opened 1 year ago
While this is similar to https://github.com/dotnet/sdk/issues/462, I need the handlers from before the Web.Sdk inserted the additional handler which is rather problematic.
Looks like the real problem is the task assembly itself, disabling that entirely does not run transforms for Web.Debug.config
and Web.Release.config
when needed.
Hmm to me it looks like all that file is doing is setting up the 2 aspNetCore elements in the xml and then adding them to the web.config before finally adding the project guid at the bottom. Now to find where it would transform Web.Debug.config and Web.Release.config.
Describe the bug
Let's say for example you have a project that is the following:
bin\publish
, build outputs tobin\publish\bin
and roslyn tobin\publish\bin\roslyn
Along with the Web.config and other important files transformed to thebin\publish
.Now when you do an in place migration to SDK Style (without changing framework) and carefully made the needed changes to make the project compile (the migration tool sets output to Exe and nukes some important properties so reverting those will fix it) you will notice the following:
bin\publish
and notbin\publish\bin
for .NET Framework targets. Also even when referencing the nuget package "Microsoft.CodeDom.Providers.DotNetCompilerPlatform" it still refuses to copy roslyn into thebin\roslyn
folder within the publish directory and instead outputs .NET SDK warnings about RoslynCompilerFiles being recursively called.TransformWebConfigEnabled
tofalse
does not affect it at all either.Things I had to do after migration:
The diff between the Web.config files (yellow means added from the .NET SDK's Sdk.Web):
To Reproduce
Exceptions (if any)
No exceptions, just that I expect the publish directory to match for a project with no difference in framework, just the style of csproj (SDK vs non-SDK style for an important reason which is IIS which probably show exceptions when trying to use any of the razor pages (they are all razor pages cshtml files) with it not being able to find roslyn).
Further technical details
dotnet --info
:Runtime Environment: OS Name: Windows OS Version: 10.0.22631 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\8.0.100-preview.7.23376.3\
.NET workloads installed: There are no installed workloads to display.
Host: Version: 8.0.0-preview.7.23375.6 Architecture: x64 Commit: 65b696cf5e RID: win-x64
.NET SDKs installed: 6.0.413 [C:\Program Files\dotnet\sdk] 7.0.100-rc.2.22477.23 [C:\Program Files\dotnet\sdk] 7.0.110 [C:\Program Files\dotnet\sdk] 8.0.100-preview.7.23376.3 [C:\Program Files\dotnet\sdk]
.NET runtimes installed: Microsoft.AspNetCore.App 6.0.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.21 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 7.0.0-rc.2.22476.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 7.0.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 7.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 8.0.0-preview.7.23375.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 6.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.21 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.0-rc.2.22472.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 8.0.0-preview.7.23375.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 6.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.21 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 7.0.0-rc.2.22472.13 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 7.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 7.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 8.0.0-preview.7.23376.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found: x86 [C:\Program Files (x86)\dotnet] registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]
Environment variables: Not set
global.json file: Not found
Learn more: https://aka.ms/dotnet/info
Download .NET: https://aka.ms/dotnet/download