I always found it to be a bit of a pain to publish custom parts to Netcommunity - build the project, publish it, move the .dll file to the \bin folder and the .ascx files to the Custom folder etc. So I've made a little tool that will hopefully make it a bit easier.
It's a C# console application - the first time you run it, it asks for the paths to your Netcommunity \bin and \custom folders, and the path to your Visual Studio projects folder. Once you've done that once, it will store them for next time you run it.
It then asks you for the name of your Project - it searches for that project, and if it finds it the files (including .dll) are copied to the right places in the Netcommunity folder.
The best thing is that you can set up Visual Studio to run the program automatically every time you build a project - the program recognises that it is being called from Visual Studio, and does everything without asking for confirmation, automating the whole process.
As long as you run the file once by hand to set up the paths it needs, from then on you can get Visual Studio to run it automatically - here's how:
Adding Build Events to Visual Studio
In Visual Studio, go to 'Project' then '[Project Name] Properties'.
Click the Build Events tab.
In the 'Post Build Events' box, type the following:
cmd
cd C:\BBNC_Pub
BBNC_Copy_Data $(ProjectName)
The one bit you'll need to change is "C:\BBNC_Pub" - put in whatever directory you've stored the program in.
The above simply opens a command line, changes to the folder where the copying program lives, and then runs it with the name of your project as an argument. This causes the program to automatically find and copy the project files to the Netcommunity folder.
Do that for every project you create, and you're good.
Disclaimer - the program was quickly hacked out, probably has lots of bugs, etc etc. If it wrecks your computer, then that's too bad.
You can download it here - it's an .exe file. Save it to somewhere like C:\BBNC_Pub\, then run it and enter in the relevant paths. Once you've done that, you can either open the program manually and search for a Project, or get Visual Studio to run it automatically for you.
Let me know if you try it!
Subscribe to:
Post Comments (Atom)
have you looked at the publishing options in VS2010?
ReplyDeleteI've only played with them in dev/test but they seem to work well.
I'm not a fan of auto publishing to production so i run a separate script for that.
Nope I haven't, I'm still using VS2008, is there much difference between the two? I have VS2010 at home but haven't installed it yet.
ReplyDeleteI know what you mean about auto-publishing to a live environment, I'm only using this for our test server as it means I don't have to keep plugging long file paths into the build events box.
If VS2010 could handle all of it though, that would be ideal.
This comment has been removed by a blog administrator.
ReplyDeleteNot particularly interested in irrelevant comments about Blackbaud, especially when you appear to be doing it so you can plug something else.
ReplyDelete