简体   繁体   English

无法找到CodeDom提供程序类型“Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider ...”

[英]The CodeDom provider type “Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider …” could not be located

I published my website using visual studio publish option to my host. 我使用visual studio发布选项向我的主机发布了我的网站。

my host uses asp.net 4.5.1 framework. 我的主机使用asp.net 4.5.1框架。

it works fine in local but after I published it, it gave this error. 它在本地工作正常,但在我发布后,它给出了这个错误。

在此输入图像描述

my local visual studio solution folder contains a folder named packages and it contains some files is it related to error? 我的本地visual studio解决方案文件夹包含一个名为packages的文件夹,它包含一些与错误相关的文件?

This is my config file(other lines omitted for the sake of clarity): 这是我的配置文件(为清楚起见省略了其他行):

在此输入图像描述

Thank you. 谢谢。

The assembly version in the bin folder must match the version indicated in the compilers section of web.config file. bin文件夹中的程序集版本必须与web.config文件的compilers部分中指示的版本匹配。

This error happens to me when i update the server bin folder. 我更新服务器bin文件夹时发生此错误。 Because the package Microsoft.CodeDom.Providers.DotNetCompilerPlatform was updated i needed to update the compilers section of web.config too. 因为Microsoft.CodeDom.Providers.DotNetCompilerPlatform包已更新,我需要更新web.configcompilers部分。

It can be done by simply updating the version attribute on the below example or replacing by entire section with the developer version. 可以通过简单地更新以下示例中的version属性或用开发人员版本替换整个部分来完成。

<compilers>
  <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.3.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.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" />
</compilers>

Doesn't require IIS restart. 不需要重新启动IIS。

Please go to Project > Properties. 请转到项目>属性。 in "Package/Publish Web" tab and in "Items to deploy(applies to all deployment methods)" section and select "All files in this project folder" from drop down list and then Publish your Web Application again, 在“打包/发布Web”选项卡和“要部署的项目(适用于所有部署方法)”部分中,从下拉列表中选择“此项目文件夹中的所有文件”,然后再次发布Web应用程序,

Hope Helpful. 希望有帮助。

暂无
暂无

声明:本站的技术帖子网页,遵循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 Microsoft.CodeDom.Providers.DotNetCompilerPlatform 的问题 - Problem with Microsoft.CodeDom.Providers.DotNetCompilerPlatform 无法加载文件或程序集“Microsoft.CodeDom.Providers.DotNetCompilerPlatform 或其依赖项之一。” 访问被拒绝 - Could not load file or assembly 'Microsoft.CodeDom.Providers.DotNetCompilerPlatform or one of its dependencies. Access is denied 有没有办法在没有 nuget package 的情况下使用 Microsoft.CodeDom.Providers.DotNetCompilerPlatform? - Is there a way to use Microsoft.CodeDom.Providers.DotNetCompilerPlatform without a nuget package? 无法找到 CodeDom 提供程序类型“Microsoft.VisualC.CppCodeProvider”,尝试编译 node_modules - CodeDom provider type 'Microsoft.VisualC.CppCodeProvider' could not be located, trying to compile node_modules Web 应用程序构建错误:无法找到 CodeDom 提供程序类型 Microsoft.VisualC.CppCodeProvider - Web Application Build Error: The CodeDom provider type Microsoft.VisualC.CppCodeProvider could not be located 使用“ Microsoft.CodeDom.Providers.DotNetCompilerPlatform”包时,csc.exe编译时间降低 - csc.exe compilation time degradation when “Microsoft.CodeDom.Providers.DotNetCompilerPlatform” package is used 找不到 ASP.NET CodeDom 提供程序错误 - ASP.NET CodeDom provider could not be located error 如何修复配置错误“无法找到 CodeDom 提供程序类型”和解析错误“无法加载类型”导致彼此? - How to fix configuration error 'The CodeDom provider type could not be located' and parsing error 'Could not load type' leading to each other? .Net / IIS服务器错误-找不到CodeDOM提供程序类型 - .Net / IIS server error - CodeDOM Provider Type Could Not Be Found
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM