简体   繁体   English

IIS 7无法找到Microsoft.CodDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider DLL

[英]IIS 7 unable to find Microsoft.CodDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider DLL

So when deploying our web service using a customized build configuration, after deploying I get the error: 因此,在使用自定义构建配置部署Web服务时,部署后我会收到错误:

The CodeDom provider type "Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, could not be located. 无法找到CodeDom提供程序类型“Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider,Microsoft.CodeDom.Providers.DotNetCompilerPlatform”。

when trying to browse the site. 在尝试浏览网站时。 Looking in the bin\\~configurationName~ folder, I can find the specified DLL just fine though. 查看bin \\ ~configurationName~文件夹,我可以找到指定的DLL就好了。 The error is referencing these lines in my web.config: 错误是在我的web.config中引用这些行:

  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701" />
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" />
    </compilers>
  </system.codedom>

Odd thing is when building/deploying for Debug on the same server, I don't run into this issue and everything seems to work fine (which leads me to believe this error exists with my project configuration, not the deployment server). 奇怪的是,当在同一台服务器上构建/部署Debug时,我没有遇到这个问题,一切似乎都运行正常(这让我相信这个错误存在于我的项目配置中,而不是部署服务器)。 The configuration I'm building for when getting this error is our custom defined QA config, which outputs to bin\\QA, so I'm wondering if there's something special I need to do to get the ASP.NET compiler to look at special output folders? 我正在为获取此错误而构建的配置是我们自定义的QA配置,它输出到bin \\ QA,所以我想知道是否需要做一些特殊工作才能让ASP.NET编译器查看特殊输出文件夹?

The deployment solution for a longer term is avoid using Roslyn for the moment. 长期部署解决方案暂时避免使用Roslyn。

The problem is that you are using Roslyn Compiler and references on IIS. 问题是您在IIS上使用Roslyn编译器和引用。 Roslyn is still not having full support at many deployment servers. Roslyn仍然没有在许多部署服务器上获得完全支持。

Solution is to remove Roslyn as this won't affect project functionality! 解决方案是删除Roslyn,因为这不会影响项目功能!

I wrote similar answer to another question that is related to almost this kind of problem. 我给另一个与几乎这类问题有关的问题写了类似的答案。 Take a look at my answer https://stackoverflow.com/a/42668206/1436594 看看我的回答https://stackoverflow.com/a/42668206/1436594

So this was caused because I had nested all the assemblies for the site under a folder with the configurations name like you would do in a console/windows app (eg 'bin\\Debug'). 所以这是因为我在一个具有配置名称的文件夹下嵌套了站点的所有程序集,就像在控制台/ windows应用程序中那样(例如'bin \\ Debug')。 For web applications, the assemblies do not get nested under a config folder (eg they should go in 'bin\\'). 对于Web应用程序,程序集不会嵌套在config文件夹下(例如,它们应该放在'bin'中)。

Hope this helps others! 希望这有助于他人!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法找到CodeDom提供程序类型“Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider ...” - The CodeDom provider type “Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider …” could not be located "找不到 CodeDom 提供程序类型“Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider”" - The CodeDom provider type "Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider" could not be located Microsoft.CodeDom.Providers.DotNetCompilerPlatform 的问题 - Problem with Microsoft.CodeDom.Providers.DotNetCompilerPlatform 有没有办法在没有 nuget package 的情况下使用 Microsoft.CodeDom.Providers.DotNetCompilerPlatform? - Is there a way to use Microsoft.CodeDom.Providers.DotNetCompilerPlatform without a nuget package? 无法加载文件或程序集“Microsoft.CodeDom.Providers.DotNetCompilerPlatform 或其依赖项之一。” 访问被拒绝 - Could not load file or assembly 'Microsoft.CodeDom.Providers.DotNetCompilerPlatform or one of its dependencies. Access is denied 使用“ Microsoft.CodeDom.Providers.DotNetCompilerPlatform”包时,csc.exe编译时间降低 - csc.exe compilation time degradation when “Microsoft.CodeDom.Providers.DotNetCompilerPlatform” package is used 网站在 IIS 中运行时找不到 DLL - Unable to find DLL when website runs in IIS 找不到带有dll复制本地的Microsoft.XNA.Framework.dll - Unable to find Microsoft.XNA.Framework.dll with dll copied local 在IIS下找不到CSharpCodeProvider CompileAssemblyFromSource文件 - CSharpCodeProvider CompileAssemblyFromSource file not found under IIS 使用 Csharpcodeprovider 创建 DLL 并向其添加资源 - Creating DLL using Csharpcodeprovider and adding Resources to it
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM