2

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.

1
  • You can use NuGet without an external connection. MyLibrary could build a package, then MyConsoleApp could use a NuGet.config file to add a folder on the build system as a NuGet package source - i.e. pull the NuGet package directly from /build/packages/MyLibrary/out/. Commented Nov 14, 2017 at 22:28

1 Answer 1

3

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</HintPath> </Reference> </ItemGroup> 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.