CI / CD管道用于Legacy ASP.NET Web Forms应用程序

发布于 2025-02-10 10:50:22 字数 325 浏览 0 评论 0原文

我正在接管很久以前写的遗产ASP.NET Web表单应用程序。该应用程序不带一个.csproj文件或VS .SLN文件。所有DLL库仅简单地添加到bin文件夹中,并直接在代码中引用。所有CS类都添加到App_code文件夹中,并在代码中引用。

我们正在尝试集成此站点以利用CI / CD管道,但这非常具有挑战性。部分原因是因为我们没有项目文件或解决方案文件,所以我们无法使用MSBUILD。

我想知道以前是否有人处于类似情况。为此创建项目和 /或解决方案文件的最佳方法是什么?我们需要同时拥有一个项目文件和解决方案文件吗?您可以指出有关如何执行此操作的指南吗?

我希望我的问题很清楚。提前致谢!

I am taking over a legacy ASP.NET Web Forms application written a long time ago. The application does not come with a .csproj file or a VS .sln file. All DLL libraries are simply added to the bin folder and referenced directly in code. All CS classes are added to the app_code folder and referenced in code.

We are trying to integrate this site to make use of CI / CD pipelines but it has been very challenging. Part of it is because we cant make use of MSBuild because we don't have a project file or a solution file.

I was wondering if anyone has been in a similar situation before. What would be the best way to create a project and / or solution file for this? Do we need to have both a project file and a solution file? Any guides out there you can point to on how to do this?

I hope my question is clear. Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

吹泡泡o 2025-02-17 10:50:22

该应用程序不带一个.csproj文件或vs .sln文件

ASP.NET网站正常的VS .SLN文件。不需要SLN或需要项目文件。

当然,这意味着您不会使用打开项目打开网站,而是使用开放网站打开网站。因此,不需要CSPROJ甚至项目(SLN)文件,甚至不应存在。

所有DLL库仅简单地添加到bin文件夹中,并直接在代码中引用

然后直接在代码中直接引用,这对于网站来说是很正常的。

对于网站“应用程序”,然后引用外部库和.dll的(Assmeblies)与桌面非常类似。您添加了这些框架。然后,在部署时间,Visual Stuido将为您构建,编译和将所有.dll的所有.dll移至bin文件夹中。而且,您甚至可以选择在发布时间“合并”此类.dll。

在此时间点,如果您可以打开站点网站,查看网页,然后说右键单击并查看代码,则您的状态很好。

但是,您的网站文件夹也可能是ASP.NET网站“应用程序”的结果。如果是这种情况,那么网站将不会在后面的代码,因为Visual Studio进行了编译。当您使用ASP.NET网站(不是ASP.NET网站应用程序)时,则两个标记页面以及页面背后的代码应该存在。这也意味着网站(IIS)执行了代码的编译,而不是Visual Studio。

那么,您需要确定的唯一细节?

该网站是否具有标记页面,并且还具有源代码(背后的代码)?如果您没有页面后面的代码,那么您没有网站,而是网站应用程序发布的“结果”。这意味着您没有代码(源代码)。

但是,从Visual Studio打开网站不需要也不需要项目文件,也不需要SLN文件。

这会回答以上所有点和问题吗?

因此,我猜想的基本问题( 用于发布该网站应用程序的项目,没有此类应用程序,您不仅缺少源代码,还缺少保存在项目文件中的所有参考等。

为此创建项目和 /或解决方案文件的最佳方法是什么?< / p>

gee,如果这是一个网站而不是“应用程序”,那么您可能不想这样做(至少还没有这样做)。与网站应用程序相比,保留和使用网站的优势有很多优势,并且将设置所有参考文献的问题。

此外,Web服务器往往更容易接受网站,而不是网站应用程序。 (例如,它更易于复制或FTP网站更容易复制或FTP到Web服务器上的文件夹中的子站点。

如果主要启动页面是网站的主页,那么毫无疑问,它可以更容易地说转换。并将文件夹作为一个项目打开,因此将创建SLN文件。现在,尝试

使用网站转换为另一个巨大的优势,您可以使用一个代码,并

使用一个网站应用程序 。您现在必须重新发布整个网站,而我毫无疑问地说,您在帖子中指出,您要保持敏捷的开发网站是一个更好的选择。

因此,应用程序更加正式化,但很大程度上杀死了您在帖子中注意到的敏捷开发目标。

The application does not come with a .csproj file or a VS .sln file

That is normal for a asp.net web site. No sln, or project files are required.

Of course that means you do NOT open the site by using open project, but open the site by using open web site. As such, no csproj or even a project (sln) file is required, or should even exist.

All DLL libraries are simply added to the bin folder and referenced directly in code

Again, that's quite normal for web site.

For a web site "application", then references to external libraies and .dll's (assmeblies) is much like desktop. You add these refrences. then at deploy time, visual stuido will build, compile, and move all the .dll's into the bin folder for you. And you even have options to "merge" such .dll's into one .dll at publish time.

At this point in time, if you can open the site site, view a web page, and then say right click, and view code, then you are in great shape.

However, it is ALSO possible that your web site folder is the RESULT of a asp.net web site "application". If that is the case, then the web site will NOT have the code behind, since Visual studio did the compile. When you use a asp.net web site (not a asp.net web site application), then both the markup pages, and the code behind pages should exist. This ALSO means that the web site (IIS) does the compile of code, and NOT visual studio.

so, the only detail you need to determine?

Does the web site have BOTH the markup pages, and ALSO has the source code (code behind) pages? If you do not have the code behind pages, then you don't have a web site, but have the "results" of a web site application publish. This means you don't have the code behind (source code).

But, opening a web site from visual studio does not need nor require a project file, nor does it require sln file.

so, I guess the base question (that will quite much answer all of the above points and questions?

do you see + have the code behind pages on that site? Since if you do not, then you have to go find and get the original project used to publish that web site application, and without as such, you not only missing the source code, but all of the references etc. that are saved in the project file(s).

What would be the best way to create a project and / or solution file for this?

Gee, if this is a web site and not "application", then you may well not want to do this (at least not yet). There are quite a few advantages of keeping and using a web site as opposed to a web site application, and one issue will be setup of all the references.

Also, web servers tend to be far more tolerent of accepting a web site, then a web site application. (for example, it boatloads easier to copy or ftp a web site to a sub site in a folder on the web server.

If the main startup page is the main page of the web site, then it without question a lot easier to say convert, and open the folder as a project, and thus the sln file will be created. However, quite a few assumptions will have been made based on "application" vs non application, and if that's how the system was setup, then little advantages exist to now try and convert to a web application.

The other huge advantage? with a web site, you can modify one line of code, save, and you are done.

With a web site application, you change just one line of code, and you now have to re-publish the WHOLE site. So, while I without question prefer the application road? You noted in your post that you want to keep agile development, and if that is your goal, then hands down keeping this as a web site is a far better choice. You can change one line of code, save, and if that page + code is moved to the server, you are done.

so, a application is far more formalized, but quite much kills the agile development goal you noted in your post.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文