RoslynCodeDomProvider icon indicating copy to clipboard operation
RoslynCodeDomProvider copied to clipboard

Cannot use RoslynCodeDomProvider on .NET 7

Open matteot opened this issue 1 year ago • 0 comments

Hi, I'm trying to use your package from a console app (.NET 7) and I obtain the error shown below. On the other hand everything works correctly if I reference and run your package in .NET 4.8. Is .NET7+ is a supported scenario ? Best regards, Matteo

Unhandled exception. System.TypeInitializationException: The type initializer for 'Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CompilationUtil' threw an exception.
 ---> System.TypeLoadException: Could not load type 'System.Web.Configuration.WebConfigurationManager' from assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
   at Microsoft.CodeDom.Providers.DotNetCompilerPlatform.AppSettings.EnsureSettingsLoaded()
   at Microsoft.CodeDom.Providers.DotNetCompilerPlatform.AppSettings.get_RoslynCompilerLocation()
   at Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CompilationUtil.GetProviderOptionsFor(String fileExt)
   at Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CompilationUtil..cctor()
   --- End of inner exception stack trace ---
   at Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CompilationUtil.get_CSC2()
   at Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider..ctor(IProviderOptions providerOptions)
   at Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider..ctor()

matteot avatar Dec 29 '23 14:12 matteot