简体   繁体   English

ASP.NET将MVC应用程序放在子目录中

[英]ASP.NET Put MVC Application in a subdirectory

So I've bought a shared hosting and I want to put a separate asp.net mvc application in a subdirectory. 因此,我购买了共享主机,并想在子目录中放置一个单独的asp.net mvc应用程序。 In the root directory it has a normal asp.net application. 在根目录中,它具有正常的asp.net应用程序。

However when I upload the whole MVC project to the subdirectory I'm getting an configuration error: 但是,当我将整个MVC项目上传到子目录时,出现配置错误:

The code subdirectory '/mobile/App_Code/CSCode/' does not exist. 代码子目录“ / mobile / App_Code / CSCode /”不存在。

What can I do to make this working? 我该怎么做才能使它正常工作?

Thanks alot already! 非常感谢!

I have a similar scenario where i have GoDaddy shared hosting account. 我有一个类似的场景,其中我拥有GoDaddy共享托管帐户。 To make sure your MVC application work under ASP.Net sub-directory you have to take care of following points 为了确保您的MVC应用程序在ASP.Net子目录下工作,您必须注意以下几点:

  • Make sure you created your sub-directory by adding it as web application/ web site from hosting control panel. 确保通过从托管控制面板将其添加为Web应用程序/网站来创建子目录。
  • If you have any Begin or End request logic written in Global.ascx of parent ASP.Net website. 如果您在父ASP.Net网站的Global.ascx中编写了任何Begin或End请求逻辑。 Please modified it, to make sure it will by pass for this sub site. 请对其进行修改,以确保它将通过此​​子站点。 In the case of subsite always parent site Global.ascx logic fired first. 对于子站点,始终先触发父站点Global.ascx逻辑。
  • If needed Web.config of parent site should be reconfigured to support sub-site 如果需要,应将父站点的Web.config重新配置为支持子站点
  • Sometime shared hosting provider not have MVC component that you are using in their server GAC. 有时,共享托管服务提供商没有在其服务器GAC中使用的MVC组件。 So you have to keep it in your bin folder 因此,您必须将其保存在bin文件夹中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM