3

I am using a SharedAssemblyInfo file which seems to be a 'standard' technique: http://blogs.msdn.com/jjameson/archive/2009/04/03/shared-assembly-info-in-visual-studio-projects.aspx

I put the SharedAssemblyInfo.cs file into my web application because with web site projects I cannnot 'add files as a link'.

But now I need to add a second web project to the solution and obviously the SharedAssemblyInfo file cannot be within both projects.

How do I get round this problem without having duplicate SharedAssemblyInfo files?

Marc Gravell
  • 1,026,079
  • 266
  • 2,566
  • 2,900
simon831
  • 5,166
  • 7
  • 33
  • 50
  • Heres a video about this subject if anyone is interested: http://blogs.msdn.com/ericlee/archive/2006/07/20/sharing-files-in-team-foundation-server.aspx – simon831 Jun 10 '09 at 15:48

2 Answers2

2

Is it a web site or a a web project? With a web project the linked file should work fine... although personally I'd rather keep them separate and update them through my build script.

Marc Gravell
  • 1,026,079
  • 266
  • 2,566
  • 2,900
  • +1. For the payback you get (eliminate one SharedAssemblyInfo file), seems like anything above the bare minimal effort isn't worth it. – Cheeso Jun 10 '09 at 14:14
  • Sadly I'm using a web site not a web project, so I can't 'add as a link'. So I might have to use the build script. – simon831 Jun 10 '09 at 15:43
  • A minor point - you might want to clarify that in the question (done)... the two are very different, so getting the terminology right is important. – Marc Gravell Jun 10 '09 at 19:36
2

One way to solve this problem from within a web site as opposed to a web project is via your source control provider.

If you are using Visual Source Safe you can "share" the file to both projects (folders) and not branch. If you are using subversion 1.6 you can use a single file "externals" property. See this page for info.

In the case of Team Foundation Server, you can look at this codeplex article. I don't have any experience with TFS, but I think in the case of a SharedAssembly.cs the branch and merge solution would work fine.

This means you will have to check the file in in one location and check it out in the other location for the change to take effect. However, have the AssemblyInfo out of sync during the development process probably won't break anything.

Justin Dearing
  • 14,270
  • 22
  • 88
  • 161