Skip to content
欢迎扫码关注公众号

IIS 编译器失败,错误代码为 -2146232576

把新写的 ASP.NET MVC 代码发布到 阿里云虚拟机后,报如下错误:

编译器失败,错误代码为 -2146232576

参考了 iis 错误 -2146232576asp.net mvc5 本机调试正常,发布到服务器上提示编译错误,编译器失败错误代码未 -2146232576 ,都是通过升级 .NET Framework4.6 解决的,但是阿里云的共享云虚拟主机经过我的测试,最高支持到 4.5.1

不能升级 .NET Framework,那就只能使用低版本的包了。根据 iis 错误 -2146232576 中的说法,是由于 Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll 导致的。但其实该包从 1.0.4 ~ 1.0.8 都是同时支持 .NET Framework 4.5.NET Framework 4.6 的。

  • .NET Framework 4.5Microsoft.Net.Compilers (>= 1.3.2)
  • .NET Framework 4.6Microsoft.Net.Compilers (>= 2.4.0)

最新的 Microsoft.CodeDom.Providers.DotNetCompilerPlatform 2.0.0 倒是没有任何依赖项,但是升级到 2.0.0 并且删除 Microsoft.Net.Compilers 包后再发布,会报一个需要 Microsoft.Net.Compilers 包的错误。

重新安装了 Microsoft.CodeDom.Providers.DotNetCompilerPlatform 1.0.8 版,同时自动安装了依赖的最低版本 Microsoft.Net.Compilers 1.3.2。再次发布到云虚拟主机,就能正常访问了。

Page Layout Max Width

Adjust the exact value of the page width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the page layout
A ranged slider for user to choose and customize their desired width of the maximum width of the page layout can go.

Content Layout Max Width

Adjust the exact value of the document content width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the content layout
A ranged slider for user to choose and customize their desired width of the maximum width of the content layout can go.