Tuesday, January 16, 2007

install Webpart dll's into your MOSS Server GAC with a simple VS post-build event

after many different tries how to automate that local deployment from the Win XP machine to my MOSS 2007 Development Server instance i figured out my way how to do this:

- Build your solution and your DLL is deployed :-)

that's all. I think that's pretty cool.

so how you do it:

- download PsExec v1.73
- create 2 batch files (*.bat or *.cmd)

- Batch No. 1: run's as post build event of your compilation

- this file should include the following steps:
1. receives as argument the dll full path and just the dll name;
e.g:
Arg 1: C:\MyProjects\VisualStudioSolution\Moss\indexus.net.dll
Arg 1: indexus.net.dll
2. you copy your arg 1 to a share on your server
2. you call your batch no. 2 with arg 2

- Batch No. 2: run's as remote batch file over psExec.

- don't forget that psExec is running like a local command line
on your server, you need to know where you have call it.

- C:\cmd\psExec.exe -d \YourServerName C:\YourServerShare\[arg no.2]

hope this helps!

2 comments:

Anonymous said...

psExec only works with the '-d' param. Otherwise Visual Studio freezes.

But when you use the '-d' parameter, the only return value is 'gacutil started on *** with process ID 5720.'
and Visual Studio interprets this as an Error with Errorcode 5720.

Is there meanwhile an easier way to do the above thing?

greez+thx
dataCore

roni schuetz said...

i do not have such behaviours within visual studio, but you can run the batch job manually. did you tried to run this manually?

Shared Cache - .Net Caching made easy

All information about Shared Cache is available here: http://www.sharedcache.com/. Its free and easy to use, we provide all sources at codeplex.

Facebook Badge