views:

320

answers:

4

So I have an ASP.NET 'Web Site' (as opposed to a Web Application) which has no AssemblyInfo.cs file or Bin folder or anything like that.

I want to have a way to specify an Assembly version number (e.g. 7.0.2.0). In a Web Application you would do this in an AssemblyInfo.cs file.

I've tried adding a Properties folder with an AssemblyInfo.cs file but I don't think its being picked up - because when I call Assembly.GetExecutingAssembly().GetName().Version.ToString() I get 0.0.0.0

So: What do I have to do to get AssemblyInfo.cs working OR how can I specify a version number?

+1  A: 

The version number sets the version of the dll. As you don't precompile web site projects, I'm not sure you can set a version number like this. You may just need to version by using a label or something in your source control system and mange this yourself.

Paul
It is possible, just not as easy as in a Web Application Project.
RichardOD
A: 

Try putting the AssemblyInfo class into the App_Code folder.

tomlog
+2  A: 

K Scott Allen has a post here, but personally i'd recommend you move to a Web Application Project.

RichardOD
That post is by Scott K. Allen - Not Scott Gu.
Matt Lacey
@Matt Lacey- thanks, not sure why I thought it was Scott Gu's blog- probably cause he blogged a lot about Web Application projects when they first came out.
RichardOD
Thanks, that link explains it all very well
codeulike
+1  A: 

There's no single assembly for you to set the version number of. You need to rethink what you're trying to accomplish.

John Saunders