Click here to Skip to main content
14,579,459 members
Rate this:
Please Sign up or sign in to vote.
See more:
I'm new to, and I'm having a problem running my project on the web server.
Visual Studio Community 2015, .Net Framework 4.5.2
The project runs fine on my local machine. I published it to the web server (using FTP), and when I run from the server I get an error. It chokes on the Web.config file at the line -

type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

The error that comes back is -

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

It seems like it is not finding the CodeDom compiler - or something like that, although I can see CodeDom stuff in the bin folder which uploaded ok.
My web hosting account is set to support 4.0 and 4.5
Is there something more I need to include in the project? Any help is greatly appreciated.

Updated 20-Apr-20 8:55am
[no name] 30-Sep-15 1:00am
Make sure that correct .Net Framework version is installed properly in your server. Secondly just check your application is pool is referring which version.
Member 11298827 30-Sep-15 13:29pm
Thanks for the reply - I am working with the hosting provider to verify the my account is set up properly. From what I can see, it is. To the second part of your comment - I have only one .ASP project on the server, so I don't think there could be a conflict. I think that is what you meant.

In references section of solution explorer I see Microsoft.CodeDom.Providers.DotNetCompilerPlatform being version, but runtime version v4.0.30319. In the error message from the server I see:
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34249.

So is 4.0.30319 the version for .NET Framework (and ASP.NET) or does it refer to the CodeDom compiler? I'm confused.
Rate this:
Please Sign up or sign in to vote.

Solution 1

I was finally able get this working - Initially I had created the project as a Web Application instead of Web Site. After recreating as a Web Site and publishing, all runs fine from the server. I noticed the Web.config file has no system.codedom section as does the one for Web App. so I guess that is not needed for a website.
Also - why is there only a DEBUG configuration and no RELEASE configuration for a Web Site project? What is the significance of that?
I would like to understand the difference between Web App and Web Site. Any suggestions?

By the way - I created the Web Site targeting .NET Framework 4.0 instead of 4.5.2 - don't know if that had anything to do with it - probably not.
Gustav Brock 17-Nov-16 17:45pm
"I had created the project as a Web Application instead of Web Site."

Why didn't I think of that? It took me two days to resolve this simple mistake. Thanks!
Rate this:
Please Sign up or sign in to vote.

Solution 3

try deploying on the root folder of your website. I had this problem because IIS did not recongize subfolders as part of the web site.
i've solved it by converting those subfolders to web applications, but first of all you should if the site runs OK on your root folder

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100