I'm playing with ASP.NET 5 (vNext) and I wanted add reference to project.json
file to my Database Project. Here it is:
project.json
{
"webroot": "wwwroot",
"version": "1.0.0-*",
"exclude": [
"wwwroot"
],
"packExclude": [
"**.kproj",
"**.user",
"**.vspscc"
],
"dependencies": {
"Microsoft.AspNet.Server.IIS": "1.0.0-beta1",
"EntityFramework.Commands": "7.0.0-beta1",
"EntityFramework": "7.0.0-beta1",
"EntityFramework.SqlServer": "7.0.0-beta1",
"Microsoft.AspNet.Identity.EntityFramework": "3.0.0-beta1",
"Microsoft.AspNet.Security.Cookies": "1.0.0-beta1",
"DataManagement": "" <----- THIS IS MY PROJECT WITHIN SOLUTION
},
"frameworks": {
"aspnet50": { },
"aspnetcore50": { }
}
}
DataManagement project is simply Class Library, however I tried with ASP.NET 5 Class Library. Both project types fail and this is what I see in visual studio:
Project is building properly and producing (of course) Datamanagement.dll, but this library isn't found by Web project.
To be exact, below there are target versions of both projects:
DataManagement: KRE-CLR-x86.1.0.0-rc1-10846
Web: KRE-CLR-x86.1.0.0-rc1-10846
json file is generated in the process of restoring the NuGet packages in projects that use project. json . It holds a snapshot of all the information that is generated as NuGet walks the graph of packages and includes the version, contents, and dependencies of all the packages in your project.
Project. json is an automatically generated file which is included in the folder of each automation project made in Studio. The file holds information about the project dependencies, and web services loaded in libraries.
Package references, using <PackageReference> MSBuild items, specify NuGet package dependencies directly within project files, as opposed to having a separate packages. config file. Use of PackageReference doesn't affect other aspects of NuGet; for example, settings in NuGet.
By default, both projects need to have the same parent folder.
For example, this pattern works:
But this won't:
Often the easiest is to ensure both projects have the same common parent folder.
But, if they can't, you can add a global.json
file to the "solution" folder and indicate where the sources are to be located:
{
"sources": ["sub1", "sub2"]
}
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