Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include NetFabric.CodeAnalysis #76

Merged

Conversation

robinvanpoppel
Copy link
Contributor

@robinvanpoppel robinvanpoppel commented Sep 28, 2023

Hi,

I want to mention that I do not have any experience with nuget packages that have dependencies. I quickly tried to fix the issue myself.

The dependency on NetFabric.CodeAnalysis is lost due the use of SuppressDependenciesWhenPacking. When setting that to true the dependency will appear in the .nupkg. There is a separate project for the file creating the package, but that package id is the same as the project where the analyzers are living in. The $(MSBuildProjectFile)* was throwing an error, so I changed that to Dummy. Because there are two projects however the Package will also consider the referenced project as a dependency of the nuget package which is not ok. I did briefly explore the possibility to merge the contents of the .Package. together with the actual analyzers project but this would be a huge refactor.

Instead I came up with this workaround:

  • CopyLocalLockFileAssemblies will copy a number of assemblies to the bin directory of the package. It seems a bit ugly, but that seems to work.
  • Include NetFabric.CodeAnalysis in the package (via TfmSpecificPackageFile)
  • Rectify the build error on PackageId containing invalid characters (*$(MSBuildProjectFile)*)

This should hopefully fix #73

@aalmada
Copy link
Member

aalmada commented Oct 11, 2023

@robinvanpoppel Thanks you so much for this PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error AD0001: Could not load file or assembly 'NetFabric.CodeAnalysis, Version=4.1.0.0'
2 participants