ASP.NET web applications as virtual directories of a Sharepoint 2010 site

ccwestbrook
ccwestbrook used Ask the Experts™
on
I have several ASP.NET 3.5 web applications that I need to have run as virtual directory applications on a sharepoint 2010 site.  However when I try to do that it doesn't work.  I thought it had to do with the framework version and tried using different application pools, but to no avail.  Also tried converting the web apps to .NET 4.0 using Visual Studio 2010 also with no luck.  any ideas?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
What do you mean by "it doesn't work".  Are you getting an error messages?  Most common issue is that each of these applications need to be made applications in IIS.  What version of IIS are you running?

Author

Commented:
It throws an internal server error 500.  Its Server 2008 R2.  

Commented:
In IIS, go to the directory that is an application, right click and choose "Convert to Application".  Click OK to accept the default settings.  See if that helps.

You will need more information from the server.  If all you are getting is "500 Internal Server Error" you may need to access the site from the server (using Remote Desktop Connection) or turn off Friendly HTTP Errors in IE.
Announcing the Winners!

The results are in for the 15th Annual Expert Awards! Congratulations to the winners, and thank you to everyone who participated in the nominations. We are so grateful for the valuable contributions experts make on a daily basis. Click to read more about this year’s recipients!

Author

Commented:
It is an application in IIS.  I went to try to change the errors section for the app and received the attached error message.  Maybe it is a web.config compatibility issue between versions of .Net or something?  


iis-error.jpg

Commented:
IIS7 defaults to using .NET 4.0.  You could either change the application pool to use .NET 2.0 (which supports 3.5 as well), or modify your web.config file.

The machine.config file for 4.0 already includes the System.Web.Extension handlers, thus the duplicate error.  You either need to downgrade the app pool to 2.0, or remove the offending httpHandler entries from your web.config.  You can either remove them one at a time until it starts working, or do a Google search to determine which ones to remove (this looks like a good resource: http://stackoverflow.com/questions/1808680/web-application-problems-web-config-errors-http-500-19-with-iis7-5-and-asp-net)

Author

Commented:
It's strange because the pool is using 2.0.  I can run the application off of a different site on the same server, but when I put it on the sharepoint site it doesn't work even using the same application pool.  

Commented:
Are you are sure you converted it to an application?  Just having it as a virtual directory isn't sufficient.

Author

Commented:
Yes, I add it as an application.  It works on one site, but not on the sharepoint site

Author

Commented:
Here's the IIS console
screen.jpg

Commented:
Is the applications running under the same apppool as "Sharepoint - 80"?

Commented:
I am reading (http://www.eggheadcafe.com/software/aspnet/31168652/creating-virtual-directory-under-sharepoint-site-in-iis.aspx) that you may need to add a site exclusion for the Virtual Directory.

Author

Commented:
Yep, it runs unde the same pool.  I've tried changing pools too.  The application works fine in the WebApps site I created, it just doesn't work in the sharepoint site.  the site exclusions are no longer used as of Sharepoint 2007.  very strange problem
Commented:
I guess I would try removing the "duplicate" entries in the web.config file.  Look specifically at the httpHandlers in system.webserver

Author

Commented:
Thanks for your help.  I had to remove those entries, then I had to add a session state module, change the trust level, and it works now

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial