如何在Visual Studio中将Web应用程序转换为Web站点? [英] how to convert web application to web site in visual studio?

查看:150
本文介绍了如何在Visual Studio中将Web应用程序转换为Web站点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法将网页应用程序转换为网站?

is there any way to convert web application to web site ?

推荐答案

参考 - 将ASP.NET Web应用程序转换为ASP.NET WebSite [ ^ ]

Refer - Convert ASP.NET Web Application to ASP.NET WebSite[^]
引用:

好的 - 假设你有备份,这就是我的意思解决它:



删除csproj文件

从Windows资源管理器中删除任何 designer.cs 文件

仍然在资源管理器中,在网站的根目录创建一个App_Code文件夹

查找任何 *。cs 不是代码隐藏的文件(例如, .ascx.cs .aspx.cs )并将它们移动到App_Code文件夹中

在Visual Studio中作为网站项目打开

验证.NET FX版本

更改 CodeBehind = CodeFile = 在任何 .aspx .ascx 文件

读取任何第三方参考资料

全球范围内存在一些潜在的复杂情况.asax,ASHX处理程序(需要内联)和引用页面和控件。你不得不手动处理这些 - 我担心 - 但如果这是一个小小的努力,它应该很容易实现。

Ok - assuming you have a backup, this is how I would tackle it:

Delete the csproj file
From within Windows Explorer, delete any designer.cs files
Still in Explorer, create an App_Code folder at the root of the site
Find any *.cs files that aren't code behinds (eg., .ascx.cs or .aspx.cs) and move them into the App_Code folder
Open in Visual Studio as Web Site project
Verify .NET FX version
Change CodeBehind= to CodeFile= in any .aspx or .ascx files
Readd any 3rd party references
There's some potential complications around Global.asax, ASHX handlers (need to be inline) and referencing pages and controls. You'll have to deal with those manually, I'm afraid - but if it's a smallish effort, it should be easily doable.


这篇关于如何在Visual Studio中将Web应用程序转换为Web站点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆