SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

folks! Running Sharepoint 2010 on Windows Server 2008, my iis7 reports that my sp web-application is running its application pool on .net v2.0. There is the choice for 4.0, but that breaks everything, so we use 2.0.

That being said, I have a custom aspx page that I want to insert into a page-viewer web-part, and still be a part of the same web-application - that is, I don't want to run it in its own application. However, I need this page to run in .net 4. Is there a way to do this?

I tried adding <compilation debug="true" targetFramework="4.0"/> to the web.config in the aspx's own directory, but it gives me a .net configuration error pointing out that the line has "Unrecognized attribute 'targetFramework'." Any clues here?

share|improve this question

The issue is that SharePoint 2010 is on .NET 3.5 (the .NET 2.0 stack). Which means the SharePoint web application does not in anyway support .NET 4.

You would need to run that .NET page in a different web application with a different application pool. (You can create the application under the same IIS site, however you MUST use a different application pool).

share|improve this answer
I understand about creating a different application pool and a different web application, but what do you mean "create the application under the same IIS site?" – bgmCoder May 2 '12 at 17:07
In IIS 7, right-click the Site (like Default Web Site), Add Application. This adds an application that is bound a to subfolder of the site. – John Chapman May 2 '12 at 17:09
I don't want the page to be accessible except through sharepoint's https web-page-viewer, which is why I wanted to use it through sharepoint's application pool in the first place... – bgmCoder May 2 '12 at 17:09
If I add the application like you say, could it have any adverse effects on my sharepoint site? I don't have a test-server, I only have a live production server (we are poor). – bgmCoder May 2 '12 at 17:10
You won't be able to run it as a part of SharePoint or its app pool. As for the application under the SharePoint IIS site, you shouldn't run into any issues as long as the name of the application (the /directory) doesn't clash with SharePoint content. – John Chapman May 2 '12 at 17:13
up vote 0 down vote accepted

According to this article: ASP.NET 4 Web Sites Fail to Start on Computers Where SharePoint Is Installed you cannot run a .net 4 application within a .net 2 application.

It seems that the way to do it is to use a web-page-viewer web part and display a page from an entirely different web-application. The above-mentioned post says you can do it with a regular website, but not with sharepoint.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.