I have .csproj
project and I want to reference other project that is .xproj
, everything looks fine but when I try to build solution then I cannot because the .dll is missing. When i reference the .dll
from \bin\release\net452\...
itself then everything is ok. How to fix that?
EDIT: I am not looking for workarounds - now I am using gulp with gulp.move(). It works fine but it feels dirty...
It is not possible to reference a xproj from a csproj directly.
You have 2 possible solutions for this.
A) Deploy the xproj as a NuGet package and use the NuGet package in your csproj.
B) Convert your csproj to a xproj.
Note: the xproj must support your used .NET csproj. net451 etc.
Here's an example of a csproj referencing a xproj NuGet package
https://github.com/damienbod/ElasticsearchCRUD/tree/master/samples/ConsoleElasticsearchCrudExample
XProj is dead. Use a portable class library (csproj) and then set it to .NET Standard and the level you want to use for compatibility. Then project.json will be created (which will likely be renamed later) and csproj will still be there thus making adding the reference easy and it just works.
If you need cross compatibility the only way to do so is to do the above, and then add an existing project in the case of the .NET core solution and choose the project.json file instead of the .csproj. This will create the xproj as well. However note that the xproj/project.json will support multi-targeting but the .csproj will not and you'll break the UI for project properties if you try. (it still works but the UI is dead)
Your only other alternative is to bind to the dll not the project. You can use an xproj, put in the targets and then Add references and choose the dll with browse.
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