I've added a .NET Core RC2 class lib to my solution (for fun) and the first thing I usually do is add a link to a shared GlobalAssemblyInfo.cs
and edit the existing AssemblyInfo.cs
down to the assembly specifics.
So I've just done "Add"->"existing item", located my file and clicked the dropdown of the add button. No "Add as Link" option.
What's the deal? How do I do this with .NET Core?
I don’t think the tooling supports this yet, and unfortunately, the documentation is not up to date on this yet.
However, you can get an idea on how this works from this ASP.NET Core announcement. Basically, you can add individual file paths to the buildOptions.compile.includeFiles
setting in your project.json
:
{
"buildOptions": {
// …
"compile": {
// …
"includeFiles": [
// …
"../shared/GlobalAssemblyInfo.cs"
]
}
}
}
Copy of JimmyBoh comment on Jul 28, 2016 on https://github.com/aspnet/Tooling/issues/147:
For non-compilable files a simple work-around is to edit your xproj with the same XML generated within a csproj. For example:
<ItemGroup>
<Content Include="..\..\Some\Common\Project\file-to-be-shared.json">
<Link>linked-copy.json</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
The only downside is that it does not work when using the dotnet CLI tools, just Visual Studio.