Home .NET Core build with dll reference
Reply: 1

.NET Core build with dll reference

Androme
1#
Androme Published in 2017-11-14 20:00:56Z

I am trying to get .NET core to work with the build system at my work, which had been designed with Java in mind. But it is sadly so integrated into our pipelines that there is no way we can be without it. So if I want to use .NET at work will it have to be with this build system.

Each project is built into a package, with their own git repository.

Given a program like below where MyConsoleApp has a dependency on MyLibrary.

MyProgram-Solution
 - MyConsoleApp
 - MyLibrary

At build time the source code would be placed in

/build/packages/MyConsoleApp/
/build/packages/MyLibrary/

However I can only build one at the time, and I cannot move the source code. Which means that I would need to build MyLibrary first, with the DLL ending up in

/build/packages/MyLibrary/out/MyLibrary.1.0.dll

When I then build MyConsoleApp, I need a way to tell the .NET Core build tool that the MyLibrary.1.0.dll file can be found at

/build/packages/MyLibrary/out/MyLibrary.1.0.dll

Storing packages in Nuget is not an option, as the package may not be ready for release at the build time, and the build system works in a sandbox mode, meaning it has no external connections.

I can edit the MyConsoleApp.csproj if that makes it possible.

yaakov
2#
yaakov Reply to 2017-11-14 22:27:49Z

You can add assembly references using Visual Studio, same as with .NET Framework projects.

If you want to modify the project file by hand, you'll need something like the following:

<ItemGroup>
  <Reference Include="MyLibrary">
    <HintPath>..\..\..\MyLibrary\out\MyLibrary.1.0.dll>
  </Reference>
</ItemGroup>
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.345518 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO