[英]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.config
的compilers
部分。
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=\"Web\" /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.