Wednesday, June 29, 2011

Yes even more adventures with DotNet and ColdFusion

Adventure: pre-build and post-build events in Visual Studio
This adventure is more of a work flow improvement. Now I had been pointing my CF code at the Visual studio project's bin folder for the assembly. I do this using ColdSpring and a config object that has blocks of settings per environment. So on local dev I point at the project but on integration, test and prod I point at an assembly (dll) that is with my CF package folder structure. So on my laptop it uses the dll in the project so every time I build (restart the ColdFusion .Net service first) I get the new code. However I am not testing the deployed assembly in the CF package and I had to copy it from my VS project when I wanted to release that version.


I used a post build event in VS to copy the dll from my project to the CF package with something like this.

copy /y "$(TargetPath)" "C:\YourWebSiteDir\notWebRoot\dotnet" 

Next I said why am I restarting the ColdFusion .Net service by hand.

Pre-build event:

Net stop "ColdFusion 8 .Net Service"

Post-build event (after the copy event):
Net start "ColdFusion 8 .Net Service"

So now I just build in VS and services are restarted and the dll updated in my CF source code.

No comments:

Post a Comment