如果ISP不使用BIN目录,如何部署ASP.NET MVC应用程序?

时间:2022-06-05 04:03:05

I need to do a Bin deployment on our ISP, Network Solutions. They have NET Framework 3.5 SP1 installed on their servers, but NOT ASP.NET MVC.

我需要在ISP,Network Solutions上进行Bin部署。他们的服务器上安装了.NET Framework 3.5 SP1,但不是ASP.NET MVC。

I need to point my application to a directory called cgi-bin instead of bin. Network Solutions says that this is the only directory they have marked for execution as medium trust. I need to put the System.Web.Mvc DLL and the application DLL there, and I need my ASP.NET MVC application to find them in that directory.

我需要将我的应用程序指向一个名为cgi-bin而不是bin的目录。 Network Solutions表示,这是他们标记为中等信任执行的唯一目录。我需要将System.Web.Mvc DLL和应用程序DLL放在那里,我需要我的ASP.NET MVC应用程序在该目录中找到它们。

It goes without saying that they won't put them in the GAC for me.

不言而喻,他们不会把它们放在GAC中。

How do I tell my application to look in the cgi-bin directory instead of the bin directory for the DLL's?

如何告诉我的应用程序查看cgi-bin目录而不是DLL的bin目录?


Solution is posted below.

解决方案发布在下面。

3 个解决方案

#1


After tinkering for awhile, I finally decided to deploy to an actual bin directory that I created (a procedure that Network Solutions says will not work) following Phil Haacked's instructions exactly, and it appears to be working.

经过一段时间的修修补补后,我终于决定部署到我创建的实际bin目录(Network Solutions所说的程序无法正常工作),完全按照Phil Haacked的指示,它似乎正在工作。

I did have to apply the routing patch described in ASP.NET MVC: Default page works, but other pages return 404 error, because Network Solutions is still running IIS6.

我确实必须应用ASP.NET MVC中描述的路由补丁:默认页面有效,但其他页面返回404错误,因为Network Solutions仍在运行IIS6。

For those who are interested, you can specify a different bin directory in web.config like this:

对于那些感兴趣的人,您可以在web.config中指定不同的bin目录,如下所示:

<runtime>
  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <probing privatePath="SomeFolder/bin" />
  </assemblyBinding>
</runtime>

I tried this with Network Solution's cgi-bin directory and my application did indeed find the mvc dll's.

我尝试使用Network Solution的cgi-bin目录,我的应用程序确实找到了mvc dll。

#2


You should be able to set the output directory or your project to cgi-bin if you want. If you right-click your project and click on Properties. From there you should be able to select Build in the left list of options and set the output directory to whatever you want.

如果需要,您应该能够将输出目录或项目设置为cgi-bin。如果右键单击项目并单击“属性”。从那里,您应该能够在左侧的选项列表中选择Build,并将输出目录设置为您想要的任何内容。

#3


Try moving to another ISP that will allow you to have a BIN directory as part of you application folder.

尝试移动到另一个ISP,它允许您将BIN目录作为应用程序文件夹的一部分。

#1


After tinkering for awhile, I finally decided to deploy to an actual bin directory that I created (a procedure that Network Solutions says will not work) following Phil Haacked's instructions exactly, and it appears to be working.

经过一段时间的修修补补后,我终于决定部署到我创建的实际bin目录(Network Solutions所说的程序无法正常工作),完全按照Phil Haacked的指示,它似乎正在工作。

I did have to apply the routing patch described in ASP.NET MVC: Default page works, but other pages return 404 error, because Network Solutions is still running IIS6.

我确实必须应用ASP.NET MVC中描述的路由补丁:默认页面有效,但其他页面返回404错误,因为Network Solutions仍在运行IIS6。

For those who are interested, you can specify a different bin directory in web.config like this:

对于那些感兴趣的人,您可以在web.config中指定不同的bin目录,如下所示:

<runtime>
  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <probing privatePath="SomeFolder/bin" />
  </assemblyBinding>
</runtime>

I tried this with Network Solution's cgi-bin directory and my application did indeed find the mvc dll's.

我尝试使用Network Solution的cgi-bin目录,我的应用程序确实找到了mvc dll。

#2


You should be able to set the output directory or your project to cgi-bin if you want. If you right-click your project and click on Properties. From there you should be able to select Build in the left list of options and set the output directory to whatever you want.

如果需要,您应该能够将输出目录或项目设置为cgi-bin。如果右键单击项目并单击“属性”。从那里,您应该能够在左侧的选项列表中选择Build,并将输出目录设置为您想要的任何内容。

#3


Try moving to another ISP that will allow you to have a BIN directory as part of you application folder.

尝试移动到另一个ISP,它允许您将BIN目录作为应用程序文件夹的一部分。