无法调试.Net代码。无法附加到进程。 SQL CLR远程调试 [英] Unable to debug .Net Code. Could not attach to process. SQL CLR Remote Debugging

查看:455
本文介绍了无法调试.Net代码。无法附加到进程。 SQL CLR远程调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Visual Studio 2012 RTM中调试基于CLR的StoredProcedure。我有一个Sql数据库项目。当我尝试使用RightClick - > Execute with debugger调试我的脚本文件时,会弹出一个关于附加过程的有害性的警告,当我接受它时,只需说:


无法调试.Net代码。无法附加到
'Devserver'上的SQL Server进程。


我做了许多不同的事情:




  • 我已将域用户添加到sysadmin SQL Server角色。


  • 我已经在远程服务器上运行MSVSMON.EXE并设置其权限。


  • 我已经在属性窗格中配置了Visual Studio Project的ConnectionString。


  • 我已将当前域用户添加到远程服务器的本地管理员。 p>


  • 在Visual Studio的Sql Server对象资源管理器中,我选择了当前连接并勾选允许SQL\CLR调试


  • ...




但它仍然表示无法附加进程不是可以调试的源代码。



你有什么想法吗?我要忘记什么?



提前感谢

解决方案

很长一段时间在互联网上搜索,你的问题给了我答案我们的问题。
请仔细阅读以下内容


  1. 启动带有管理员权限的Visual Studio 2012

  2. 创建SQL Server项目

  3. 在项目设置/调试窗格中,提供数据库连接的连接字符串

  4. 从视图菜单中打开SQL Server对象资源管理器如果Project中提供的连接字符串不创建服务器实例,则在此处重新创建连接...

  5. 右键单击实例并选择允许SQL CLR调试,它将显示一些警告接受一切,但仔细阅读警告。

  6. 保存项目并执行重建,并通过生成的发布脚本测试项目发布。

  7. 现在在项目中创建一个非部署脚本,放置一个断点按ALT + F5执行脚本与Debug选项,当clr程序将发生并尝试进入它,它将要求进程附加窗口,请允许附加

以上步骤为我工作,并在此屏幕截图;
http://i.stack.imgur.com/GQwlt.png



有关更多信息,您还可以与我联系;
Vinod W. B. @ vinodwb@live.com


I'm trying to debug a CLR based StoredProcedure in Visual Studio 2012 RTM. I have a Sql Database Project. When I try to debug my script file using RightClick -> Execute with debugger it pop ups a warning about harmfulness of attaching a process and when I accept it just say that :

Unable to debug .Net Code. Could not attach to SQL Server process on 'Devserver'.

I've done many different things :

  • I've added my domain user to sysadmin SQL Server Role.

  • I've run MSVSMON.EXE on the Remote Server and set up it's permissions.

  • I've configured Visual Studio Project's ConnectionString in Properties pane.

  • I've added current domain user to Local Administrators of the Remote Server.

  • In Sql Server Object Explorer in Visual Studio I've selected the current connection and ticked 'Allow SQL\CLR Debugging'

  • ...

But it still says it cannot attach the process and there is not Source Code that can be debugged.

Do You have any idea ? what do I forget ?

thanks in advance

解决方案

Hi after a long time searching over internet, Your Question has Given me Answer of Our Question. Please understand following very carefully,

  1. Start Visual Studio 2012 with Elevated permissions of Administrator
  2. Create SQL Server Project
  3. In Project Settings/Debug Pane, Provide Connection String for Database Connection
  4. From View Menu, Open SQL Server Object Explorer, If your connection string provided in Project doesn't create Instance of Server, then Recreate connection here...
  5. Right click on Instance and Select Allow SQL CLR Debugging, it will show some warning accept everything but read warnings carefully.
  6. Save Project and perform Rebuild, and test a Publish of project by Generated Publish Script.
  7. Now Create a non-deployment script in project, put a break point press ALT+F5 to execute script with Debug option, when clr-procedure will occur and try to go inside it, it will ask for process to attach with windows, Please allow to Attach

above step worked for me, and here a screen shot of it; "http://i.stack.imgur.com/GQwlt.png"

For more information you can also contact me on; Vinod W. B. @ vinodwb@live.com

这篇关于无法调试.Net代码。无法附加到进程。 SQL CLR远程调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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