简体   繁体   中英

.Net / IIS server error - CodeDOM Provider Type Could Not Be Found

I have just installed Visual Studio Community 2015 and created a C# / Razor project using the C# template. This is supposed to create a 4 page sample website. The site is created correctly and runs on my development system.


The problem comes when I deploy it and try to run it from my IIS Server. (At this point, I am just verifying that I have everything installed correctly on the server). When I load the default page on the IIS server, I am getting an IIS / Parser error message:

The CodeDom provider type "Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" could not be located.

The error is being thrown from line 51 of the web.config file which says

Line 49: <system.codedom>
Line 50: <compilers>
Line 51: <compiler language="c#;cs;csharp" extension=".cs"
Line 52: 

type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Line 53: warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701"/>

Other configuration information shown from the server is:

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1055.0

I have seen discussions regarding installing the CodeDOM provider as part of Visual Studio but I don't think that that is my problem.

It seems that I need to install something else on my IIS 7 server. The problem is, I don't exactly know what to install or where to go to get it.

Can someone point me in the right direction please?

I fixed this by moving the /Bin directory from my project on my workstation to the IIS server. My project was stored on GitHub, but did not include the bin directory.

转到项目属性/网站/,然后按“创建虚拟目录”按钮

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM