R#6 : Web-site language level
I have a C# 3.5 web-site project. R# 6 is suggesting that I use C# 4 features in my code. The only language level options available are Visual Basic:.png)
In v5, I could manually add the CSharpLanguageLevel node to the .ReSharper file in the project directory, but this doesn't work with v6.
How do I tell R# that my .NET 3.5 project is using .NET 3.5???
Please sign in to leave a comment.
I've tried setting system.web/compilation/defaultLanguage="C#"; I've tried adding a C# Global.asax; nothing seems to convince R# that I'm using C#, not VB. I don't have any VB code in my project, but R# only offers VB language options.
In most cases, the language level doesn't really matter - VS2010 will happily compile code using some .NET 4.0 features even if you're targeting .NET 3.5. The one place it does matter is a web-site, where the code is compiled on the server, using the .NET 3.5 compilers. In this case, if you use any .NET 4.0 features, the site will not compile or run.
I have no intention of switching to VB.NET just to get R# working. Changing my web-site projects to web applications is not a sensible option either.
So how to I tell R# that my .NET 3.5 C# web-site project is targeting .NET 3.5, and to stop suggesting .NET 4.0 features?
Edit: Manually editing the Project.ReSharper file does still work; it was just suggesting a feature I didn't realise was supported in .NET 2.0! :8}
It would still be nice to have the correct options in the project properties, though.
Hello Richard,
Does this happen with that single web site only or with any newly created
C# web site? Do I understand correctly R# 5 worked fine? Thank you!
Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
It happens with all web sites.
I thought the behaviour had changed, but it seems to be the same as v5. Manually editing the "Site.ReSharper" file (formerly the "Site..ReSharper" file) to add the CSharpLanguageLevel tag works, but the properties of the site only offer VB language level options.