Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Can't register service
john@cnet
#1 Posted : Wednesday, January 30, 2008 12:23:20 AM(UTC)
Groups: Member
Joined: 1/30/2008(UTC)
Posts: 1

Hi,

I am trying to register my web service from a TFSBuild script as part of a build, so that I can generate proxy information required for the rest of my build process.

I can execute the commands from a console prompt with no problem, but whenever I try and execute the commands from the build script (which runs as an NT service) the commands fail complaining that I am attempting to start the Cassini web service (which is alreadyb running).

The commands I am executing are:

net start "my service" & UltiDevCassinWebServer2.exe /register "{path}" {guid} MyService.asmx 2032 /DontKeepRunning

(the net start isn't neccessary, I've just added it to prove a point)

The output is:

net start "my service" & UltiDevCassinWebServer2.exe /register "{path}" {guid} MyService.asmx 2032 /DontKeepRunning
The requested service has already been started.
Attempting to run Cassini as windows service.
Use /? parameter to find out about how to use Cassini in console mode.
Cannot start service from the command line or a debugger. A Windows Service must first be installed (using installutil.exe) and then started with the ServerExplorer, Windows Services Administrative tool or the NET START command.

Is it possible to get "UltiDevCassinWebServer2.exe /register" to work when it is spawned as a cmd process from an NT service (i.e. with no UI).

Thanks
John

ps. The MS Build commands used in my csproj file are:

<Target Name="AfterBuild">
<Exec WorkingDirectory="\Program Files\UltiDev\Cassini Web Server for ASP.NET 2.0" Command='net start "UltiDev Cassini Web Server for ASP.NET 2.0" &amp; UltiDevCassinWebServer2.exe /register "{path}" {guid} MyService.asmx 2032 /DontKeepRunning' Condition="'$(IsDesktopBuild)'=='false'" ContinueOnError="false" />
<RunWSDLTask ProjectFolder="$(ProjectDir)" Condition="'$(IsDesktopBuild)'=='false'" ContinueOnError="false" />
<Exec WorkingDirectory="\Program Files\UltiDev\Cassini Web Server for ASP.NET 2.0" Command='UltiDevCassinWebServer2.exe /unregister {guid}' Condition="'$(IsDesktopBuild)'=='false'" ContinueOnError="false" />
</Target>

The <Exec> task basically starts a cmd console shell and executes the command.


Ultidev Team
#2 Posted : Wednesday, January 30, 2008 5:19:18 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Hi, John.

What you describe is caused by how our Cassini determines whether it is running as a service or as an interactive application. When the TFSBuild script is running as a service Cassini thinks it is also running as a service, instead of behaving like a command line utility. We've logged this as a bug and will fix it in the next version of the product.

To work around the problem we can suggest using Cassini Configuration API, which is a .NET assembly, and is very easy to use. So if TFSBuild allows you to execute .NET code, Cassini Configuration API should be a pretty painless alternative, and is guaranteed to work from under a service. Cassini Configuration assembly is located at "%ProgramFiles%\UltiDev\Cassini Web Server for ASP.NET 2.0\UltiDevCassiniServerConfiguration.dll". Once you have added a reference to it to your project, you can use static version of the Metabase.RegisterApplication method to register an application, and Metabase.UnregisterApplication to unregister it. In a worst case scenario, writing a simple console-based program that will use Cassini API to register/unregister an application, should be fairly trivial. That program could be launched by the TFSBuild script.

Please let us know if this information has helped.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Rss Feed  Atom Feed
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.