I have an ASP.NET (2.0) site. I am on my dev box using V Studio 2008 and IIS. I have a separate User Control project that gets called from a javascript function in the default.aspx page. The User Control project is in another solution.
我有一个ASP.NET(2.0)站点。我在使用V Studio 2008和IIS的开发箱上。我有一个单独的User Control项目,可以从default.aspx页面的javascript函数调用。用户控制项目在另一个解决方案中。
The application is running as expected. The user control is being called and all is well. Well not quite.
应用程序正在按预期运行。正在调用用户控件,一切都很顺利。好吧不太好。
I am unable to step into the User Control project, i.e debug it. I can set breakpoints but they never get trapped. I can debug all other areas of the site both in script and code behind without any problems. The User control gets built in DEBUG to the same location as the default.aspx page.
我无法进入用户控制项目,即调试它。我可以设置断点,但它们永远不会被困。我可以在脚本和代码后面调试网站的所有其他区域,没有任何问题。 User控件在DEBUG中构建到与default.aspx页面相同的位置。
Things i have already tried: Enabled script debugging in IE. Added the User Control project to the same web site solution Attached debugger to running instance of IE from Visual Studio Enabled debugging on the site. Built the user control in debug mode and ensured the pdb is in the same directory
我已经尝试过的事情:在IE中启用脚本调试。将User Control项目添加到同一网站解决方案附加调试器从Visual Studio中运行IE实例在站点上启用调试。在调试模式下构建用户控件并确保pdb位于同一目录中
Below is some sample code which should help:
以下是一些应该有用的示例代码:
default.aspx: (Cut down for brevity)
default.aspx :(为简洁而减少)
function LoadMethod() { try { LoadControl.Ping();
function LoadMethod(){try {LoadControl.Ping();
}
catch (e) //if the DLL didn't run assume there is a trust problem.
{
}
}
When i go to step into the call to LoadControl.Ping, the debugger just steps over this line of code.
当我进入对LoadControl.Ping的调用时,调试器只是跨过这行代码。
Please only give feedback if you have actually done this in practice.
如果您在实践中实际执行此操作,请仅提供反馈。
2 个解决方案
#1
1
- Add the user control project to the solution you want to debug in.
- Remove the reference you have to the user control project
- Then set the reference of the calling project, to be the local user control project
将用户控件项目添加到要调试的解决方案中。
删除您对用户控件项目的引用
然后将调用项目的引用设置为本地用户控件项目
Edit: You might also have to do a clean after you remove the reference on the second step - then check that your bin doesn't have a copy of the user control dll
编辑:您可能还需要在第二步删除引用后进行清理 - 然后检查您的bin是否没有用户控件的副本dll
#2
0
This is an old question, but it still googles up, so here's something that might help. This post talks about dotnetnuke modules, but I think the concept is what you were talking about - Main web project with secondary web projects that contain user controls.
这是一个老问题,但它仍然是谷歌,所以这里可能有所帮助。这篇文章讨论了dotnetnuke模块,但我认为这个概念就是你所说的 - 包含用户控件的辅助Web项目的主Web项目。
Something the blog post doesn't mention: Once you've set your project to use IIS rather than webdevwebserver, and set the override URL(s), you sometimes have to do something extra to get debugging working. Right click the project -> Debug -> Start New Instance. This seems to be the only way I can reliably debug one of our usercontrol projects. Mind you, that particular project has been dragged kicking and screaming from 1.1 to 3.5, so it's probably unhappy about a few other things :-)
博客文章中没有提到的东西:一旦你将项目设置为使用IIS而不是webdevwebserver,并设置覆盖URL,你有时必须做一些额外的事情才能使调试工作。右键单击项目 - > Debug - > Start New Instance。这似乎是我可以可靠地调试我们的一个usercontrol项目的唯一方法。请注意,那个特定的项目已经从1.1到3.5被踢和尖叫,所以它可能对其他一些事情感到不满:-)
#1
1
- Add the user control project to the solution you want to debug in.
- Remove the reference you have to the user control project
- Then set the reference of the calling project, to be the local user control project
将用户控件项目添加到要调试的解决方案中。
删除您对用户控件项目的引用
然后将调用项目的引用设置为本地用户控件项目
Edit: You might also have to do a clean after you remove the reference on the second step - then check that your bin doesn't have a copy of the user control dll
编辑:您可能还需要在第二步删除引用后进行清理 - 然后检查您的bin是否没有用户控件的副本dll
#2
0
This is an old question, but it still googles up, so here's something that might help. This post talks about dotnetnuke modules, but I think the concept is what you were talking about - Main web project with secondary web projects that contain user controls.
这是一个老问题,但它仍然是谷歌,所以这里可能有所帮助。这篇文章讨论了dotnetnuke模块,但我认为这个概念就是你所说的 - 包含用户控件的辅助Web项目的主Web项目。
Something the blog post doesn't mention: Once you've set your project to use IIS rather than webdevwebserver, and set the override URL(s), you sometimes have to do something extra to get debugging working. Right click the project -> Debug -> Start New Instance. This seems to be the only way I can reliably debug one of our usercontrol projects. Mind you, that particular project has been dragged kicking and screaming from 1.1 to 3.5, so it's probably unhappy about a few other things :-)
博客文章中没有提到的东西:一旦你将项目设置为使用IIS而不是webdevwebserver,并设置覆盖URL,你有时必须做一些额外的事情才能使调试工作。右键单击项目 - > Debug - > Start New Instance。这似乎是我可以可靠地调试我们的一个usercontrol项目的唯一方法。请注意,那个特定的项目已经从1.1到3.5被踢和尖叫,所以它可能对其他一些事情感到不满:-)