简体   繁体   中英

.NET Core - How to include package without nuget

I'm new to developing with .NET and .NET Core and until now I just used Nuget when I needed a package.

But now I want to include MapBoxNet into my project ( https://github.com/AliFlux/MapboxNet ) which doesn't have a Nuget package. As you can see, the Github repository just consists of a Visual Studio Solution. When opened I'm greeted with error messages and to be honest I really don't know what to do from here on.

Am I supposed to compile it myself, convert it to nuget package myself or is there a way to just include the MaBoxNetWPF folder into my own project?

for dev purposes, yes, you can tag the project to create a nuget package on build and use it locally. But if you intend to use some sort of CI/CD pipeline the nuget package needs to be located on some nuget server which is reachable by the build server.

You include it in your MyProjectName.csproj file like so:

<Project Sdk="Microsoft.NET.Sdk.Web or whatever appropriate for your project">

  Other stuff...

  <ItemGroup>
    Other packages...
    <PackageReference Include="Mapbox.Sdk.Core" Version="4.3.0" />
  </ItemGroup>

  Perhaps even more stuff...

</Project>

Then you either restore (or run which does restore implicitly) your project.

EDIT:
I may have misread your question. If what you wish is to reference some other project projB in your project projA and projB does not have any Nuget packages available, you could pull it and either:
a) build Nuget package yourself and reference it locally
b) reference projB directly:

<ItemGroup>
    <ProjectReference Include="../modules/projB/projB.csproj" />
</ItemGroup>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM