sdk icon indicating copy to clipboard operation
sdk copied to clipboard

Adding a dependency to .Netcore 2.0

Open Rvhappen opened this issue 9 years ago • 1 comments

Steps to reproduce

  1. dotnet new (dotnet 2.0)
  2. make your own nuget package like in this URL: http://stackoverflow.com/questions/39604462/using-net-core-cli-add-a-reference-to-a-local-dll-when-targeting-the-full-fram
  3. add it to a 'project.json' file

Expected behavior

My own dependencies (Sifteo.dll and JsonFx.dll) are added to the dependencies.

Actual behavior

Everytime I try to add a dependency to the project.assets.json file it is being removed, probably because this isn't the right place to put it. Also I have no clue where to actually add it. Under the netcoreapps2.0{ dependencies} or not. So in the URL I added, the step to add it under the project.json file, is impossible it seems. Before .Netcore 2.0 I just had a normal project.json file. Where is it or what is the 'right' workaround?

Environment data

dotnet --info output: image

Rvhappen avatar Feb 27 '17 08:02 Rvhappen

I didn't know I had to edit the new csproj file. I don't know why I didn't find that out earlier. To add a reference I modified the xx.csproj file and added the following keys (Sifteo.dll is my reference in this case):

<ItemGroup>
	<Reference Include="Sifteo, Version=0.1.4266.33212, Culture=neutral, PublicKeyToken=0e958af9dbfb2cb7">
			<SpecificVersion>True</SpecificVersion>
			<HintPath>..\xxxx\Sifteo.dll</HintPath>
	</Reference>
</ItemGroup>

Rvhappen avatar Feb 27 '17 10:02 Rvhappen