Could I "inlcude" a C# source file?

For example, there are three C# project in my solution, and I want to synchronize their version. What I have to do now is to manually edit "AssemblyInfo.cs" file in every project. If there were a way to "include" a C# file, put information common to all projects in that file, it would be much easier to maintain it.

Thanks!



Answer this question

Could I "inlcude" a C# source file?

  • Nikhil Agarwal

    No, it's not what I want.

  • TonyL82

    I think what he want is to have a consistent and uniform metadata for all the asseblies in the solution, and link file is one the best way to achieve this
  • Chundaman

    Use the link file feature in VS.Net, all you have to do is create the file somewhere, maybe in your top project, go to other projecrs, add existing item, navigate to the file, intead of Open, there's a littel arror, choose link file
  • pelazem

    Thanks! It works for me.

  • Hakan at devBiz

    I suppose you could add a new C# file to your project:

    Project > Add New Item... Code File

    Write what you need to write in there and change the output type for that file to Class Library. Once it has compiled browse for the new .dll file in your solutions save file in the Add Reference dialog box. And once you have added it into your references all you need to do is go into you 'AssemblyInfo.cs' file and add the file to your using directives i.e.:



    using myCodeFile;

     


    I'm not really sure if this is what you wanted, if not please explain so I can try to help you.

  • Could I "inlcude" a C# source file?