在 Visual Studio 2010 中禁用虚拟目录编译
我有一个在 Windows 2008 R2/IIS 7.5/.NET 4.0 上运行的网站。
最近,为了调试服务器本地的问题,我在 Web 服务器上安装了 Visual Studio 2010。当我点击文件->打开->网站-> [本地 IIS](我的站点)它可以很好地打开站点,但不会设置调试点,因为它指出“没有为此文档加载任何符号”。我每次遇到这个问题都是因为项目/解决方案不是在调试模式下构建的。我确实从本地计算机并在调试模式下发布到该服务器。
所以我想我应该在调试模式下再次构建解决方案。然而,Web 服务器有虚拟目录,其中包含用户上传的文件,我显然不希望 Visual Studio 编译这些文件,即使尝试编译也会崩溃。
我的问题是如何让 Visual Studio 2010 在编译时忽略虚拟目录,而不必从网站中删除它们?或者如何以 .pdb 文件正常工作并加载调试符号的方式发布到网站?
提前致谢。
I have a web site running on Windows 2008 R2/IIS 7.5/.NET 4.0.
Recently in order to debug a problem that was local to the server I installed Visual Studio 2010 on the web server. When I Clicked File->Open->WebSite-> [Local IIS] (my site) it opened the site just fine but wouldn't set a debug point as it stated that "no symbols had been loaded for for this document". Every other time I have run into this problem it has been because the project/solution wasn't built in debug mode. I did publish to this server from my local machine and in debug mode.
So I figured I would just build the solution again in debug mode. However, the web server has virtual directories that contain user uploaded files that I obviously don't want Visual studio to compile and it blows up if it even tries.
My question is how do I get Visual Studio 2010 to ignore the virtual directories when compiling without having to remove them from the web site? OR How do I publish to the web site in such a way that the .pdb file works correctly and the debug symbols are loaded?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为如果你做网站建设你就做不到。您可能想选择“构建页面”。
但我真的认为你的问题更多地与调试有关,而不是与构建有关。
确保 \bin 文件夹中包含所有 .pdb 文件,而不仅仅是 .dll 并尝试调试,附加到进程,然后选择名为 w3wp 的所有进程(如果您没有看到它,则有一些复选框可以显示所有进程)用户,请检查)。
I think you cannot do it if you do Build Website. You may want to choose Build Page instead.
But I really think your problem is related to debugging more than to build.
Make sure you have all .pdb files in the \bin folder not just .dll and try Debug, attach to process, and select all processes that are named w3wp (if you don't see it, there are checkboxes to show process from all users, check them).
从项目属性(Windows)中,将虚拟路径更改为斜杠(/)。
From project properties (windows), change the virtual path to just a slash (/).