简体   繁体   English

为新的 WEB 项目重用已发布的旧 ASP.NET 代码

[英]Reuse old published ASP.NET code for new WEB project

I have old VS ASP.NET project that published on GoDaddy web site.我在 GoDaddy 网站上发布了旧的 VS ASP.NET 项目。
Unfortunately I lost my local source code.不幸的是,我丢失了本地源代码。 Now I decided to continue with this project.现在我决定继续这个项目。
I downloaded all files.我下载了所有文件。

I already tried:我已经尝试过:

  1. Create new Project from existing code using VS2019.使用 VS2019 从现有代码创建新项目。 Output type - Console Application.输出类型 - 控制台应用程序。 I restored all references and packages.我恢复了所有引用和包。 I can't start this project to run as web project.我无法启动此项目以作为 Web 项目运行。
  2. Create new ASP.NET Web Application project and added existing project.创建新的 ASP.NET Web 应用程序项目并添加现有项目。 My new project starts, but I need to run the old one.我的新项目开始了,但我需要运行旧项目。
    What is correct way to accomplish it?实现它的正确方法是什么?

    Thanks in advance!提前致谢!
    Arkady阿尔卡季

Try opening the folder as a web site, and NOT open as application (since you don't have a sln project file anyway.尝试将文件夹作为网站打开,而不是作为应用程序打开(因为无论如何您都没有 sln 项目文件。

Hence use/try this option:因此使用/尝试此选项:

在此处输入图片说明

If the folder of files you downloaded does have source code files, then you be ok.如果您下载的文件文件夹确实有源代码文件,那么您就可以了。

However, if this was published as a web site application, then all source code is pre-compiled and stripped out.但是,如果这是作为网站应用程序发布的,则所有源代码都已预编译并被剥离。 If that is the case, then you need the origional project.如果是这种情况,那么您需要原始项目。

However, if it was published as a asp.net web site但是,如果它是作为 asp.net 网站发布的

and NOT as而不是

asp.net web site application? asp.net 网站应用程序?

Then you should be ok.那你应该没问题。

You know instant when you open a particular web page in the site - if you can view code, then your are fine.当您打开站点中的特定网页时,您会立即知道 - 如果您可以查看代码,那么您就可以了。 If you don't have the source code, and don't see it, then this was published as a web site application, and thus source code was stripped and only the compiled output in the bin file was published along with the mark-up pages, but as such no code files are published to the server (some exceptions exist such as app_code, but in general, you MUST have the original source files and project if this was a web site application as opposed to just a web site.如果你没有源代码,也没有看到它,那么这是作为一个网站应用程序发布的,因此源代码被剥离,只有 bin 文件中的编译输出与标记一起发布页面,但因此不会将代码文件发布到服务器(存在一些例外情况,例如 app_code,但一般而言,如果这是一个网站应用程序,而不仅仅是一个网站,则您必须拥有原始源文件和项目。

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

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