Last post Oct 11, 2012 09:53 AM by Akrion
Oct 08, 2012 09:04 AM|Akrion|LINK
Here is the install which works and compiles great prior to .net 4.5 framework install.
.net 4.0 framework installed, ASP.NET web site which is targeting .net 3.5 in the build preferences and has all the "start up" and "legacy" entries in the web.config as well as in IIS runs in the .net 2.0 classic app pool. When build is initialed it builds
fine since it is not compiled against .net 4.0 compiler which we all know is much stricter. Again it compiles with no issues.
Enter .net 4.5 framework install (with no changes what so ever done to the project) is fails to compile since it tries to compile against .net 4.0 and up. All the web.config entries are there the app pool is again set to .net 2.0 classic and it still compiles
for .net 4.0. I know because the errors I get are identical of those I was getting when I set the app pool to work on .net 4.0 prior the .net 4.5 install.
So how can I force the VS2010 and the compiler to target .net 3.5 and not .net 4.0 when I have all the web.config suggested by MS entries as well as the app pool is set to 2.0?
Thanks in advance.
PS. What I mean by web.config legacy & startup:
I have the compiler section as well:
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=3.5.30729.1, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="OptionInfer" value="true"/>
<providerOption name="WarnAsError" value="false"/>
Oct 09, 2012 12:12 AM|kctt|LINK
Right click on website project > Property Pages > Build > Target Framework
Oct 09, 2012 07:06 AM|Akrion|LINK
I should have mention that I have tried that as well. If you think about it I would have never been able to compile my 3.5 project on 4.0. Net machine without seting the target framework to 3.5 which in essence does nothing more than modify your web.config
with the lines of code I already specified above plus few more (like the MS assemblies being changed to 3.5 etc.)
Oct 09, 2012 03:06 PM|Akrion|LINK
FYI: We uninstalled .net 4.5 and installed .net 4.0 without making any changes to the IIS/project properties/target build framework/web.config etc. VS2010 compiles without a single error! Just like it used to before we installed .net 4.5.
This is kinda of big deal to us since we want to jump to vs2012 ASAP but at the same time keep our current 3.5 projects running as you might imagine.
Anyway still fighting with this issue without any luck ...
Oct 10, 2012 09:27 AM|Akrion|LINK
UPDATE: Any framework combination with the web.config section bellow makes no difference.
<startup><supportedRuntime version="v2.0.50727"/><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup>
Oct 11, 2012 12:31 AM|necro_mancer|LINK
does this issue happen on the server or your local PC?
Have you checked the .NET framework on your application pool?
Oct 11, 2012 09:53 AM|Akrion|LINK
Yes the app pool is set to classic 2.0. However I do not think that matters since VS2010 wont even compile and build. In VS target framework as stated already is 3.5.
This happens on my local dev machine and on all dev machines in out environment on which the 4.5 was installed.