2

I have a solution with multiple projects and a website. On each project I have set up a pre build event to get the highest subversion revision number of the project (using SubWCRev) and then replace part of the AssemblyVersion with that revision number.

How do I achieve this on a website? As far as I can tell there is no pre build event and if I try to:

  1. Add another project
  2. Make the website dependant on the project
  3. Use the pre build event for the project

The subversion revision number used to replace information in the website will be for the project not the website.

Any ideas?

Jack Mills
  • 6,022
  • 5
  • 34
  • 38

1 Answers1

1

One suggestion might be to use a Web Application project - rather than a Web Site project. Although this might not be entirely feasible in your case, depending on the amount of work required to essentially migrate the existing code-base.

See this question and its answers for more information: ASP.NET Web Site or ASP.NET Web Application?

Community
  • 1
  • 1
Grant Thomas
  • 44,454
  • 10
  • 85
  • 129
  • I'd like to avoid this if possible. I'm making changes to an existing website which is huge. I imagine going down the conversion route will cause a huge number of errors? – Jack Mills Mar 22 '11 at 15:02
  • 1
    There really shouldn't be any huge migration issues - create a web application project and add your existing code-base for the site to it, backup the original and replace with the new project folder - in VS, remove the web site and add an existing project (your newly created one). Build and feel the joy. – Grant Thomas Mar 22 '11 at 15:08
  • I changed the project type GUID from E24C65DC-7377-472B-9ABA-BC803B73C61A to 349C5851-65DF-11DA-9384-00065B846F21 but visual studio won't load the project – Jack Mills Mar 22 '11 at 15:10
  • I changed my previous comment as it dawned on me that I was talking about altering project files when, really, the site itself wouldn't have had one - and I didn't want you messing up the solution file. Try my updated suggestion in the comment above. – Grant Thomas Mar 22 '11 at 15:12
  • Can I just say while I'm in the process of doing this it sucks you can't just select "Add existing folder" in VS. I'm having to manually add each folder in the folder structure then go "Add existing item" – Jack Mills Mar 22 '11 at 15:55
  • Can't you just drag the folders from the file system into the solution explorer tree? Sure you can... cascade Windows Explorer and VS alongside one another and give that a go. – Grant Thomas Mar 22 '11 at 15:56
  • 1
    Excellent, something to note for anyone reading this. Make sure you don't have windows explorer showing hidden folders otherwise VS will blow it's top when trying to copy in the hidden svn folder – Jack Mills Mar 22 '11 at 16:41