我有一个用asp.net开发的网站。文件同时包含 aspx 页面和代码隐藏文件。当我尝试在 Visual studio 2010 中打开它时,我收到以下消息:
---------------------------
Microsoft Visual Studio
---------------------------
You are attempting to open a precompiled Web site. You can view the site, but changes might cause the Web site to stop functioning. To modify a site, it is recommended that you edit the files in the original Web site, precompile the site, and then publish it again.
Do you wish to continue and open this Web site?
---------------------------
Yes No
如何打开本网站进行编辑?
最佳答案
我知道这已经太晚了,但它可能对后续读者有用。
首先,Martuza Kabul 错了。您只需要 2 个文件,.aspx/.ascx/.master 和相关的 .cs(这意味着 .aspx.cs/.ascx.cs/.master.cs)
这里最有可能发生的情况是有人编译了该站点,并且 DLL 现在位于 bin 文件夹中。 (如果你像我一样幸运,他们也在源代码控制中..)
这是您需要执行的操作:
- 删除 PrecompiledApp.config 文件
- 删除 bin 文件夹中的所有非库 .dll 文件(我的文件是 WebApp_122141Xas 或类似文件,这些是已编译的代码隐藏文件。)
- 查看 .aspx/.ascx 页面的第一行 - 在该控制标记中 - 有一个“继承”属性...您将看到它有 2 个值,删除第二个值。
- 在同一控制标记中,请注意缺少 Codefile 属性。添加它并将其指向正确的代码隐藏文件。
应该是这样。希望这对某人有帮助。
关于asp.net - 您正在尝试打开预编译的网站,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13033274/