简体   繁体   English

如何从 Visual Studio 正确部署网站并使这个基于 ASP 的网站 function 正确?

[英]How do I properly deploy a website from Visual Studio and make this ASP based site function properly?

I'm sure there's something simple I'm missing.我确定我缺少一些简单的东西。

I'm attempting to help a buddy move his ASP site from one host to another to avoid some questionable billing practices.我试图帮助一个伙伴将他的 ASP 站点从一个主机移动到另一个主机,以避免一些有问题的计费做法。 I usually work with PHP-based sites (Wordpress etc.) and, unfortunately, have no experience with VS or ASP.我通常使用基于 PHP 的网站(Wordpress 等),不幸的是,我没有使用 VS 或 ASP 的经验。

He's temporarily moving to Godaddy on their Plesk offering temporarily until he can work out something else.他暂时在他们的 Plesk 产品上转移到 Godaddy,直到他可以解决其他问题。 He provided me with all of the files contained within his ftp (containing his site's default.asp file, header, footer etc.) as well as an archive.xml, parameters.xml, and a systemsinfo.xml file. He provided me with all of the files contained within his ftp (containing his site's default.asp file, header, footer etc.) as well as an archive.xml, parameters.xml, and a systemsinfo.xml file. No.snl file or anything like that. No.snl 文件或类似的文件。

The files did not come with a web.config file.这些文件没有附带 web.config 文件。 The error I keep getting, after uploading the FTP files is "HTTP Error 502.5 - Process Failure".上传 FTP 文件后,我不断收到的错误是“HTTP Error 502.5 - Process Failure”。 From my understanding, it's often related to the web.config file.据我了解,它通常与 web.config 文件有关。 And from what I understand, you can have one generated by deploying the site through VS.据我了解,您可以通过 VS 部署站点来生成一个。 Problem is, I'm at a loss as to what the proper actions to deploy this project.问题是,我不知道部署这个项目的正确操作是什么。

Plesk provides a.publish settings file, I'm just at a loss as to how to properly open this file in VS to then have it create a "web.config" file and proceed to have it publish to the hosting. Plesk 提供了一个 .publish 设置文件,我只是不知道如何在 VS 中正确打开此文件,然后让它创建一个“web.config”文件并继续将其发布到主机。 Part of this is I'm unsure how to properly open a project like this in Visual Composer to then proceed with the process of setting a web.config file and going forward with the deploying.部分原因是我不确定如何在 Visual Composer 中正确打开这样的项目,然后继续设置 web.config 文件并继续部署。

Not knowing exactly how to open this project without an.snl file or anything, I tried creating a new project and dropping in the other files to try and set up the process that way with no luck.不知道如何在没有 .snl 文件或任何东西的情况下打开这个项目,我尝试创建一个新项目并放入其他文件以尝试以这种方式设置过程,但没有运气。 Considering that Plesk provides a deploy file with that information, I'm assuming if I can properly open the project, working locally, I can then go through the deploy process.考虑到 Plesk 提供了包含该信息的部署文件,我假设如果我可以正确打开项目,在本地工作,然后我可以通过部署过程 go。 I'm just at a loss as to how I can properly setup a new project with someone else project files without an.snl file or otherwise.我只是不知道如何在没有 .snl 文件或其他文件的情况下使用其他项目文件正确设置新项目。

Any guidance that you provide would be awesome.您提供的任何指导都会很棒。

Thank you.谢谢你。

Well, if you missing basic files required to operate the site such as web.config, then you don't have the site or files required, right?好吧,如果您缺少操作站点所需的基本文件,例如 web.config,那么您没有所需的站点或文件,对吗?

Either FTP down the existing site, or you go to the source code and VS project, and re-compile the code, and re-publish.要么 FTP 下来现有的站点,要么你 go 到源代码和 VS 项目,并重新编译代码,并重新发布。 In fact, I suggest publishing to a local simple file folder.事实上,我建议发布到本地简单文件夹。

Even publishing to a local file folder is a good start.即使发布到本地文件夹也是一个好的开始。 Now, just copy that local folder that you published from the source code project, and that published folder should work on the new site.现在,只需复制您从源代码项目发布的本地文件夹,该发布的文件夹应该可以在新站点上使用。 But, really, missing files like web.config?但是,真的,缺少像 web.config 这样的文件吗? Rather fundamental that you have ALL files of that existing published site, or you have to go back to source code project in VS and re-publish.相当重要的是,您拥有该现有已发布站点的所有文件,或者您必须将 go 返回到 VS 中的源代码项目并重新发布。

since that site has vb.net or c# code?因为该站点有 vb.net 或 c# 代码? Then it also not clear if the original site was a然后也不清楚原始站点是否是

 asp.net web site

or或者

asp.net web site application.

Rather critical you determine the above.相当关键的你确定以上。 The reason is that for a asp.net web site application, then at publish time, all code is complied at publish time, source code is stripped out, and then you have a working site.原因是对于一个 asp.net web 站点应用程序,然后在发布时,所有代码都在发布时编译,源代码被剥离,然后您就有了一个工作站点。

If this is a web site (not web site application), then all source code is in fact published to the web site, and IIS is now responsible for compiling the .net code. If this is a web site (not web site application), then all source code is in fact published to the web site, and IIS is now responsible for compiling the .net code.

but, gooly, without a web config file, you simple don't have the files for that site to work - NOT even close但是,gooly,没有 web 配置文件,你根本没有该站点的文件可以工作 - 甚至没有关闭

but, as noted, if you have the original source code and VS project, then I would of course use the source code project for the publish.但是,如前所述,如果您有原始源代码和 VS 项目,那么我当然会使用源代码项目进行发布。 As noted, you can publish via FTP, and several other ways - but I in most cases use folder/file publish to a local folder, and then that is FTP up to the site.如前所述,您可以通过 FTP 和其他几种方式发布 - 但在大多数情况下,我使用文件夹/文件发布到本地文件夹,然后将 FTP 发布到站点。

You also don't mention if a database is involved.您也没有提及是否涉及数据库。 But, the connection strings to the database will FOR SURE change on the new site - and that boatload of required information will of course be in the web config file.但是,数据库的连接字符串肯定会在新站点上发生变化——所需信息的大量加载当然会在 web 配置文件中。

So, what road will much depend on if you going to download the exiting site, or your going back to the original source code and Visual Studio project.因此,如果您要下载现有站点,或者您要返回原始源代码和 Visual Studio 项目,那将在很大程度上取决于哪条路。

So, first step - which will take about 10 seconds of your time is to determine if this is a asp.net web site, or a asp.net web site application. So, first step - which will take about 10 seconds of your time is to determine if this is a asp.net web site, or a asp.net web site application.

If the existing published site has the c# (or vb.net) source code, then this was/is a web site.如果现有的已发布站点具有 c#(或 vb.net)源代码,那么这是/现在是 web 站点。

If the existing published site does NOT have the source code, then of course this was a asp.net web site application - and Visual Studio is responsible for compiling the code BEFORE publish.如果现有的已发布站点没有源代码,那么这当然是 asp.net web 站点应用程序 - Visual Studio 负责在发布之前编译代码。

I guess this really comes down to if you have the source code and the original project used to build the site in VS or not?我想这真的归结为你是否有源代码和用于在 VS 中构建网站的原始项目?

I mean, if you have the source code (not compiled) of that site and have the full project in VS, then that's your best starting point.我的意思是,如果您拥有该站点的源代码(未编译)并且在 VS 中拥有完整的项目,那么这是您最好的起点。 And if that site was published asp.net web site (application), then FTP and downloading the site WILL NOT get you a working asp.net project in VS. And if that site was published asp.net web site (application), then FTP and downloading the site WILL NOT get you a working asp.net project in VS.

This is much like saying you have a some.exe program, but don't have the source code and project used to build that.exe.这很像说您有一个 some.exe 程序,但没有用于构建 that.exe 的源代码和项目。

Same goes for asp.net. asp.net 也是如此。 but, as I stated, often the web site as opposed to web site application model is used, and in that case, then you would get and have the source code files by a simple FTP download. but, as I stated, often the web site as opposed to web site application model is used, and in that case, then you would get and have the source code files by a simple FTP download. But, you don't even have the web.config file - and that makes no sense at all, since that going to exist in the current site if you download, and it would exist in the original VS project used to create that site in the first place.但是,您甚至没有 web.config 文件 - 这根本没有意义,因为如果您下载它就会存在于当前站点中,并且它会存在于用于创建该站点的原始 VS 项目中第一名。 During a publish, we often have an additional config file that has the local database connections, and during publish, they are transformed into the correct database connections for the published site.在发布期间,我们通常有一个额外的配置文件,其中包含本地数据库连接,并且在发布期间,它们被转换为已发布站点的正确数据库连接。 But then again, you not even noted or mentioned if a database is involved here.但是话又说回来,你甚至没有注意到或提到这里是否涉及数据库。

I mean, if I was handed a LAMP project (Linux, Apache, MySQL, PHP), and had to publish that site?我的意思是,如果我收到了一个 LAMP 项目(Linux、Apache、MySQL、PHP),并且必须发布该站点? gooly, I not worked with LAMP, but I'm sure it would be a week, or more for me to figure that out, since I'm not familiar with LAMP, and how such sites are laid out, let alone how the configuration of such a site works.天哪,我没有使用过 LAMP,但我相信这需要一周或更长时间才能弄清楚,因为我不熟悉 LAMP,也不熟悉这些网站的布局,更不用说配置了这样一个网站的作品。 Big job if the whole system, programming language and framework is something you never used before.如果整个系统、编程语言和框架是您以前从未使用过的东西,那么这项工作就很重要了。

I know that Godaddy use Plesk control panel too.我知道 Godaddy 也使用 Plesk 控制面板。 But you need to make sure that Godaddy has support .NET Core.但是你需要确保 Godaddy 支持 .NET Core。 You may refer to this post https://dotnetblog.asphostportal.com/how-to-fix-error-502-5-process-failure-asp-net-core/ .您可以参考这篇文章https://dotnetblog.asphostportal.com/how-to-fix-error-502-5-process-failure-asp-net-core/ I believe it will solve your issue.我相信它会解决你的问题。

暂无
暂无

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

相关问题 如何在Visual Studio中正确显示MVC项目? - How do I make a MVC project appear properly in Visual Studio? 如何通过Web部署在Visual Studio中部署网站项目? - How do I deploy Web Site Projects in Visual Studio via Web Deploy? 如何在Visual Studios 2010 ASP.net网站中的JavaScript中调用Visual Basic函数? - How do I call my Visual Basic function from my javascript in a Visual Studios 2010 ASP.net website? 如何确保我的网站或基于HTML的网络应用程序能够在所有浏览器上正常运行 - How do I ensure my website or web app based on html works on all browsers properly 将网站从Visual Studio部署到Web服务器 - Deploy a website from Visual Studio to webserver 如何通过Visual Studio在线或Azure共享ASP.NET Web表单网站? - How do I share an ASP.NET web forms site through visual studio online or azure? 在构建ASP.NET网站时,如何查看Visual Studio生成的元项目文件? - How do I view the metaproj files generated by Visual Studio when building an ASP.NET website? 如何使用Visual Web Developer 2010 Express Edition部署ASP.NET MVC网站? - How do I deploy an ASP.NET MVC web site using Visual Web Developer 2010 Express Edition? 使用Visual Studio 2012部署ASP.NET网站(.NET 2) - Deploy ASP.NET Website (.NET 2) using Visual Studio 2012 如何获取“发布网站”命令为我的Visual Studio 2005网站项目发出PDB文件? - How do I get the “Publish Website” command to emit PDB files for my Visual Studio 2005 Web Site project?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM