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?
Add Class Library Reference To use a class library in your application, you must add a reference to the library to access its functionality. Right click on the project name of your console app in Solution Explorer and select Add ->Reference option.
To add a file as a link, right click and choose Add > Existing Item… as before, but this time, don't click the Add button. Instead, click the little dropdown arrow next to the Add button and select Add as Link. Instead of copying the file into the project directory, Visual Studio will create a link to the original.
To serve static files from an ASP.NET Core app, you must configure static files middleware. With static files middleware configured, an ASP.NET Core app will serve all files located in a certain folder (typically /wwwroot).
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"
]
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With