Debugging in Visual Studio.Net 2003
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > BizTalk Server > BizTalk Server > Debugging in Visual Studio.Net 2003




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Debugging in Visual Studio.Net 2003  
Craig Beuker


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-30-04 01:02 AM

Greetings all,

I have a question with respect to debugging code in VS.net.

I am playing around with building a BizTalk Adapter from scratch, anyways, I
am debugging the thing, each time I rebuild I have to re-attach to the
BizTalk Service exe.

Now, VS.net has option of specifying an executable to start when F5 is
pushed, and the development environment will automatically attach to that
process.  This would be **much** easier than manually having to attach to th
e
process.

So on the [Configuration Properties/Debugging] option of my adapter proj
ect,
I set the following properties.
Debug Mode: Program

Start Application:  D:\Program Files\Microsoft BizTalk Server
2004\BTSNTSvc.exe

Command Line Arguments:  -group "BizTalk Group"
-name "BizTalkServerApplication" -btsapp
"{4021EB62-BF92-4560-8FF3-E1608D92C7B8}"

I grabbed the command line arguments from those passed to the BTSNTSVC.exe
executable from the services properties.

However, whenever I press f5 to build/run my project I keep getting this
event raised by BizTalk 2004 in the event viewer:

Failed while loading the BizTalk NT service.
BizTalk host name: BizTalkServerApplication
Windows service name: BTSSvc{4021EB62-BF92-4560-8FF3-E1608D92C7B8}

Anyone know what I am doing wrong, or if this is even possible?  Have any
links to a description on how to get this working, It would save a bunch of
time.  I've been digging though the documentation, no luck there, nothing on
the net that I can find either..

Thanks in advance..

--

Craig Beuker





[ Post a follow-up to this message ]



    RE: Debugging in Visual Studio.Net 2003  
Gilles [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-03-04 01:59 AM

Hello,

>I have a question with respect to debugging code in VS.net.
>
>I am playing around with building a BizTalk Adapter from scratch, anyways, 
I
>am debugging the thing, each time I rebuild I have to re-attach to the
>BizTalk Service exe.
>
>Now, VS.net has option of specifying an executable to start when F5 is
>pushed, and the development environment will automatically attach to that
>process.  This would be **much** easier than manually having to attach to t
he
>process.

You see, BTSNTSVC.EXE is, as its name might suggest, an NT service. The prob
lem with NT services
is that they do not behave as real "programs". They are started and called b
y the SCM (Service Control Manager).
Essentially, it is not as simlpe as specifying the command line to BTSNTSVC.
EXE and pressing F5 because you
are debugging something a little different from a simple application.

The right way of doing is is to write a Visual Studio Macro in VB that perfo
rms the following actions:

1) Use BizTalk WMI to stop and restart the host that runs your adapter (this
 is to ensure that the new version built will be loaded)
2) Use Visual Studio Object Model to iterate throught the list of processes 
and attach the debugger to this process

Now, bind that macro (I'll call it DebugAdapter) to Shift+F5 or whatever you
 like and every time you want to debug, press shift f5.
Optionally, you can even include a full build of the solution in the macro.

Note that technically, the first step in the macro is not required for debug
ging but will save you an invaluable amount of time
by not debugging situations where your adapter has not been reloaded by the 
host.

The Visual Studio object model documentation is here: http://msdn.microsoft.com/li
...rl=/library/en-
us/vsintro7/html/vxgrfAutomationObjectModelChart.asp

It is a sensitive chart so clicking on an object will reveal its documentati
on. You want to see what is available under DTE.Debugger.

Thanks,
-Gilles.






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 12:02 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register