开发者

Hosting a .NET 4.0 Web Service in IIS 6

I am trying to host a 2nd website (outside of Default Web Site, which is already used) that is a web service supported by .NET 4. This is IIS 6.

The Default web page is using .NET 2.0. In IIS 6 you can have two seperate websites running different versions of .NET by creating two distinct application pools. I've done this.

However I am running into a common problem where the ASP.NET tab does not appear in IIS. That tab allows you to set which version of .NET a site uses.

My workaround is to change the .NET version that each site references through command line:

aspnet_regiis -s (site path)

The other solution to this problem is to switch IIS to 64-bit mode, which causes the ASP.NET tab to actually appear. The problem is that switching IIS to 64-bit does not jive well with the existing website, even after reconfiguring IIS to reference the following directory,

Microsoft.NET/Framework64

as opposed to

Microsoft.NET/Framework

Is anyone experienced with hosting seperate pages on one server like this? This is a nightmare. I can actually get the 2nd page to work, but then the original default page fails, and vice versa.

I now have IIS in 32-bit mode and ran the following from cmd line:

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis -lk
W3SVC/  2.0.50727.3053
W3SVC/1/ROOT/   2.0.50727.3053
W3SVC/87257621/root/    4.0.30319.1

Which shows clearly that my 2nd website (which has ID 8725721) is set for .NET 4 whereas the original set (ID 1) is set for .NET 2. They are in seperate appli开发者_StackOverflow社区cation pools.

Under this configuration the initial site works. On the new site I can browse the directory but the .asmx page produces a 404 error.

I have gotten the .asmx page to work as intended, when I enabled IIS for 64-bit mode, but then the default web site gave a 'Service unavailable' generic error because .NET was installed from the Framework path rather than Framework64 path. However even after switching to the Framework64 path more errors came up from the default page.

Also, before I change the target framework of the website Im trying to run to .NET 4, this error shows up in the Event Viewer:

Failed to initialize the AppDomain:/LM/W3SVC/87257621/Root

Exception: System.IO.FileLoadException

Message: Could not load file or assembly 'System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Access is denied.


Under the web service extensions in IIS, is ASP.NET 4.0 set to allowed?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜