JetBrains / ExternalAnnotations

JetBrains ReSharper External Annotations
https://www.jetbrains.com/help/resharper/Code_Analysis__External_Annotations.html
MIT License
81 stars 44 forks source link

Package update fails #165

Closed bkoelman closed 5 years ago

bkoelman commented 5 years ago

Tried to update NuGet package from 10.2.29 to 10.2.60, which gives the next error:


Error - NU1602 - JetBrains.ExternalAnnotations 10.2.60 does not provide an inclusive lower bound for dependency Wave (> 0.0.0). An approximate best match of Wave 1.0.0 was resolved.   
derigel23 commented 5 years ago

According to docs it should be warning, not error. Have you set 'Treat warnings as errors' setting?

bkoelman commented 5 years ago

Yes I have. Is this something that can be fixed?

Op wo 3 apr. 2019 13:08 schreef Slava Trenogin notifications@github.com:

According to docs https://docs.microsoft.com/en-us/nuget/reference/errors-and-warnings/nu1602 it should be warning, not error. Have you set 'Treat warnings as errors' setting?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/JetBrains/ExternalAnnotations/issues/165#issuecomment-479443859, or mute the thread https://github.com/notifications/unsubscribe-auth/AJ2JlOvkTcIV-EB9tbyt_gi7xdAIIx3vks5vdIuugaJpZM4cY70c .

derigel23 commented 5 years ago

Try workaround with NoWarn option for NU1602 warning.

bkoelman commented 5 years ago

I can work around this by adding the next line to project file:

    <NoWarn>$(NoWarn);NU1602</NoWarn>

However, I prefer not to burden my users with that. The docs state this is usually a package authoring error. Can you please explain why it is needed in the first place?

bkoelman commented 5 years ago

Turns out I was too optimistic. After applying this change, I get lots of warnings (WarnAsError disabled) about identity mismatches for the System.Runtime assembly.

7>TestableFileSystem.Fakes.Tests -> E:\Bart\Source\Repos\TestableFileSystem\src\Fakes.Tests\bin\Debug\netcoreapp2.0\TestableFileSystem.Fakes.Tests.dll
7>CSC : warning CS1701: Assuming assembly reference 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' used by 'JetBrains.Annotations' matches identity 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' of 'System.Runtime', you may need to supply runtime policy
7>ActionFactory.cs(8,10,8,17): warning CS1701: Assuming assembly reference 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' used by 'JetBrains.Annotations' matches identity 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' of 'System.Runtime', you may need to supply runtime policy
7>ActionFactory.cs(9,52,9,65): warning CS1701: Assuming assembly reference 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' used by 'JetBrains.Annotations' matches identity 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' of 'System.Runtime', you may need to supply runtime policy
7>ActionFactory.cs(9,68,9,77): warning CS1701: Assuming assembly reference 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' used by 'JetBrains.Annotations' matches identity 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' of 'System.Runtime', you may need to supply runtime policy

...

7>Specs\FakeDirectory\DirectoryRootSpecs.cs(290,13,290,24): warning CS1701: Assuming assembly reference 'System.Runtime, Version=4.0.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' used by 'System.Reflection' matches identity 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' of 'System.Runtime', you may need to supply runtime policy
7>Specs\FakeDirectory\DirectoryRootSpecs.cs(290,13,290,24): warning CS1701: Assuming assembly reference 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' used by 'System.Xml.XDocument' matches identity 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' of 'System.Runtime', you may need to supply runtime policy
7>Specs\FakeDirectory\DirectoryRootSpecs.cs(290,13,290,24): warning CS1701: Assuming assembly reference 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' used by 'System.Threading.Tasks' matches identity 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' of 'System.Runtime', you may need to supply runtime policy

To repro, follow these steps:

  1. Clone the repro at https://github.com/bkoelman/TestableFileSystem (branch netstd20); checkout commit 2446d6f7d027686db22fd935e7709f5d22d8c979
  2. In Build.directory.props, change TreatWarningsAsErrors to False and add the next line:
    <NoWarn>$(NoWarn);NU1602</NoWarn>
  3. Use package manager to update JetBrains.ExternalAnnotations to v10.2.60
  4. Build the solution. May require restart of VS and/or git clean for errors to show up.
bkoelman commented 5 years ago

Thanks for addressing this. v10.2.62 is not yet on NuGet. Can you please publish it there too?

derigel23 commented 5 years ago

Done.