1

I have successfully set up an API using ASP.NET MVC 4 on IIS6 (I used Phil's tutorial). When testing, we had it as the "Default website" and so there was no conflict with anything else. I am now being asked to set this up within a FOLDER of an existing website (the existing website is in ASP 1.0...and I cannot modify this...so I would some sort of virtual...something?). So basically, if we have https://www.ourcompany.com, they want the API to be available through https://www.ourcompany.com/api/.

Is this even possible? Phil's tutorial talks about setting up a Virtual Application, but I don't have that option in IIS (and if I had, I'm not knowledgeable enough about IIS to know if that would even allow me to access the API that way). I don't want anything that I set up to mess up the current website either, and there are a couple steps in the tutorial that I'll freely admit I don't fully understand.

If your curious as to WHY, the only advantage (besides being "neat") is so that the same SSL Cert can be used.

4

1 回答 1

2

是的,在我的工作中这绝对是可能的,我们有一个类似的设置,IIS6,一个 .NET 3.5 网络,下面嵌套了一个 .NET 4.0 网络。

您只需将其设置为父网站下的虚拟目录,将其指向您的文件夹,并确保“执行权限”下拉列表的值为“仅脚本”或更高版本,并且选择正确的 .NET 框架版本ASP.NET 选项卡。

您可能需要在子 web.config 文件中覆盖其他值,或者使用“位置”属性包装整个父 Web 配置。

忘了提一下,如果默认情况下不工作,您可能需要为子 Web 添加手动脚本映射。(这会将 .NET 4.0 脚本映射安装到特定的 Web)但再次不确定这是否是默认需要的。请参阅:http: //msdn.microsoft.com/en-us/library/k6h9cz8h.aspx

还有一件事 - 如果您使用的是 REST(或我相信 MVC 4 Web 将使用的无扩展 URL 映射) - 您需要添加一个“通配符”脚本映射,它基本上告诉 IIS 使用.NET 4.0 框架没有扩展 -请参见此处但是,在它们引用 .NET 2.0 文件夹的位置,您显然希望在 .NET 4.0 文件夹中引用相同的文件 :)

谢谢

于 2013-06-04T19:38:47.747 回答