Here is the accurate location of "bin syntax" in wiki https://github.com/aspnet/Home/wiki/Project.json-file#bin-syntax-wrapping-a-dll
The wiki reads:
You can create an project that, instead of compiling, references an already compiled dll and generates a package containing that dll
Please note that, with the "bin syntax", you are creating a project that uses the wrapped dll as its output (instead of compiling some source code to get the output dll). You are NOT adding a dll as a reference of target project.json.
Here is an example of the correct way to use "bin syntax" when you want to add a reference to a dll:
Assume we have:
- ASP.NET 5 project, ProjectA
- ClassLibraryB.dll, which was produced by some other type of project
To add a reference from ProjectA to ClassLibraryB.dll, we need to create a wrapper project wrapping ClassLibraryB.dll:
- Create a folder ClassLibraryB
Create a project.json in ClassLibraryB folder with the contents:
{
"frameworks": {
"dnx451": {
"bin": {
"assembly": "<path to ClassLibraryB.dll>"
}
}
}
}
- ClassLibraryB is an ASP.NET 5 project, add a reference from ProjectA to it as usual.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…