Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
I'm new to ASP.net, 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=1.0.0.0, 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=1.0.0.0, 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 ASP.net 4.0 and 4.5
Is there something more I need to include in the project? Any help is greatly appreciated.

Victor
Posted
Updated 20-Apr-20 8:55am
Comments
[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 1.0.0.0, 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.

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.
 
Share this answer
 
Comments
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!
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
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900