将ASP.NET MVC应用程序发布到Web主机 - 在VS项目结构而不是应用程序中部署文件

时间:2021-02-03 03:31:27

I created a web application using ASP.NET MVC and want to publish to an online web hosting company that don't have any special extensions for VS etc.

我使用ASP.NET MVC创建了一个Web应用程序,并希望发布到一个没有VS等特殊扩展的在线Web托管公司。

I tried publishing by "FTP" but it has just copied all the files to the host, for example, the 'Views' folder with Index.cshtml has gone into (webhost)/Views/Index.cshtml and I still have the placeholder page supplied by my web host for the actual "root" of the domain (when I go to www.mysite.com)

我尝试通过“FTP”发布,但它刚刚将所有文件复制到主机,例如,带有Index.cshtml的'Views'文件夹已进入(webhost)/Views/Index.cshtml,我仍然有占位符页面由我的网站主机提供的域名的实际“根”(当我访问www.mysite.com时)

What am I doing wrong? What should I be doing?

我究竟做错了什么?我该怎么办?

The application works perfectly well deployed locally and in debug mode..

该应用程序在本地和调试模式下完美地部署。

Ugh!! I feel stupid for having to ask this but I think it's just a config issue and not something fundamental I've missed....hopefully!

啊!!我不得不问这个问题我觉得很愚蠢,但我认为这只是一个配置问题,而不是我错过的根本......希望!

1 个解决方案

#1


0  

I assuming that Your hosting provider supports ASP.Net.

我假设您的托管服务提供商支持ASP.Net。

You should try to publish Your site in Visual Studio using Web Deploy from generated publish settings file like so: https://msdn.microsoft.com/en-us/library/dd465337(v=vs.110).aspx

您应该尝试使用Web Deploy从生成的发布设置文件中在Visual Studio中发布您的站点,如下所示:https://msdn.microsoft.com/en-us/library/dd465337(v = vs.110).aspx

, also remember to modify You web config file by setting <compilation debug="true"> property to false.

,还记得通过将 属性设置为false来修改您的Web配置文件。

usually You can download Your publish settings file from your hosting configuration control panel after making few settings

通常您可以在进行少量设置后从主机配置控制面板下载您的发布设置文件

#1


0  

I assuming that Your hosting provider supports ASP.Net.

我假设您的托管服务提供商支持ASP.Net。

You should try to publish Your site in Visual Studio using Web Deploy from generated publish settings file like so: https://msdn.microsoft.com/en-us/library/dd465337(v=vs.110).aspx

您应该尝试使用Web Deploy从生成的发布设置文件中在Visual Studio中发布您的站点,如下所示:https://msdn.microsoft.com/en-us/library/dd465337(v = vs.110).aspx

, also remember to modify You web config file by setting <compilation debug="true"> property to false.

,还记得通过将 属性设置为false来修改您的Web配置文件。

usually You can download Your publish settings file from your hosting configuration control panel after making few settings

通常您可以在进行少量设置后从主机配置控制面板下载您的发布设置文件