Search code examples
c#asp.net.netasp.net-coreprojects-and-solutions

How to Reference .xproj into .csproj?


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...


Solution

  • 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