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

Library with reference assembly fails on /t:pack with netcore sdk 3 #191

Open
bgavrilMS opened this issue Oct 10, 2019 · 6 comments
Open

Comments

@bgavrilMS
Copy link

MSAL, which uses the sdk extras, including reference assemblies, is built using VS 2019 Azure DevOps hosted image, which now contains .net core sdk 3.

This leads to the following error while performing msbuild /t:pack:

##[error]C:\Program Files\dotnet\sdk\3.0.100\Sdks\NuGet.Build.Tasks.Pack\buildCrossTargeting\NuGet.Build.Tasks.Pack.targets(198,5): Error NU5131: References were found in the nuspec, but some reference assemblies were not found in both the nuspec and ref folder. Add the following reference assemblies:

  • Add Microsoft.Identity.Client.dll to the monoandroid90 reference group in the nuspec
  • Add Microsoft.Identity.Client.xml to the monoandroid90 reference group in the nuspec
  • Add Microsoft.Identity.Client.dll to the net45 reference group in the nuspec
  • Add Microsoft.Identity.Client.xml to the net45 reference group in the nuspec
  • Add Microsoft.Identity.Client.dll to the netcoreapp2.1 reference group in the nuspec
  • Add Microsoft.Identity.Client.xml to the netcoreapp2.1 reference group in the nuspec
  • Add Microsoft.Identity.Client.dll to the netstandard1.3 reference group in the nuspec
  • Add Microsoft.Identity.Client.xml to the netstandard1.3 reference group in the nuspec
  • Add Microsoft.Identity.Client.dll to the uap10.0 reference group in the nuspec
  • Add Microsoft.Identity.Client.xml to the uap10.0 reference group in the nuspec
  • Add Microsoft.Identity.Client.dll to the xamarinios10 reference group in the nuspec
  • Add Microsoft.Identity.Client.xml to the xamarinios10 reference group in the nuspec
  • Add Microsoft.Identity.Client.dll to the xamarinmac20 reference group in the nuspec
  • Add Microsoft.Identity.Client.xml to the xamarinmac20 reference group in the nuspec

I have no idea where to add this, since /t:pack generates a nuspec. Does msbuild.sdk.extras intervene in the creation of the nuspec ?

@bgavrilMS
Copy link
Author

bgavrilMS commented Oct 16, 2019

Please let me know if more info is needed on this.

Repro steps would be:

  1. clone https://github.com/AzureAD/microsoft-authentication-library-for-dotnet
  2. cd src\client\Microsoft.Identity.Client
  3. msbuild /t:pack

@clairernovotny
Copy link
Collaborator

I haven't had much time to look but it appears the targetframeworks list is the same for the ref and the libs. Why use the ref at that point? Put another way, what are you actively using the ref for?

@bgavrilMS
Copy link
Author

We're using the bait and switch technique to model the public API in netstandard versus other tfms. There are quite a few places where we do this, and it has worked quite well so far - developers find the API intuitive and we've not seen any MethodMissingException reported.

The issue described only occurs with .net core 3, if I modify the global.json to use a 2.x .net core SDK, this does not occur.

@clairernovotny
Copy link
Collaborator

Not sure what's going on with the PackTask, but you can work around this by disabling the warning that's being turned into an error by adding NU5131 to the NoWarn list.

@bgavrilMS
Copy link
Author

Thanks @onovotny , I'll give that a go and report back.

@DRAirey1
Copy link

DRAirey1 commented Jan 3, 2020

I'm running into the same issue. Either fix it, or give me some idea how to fix the nuspec so I can get rid the warning, please.
ThetaRex.Forms.zip

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

No branches or pull requests

3 participants