So let's say I have my app pool set for "4.0.30319". In Visual Studio, my project settings are set for ".NET Framework 4.6.2".
In my web.config, there is a line:
<httpRuntime targetFramework="4.5" maxRequestLength="30720" executionTimeout="36000"/>
And 4.8 is actually installed on the server running ISS.
Now lets say there was a change in behavior shipped in, say, 4.7. Will I see the new behavior in my application?
According to the docs:
If the version of the .NET Framework that the application was built against is present on the computer, the application runs on that version.
If the version of the .NET Framework that the application was built against is not present and a configuration file does not specify a version in a Element, the application runs on the latest version of the .NET Framework that is present on the computer.
If the version of the .NET Framework that the application was built against is not present and the configuration file specifies a version in a Element, the application runs on the latest version that is specified in the application configuration file and is present on the computer.
So I would say 4.8, You can always check it programmatically using:
Environment.Version
Additionaly check out this question.
Related
I'm reporting this error when I try to execute in debug the application:
The application you are trying to debug uses a version of the Microsoft .NET Framework that is not supported by the debugger.
The debugger has made an incorrect assumption about the Microsoft .NET Framework version your application is going to use.
The Microsoft .NET Framework version specified by you for debugging is incorrect.
I'm using Visual Studio 2008 and .NET Framework 3.5.
I've got this problem with a particular project. Another project with the same framework and visual studio version works perfectly.
This suggests me that this is a problem of the project.
Any idea of why? Which property to set?
Thank you very much
Check to ensure that the application pool you are running the site under is set for the correct .Net runtime version. In IIS you can set that up in IIS Manager site configuration. With IISExpress you just need to modify the applicationhost.config file to set the site to use the correct app pool, or configure the app pool to use the proper version.
I built a web app using dotNet 4.5. I went into IIS and created a new app pool but there was not 4.5 option, only 4.0 and 2.0. I went to install 4.5 and it says "already installed". I do a google search and see infact the registry and explorer show it to be installed.
What gives?
Although the .NET Framework Version column shows "v2.0" and "v4.0" for .NET Framework versions, these equate to ASP.NET 3.5 and ASP.NET 4.5.
Due to the internals of how application pools bind to .NET Framework versions, the actual version name written to configuration (and thus displayed in the tool) corresponds to the original .NET Framework file version.
Your question is tagged as IIS7 but the link information regarding .net versions is applicable.
Soruce: http://www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-using-aspnet-35-and-aspnet-45
I have an application built using .NET version 4.5
I created a site in IIS and pointed it to my application, but I'm receiving this error:
The 'targetFramework' attribute in the element of the Web.config file is used only to target version 4.0 and later of the .NET Framework (for example, ''). The 'targetFramework' attribute currently references a version that is later than the installed version of the .NET Framework. Specify a valid target version of the .NET Framework, or install the required version of the .NET Framework.
This applications works correctly if I'm running it on my local machine, but for some reason I can't get it to run with IIS.
Select the correct application pool...
http://technet.microsoft.com/en-us/library/cc731755(v=ws.10).aspx
I have seen many answers to similar questions, but have an additional question
I developed a web site in Visual Studio 2008. Working well on development server. When I tried to transfer it to client's server, it is giving the error:
Could not load file or assembly 'System.Core, Version=3.5.0.0'
Noticed that client's server has version 2.0.0.0 and 4.0.0.0. Changing my development environment to VS2010 might work, but is there any simpler solution (something like modifying web.config file)?
In short: If I develop with 3.5.0.0, can the site be loaded to 2.0.0.0 OR 4.0.0.0 by modifying the web.config file? (It is logical that some compatibility/flexibility will be there between development and deployment set up I hope!). My web site is pretty simple, but have a MS SQL db interactions.
When you read v2.0 and v4.0 from IIS settings, that simply means at least .NET 2.0 and .NET 4.0 are installed on the machine, and thus registered in IIS the two versions of CLR.
However, to run a .NET 3.5 based web application, you exactly need .NET 3.5 installed on the machine. Although installing .NET 3.5 reuses CLR 2.0, it is a must to provide System.Core which is required by your application.
Make sure you choose v2.0 for your IIS application pool, so that IIS loads CLR 2 and initializes automatically .NET 3.5 required assemblies for your application.
I have downloaded published (code behind files are no there, combined with dll in bin folder) web application from Window Server 2008 where it is hosted, and open it with Visual Studio when I debug that application it shows following error:
"Could not load assembly because this assembly is built by a runtime newer than the currently loaded runtime"
I don't know how can I solve this problem and test application locally.
Please help me.
This errors happens when the DotNet framework you are using is of older version than the one used to build the assembly. You need to check which version of framework is used to build those assemblies and then use the same or higher to debug too.
I was getting this same error when running an installer for a Windows service, even when running the installer on the PC the installer was built on.
It turned out that although the Windows service project had been updated to .NET 4.5, the Setup project that was making the installer was still set to use .NET 2.0.
To check if the Setup project is using an older version of .NET than the project to be installed, in the Visual Studio Solution Explorer:
Expand the Setup project;
Under the Setup project, expand Detected Dependencies;
Under Detected Dependencies select Microsoft .NET Framework and check the Version property. Select the appropriate .NET version from the dropdown list;
Re-build the Setup project to create a new version of the installer.
This error can have a lot of other reasons, too. I had the same problem, and nothing helped until I stumbled across this:
TlbExp.exe error:This assembly is built by a runtime newer
I just ran into this issue when the assembly was built with a target framework of .NET 4, and v4.0.30319 was installed on the server, and other 4.0 apps were running successfully.
The problem arose because the app had originally been built targeting 2.0, and new 4.0 assemblies were pushed, but not the app.config file, which we generally update separately.
This means the supportedRuntime attribute was not updated in the config and caused the error. Adding the following to the app.config fixed our issue:
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>
One the the assemblies reference in the project might be built using a newer version of .net, check version of every assembly reference and correct accordingly.
Also check the application pool that this web site is running as. It could be framework 2.0 default on some older windows servers. Change it to framework 4.0.