2

I have a question to the new Microsoft Projects in Visual studio 2015. At the moment each project has now is own project.json file where you can define Version author url etc. My question is now is it possible that we can have some of the Properties in a common.json file and share this offer all Solutions/Projects?

<Source Folder>
    Common.json
    <Solution1>
        <Project1>
            <Project1.json>
        <Project2>
            <Project2.json>
    <Solution2>
        <Project3>
            <Project3.json>
        <Project4>
            <Project4.json>

In older Visual Studio Version we solved this with a GlobalAssemblyInfo file we linked into the Project. We need this because we a couple 100 Projects which have the same Version number. Thanks for your ideas Michael

Michael Kröschel
  • 240
  • 1
  • 4
  • 13

1 Answers1

0

First, I don't think the properties defined in the project.json influence the assembly attributes that are defined in your AssemblyInfo.cs (and the global equivalent, in your case GlobalAssemblyInfo.cs). They are used for the metadata in the resulting NuGet package. Currently (and not sure if this is going to change but I don't think so) there isn't a way to include another file in a project.json file like you're describing.

To accomplish the same goal of having a global file that applies common assembly attributes, you have to edit each project.json file to include your common file. In your case, you would want to change your project.json so it looks like:

{
   "compileFiles": [ "..\..\GlobalAssemblyInfo.cs" ]
}
Scott Dorman
  • 42,236
  • 12
  • 79
  • 110