Unable to debug .Net Code. Could not attach to process. SQL CLR Remote Debugging

廉价感情. 提交于 2019-11-27 22:52:48

问题


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


回答1:


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



来源:https://stackoverflow.com/questions/14180009/unable-to-debug-net-code-could-not-attach-to-process-sql-clr-remote-debugging

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!