wtertinek / Linq2Acad

A library that aims to simplify AutoCAD .NET plugin code
MIT License
61 stars 34 forks source link

Exclude Autocad .NET package from the target #40

Closed sanzoghenzo closed 5 months ago

sanzoghenzo commented 8 months ago

Hi there! After a year, here I come back at you with another issue 😉

Expected Behavior

Building my project that uses Linq2Acad should not copy over the autocad libraries

Current Behavior

Compiling my code puts the Autocad libraries into my target directory:

Context

This applies to all the versions, but here's mine:

I had the same problem for on of my project that uses the Autocad.NET package directly, and I had to add the following to the PackagereRerence:

<ExcludeAssets>runtime</ExcludeAssets>
<PrivateAssets>all</PrivateAssets>

The key is the ExcludeAssets, the PrivateAsset shouldn't matter.

Steps to Reproduce

  1. create a new Visual Studio c# library project
  2. add Linq2Acad from nuget
  3. build the solution
  4. the autocad dlls are in the output folder

Checklist

wtertinek commented 8 months ago

Hi sanzoghenzo, nice to hear from you again. :) Thanks for raising this issue, I'll take care of it.

wtertinek commented 5 months ago

I'm trying to solve this one too before creating a new release, but for whatever reason it won't work. No matter which combination of ExcludeAssets and PrivateAssets I use, I still get the AutoCAD assemblies in the output directory. Any ideas?

wtertinek commented 5 months ago

When I compile the Linq2Acad project alone, the references are not copied (as expected). When I create a Nuget package and add it to a test project, the AutoCAD assemblies suddenly are back again. I guess I have to add something in the nuspec files.

wtertinek commented 5 months ago

OK, found it. The exclude="runtime" has to be added to the nuspec as well.

I created RC-packages for all versions. Would be great if you give it a try and verify if the two issues you raised are fixed. Thx!

sanzoghenzo commented 5 months ago

It works! thanks a lot for taking a look at this.