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

NSwag.AspNetCore has an upper version limit for Microsoft.Extensions.FileProviders.Embedded #4638

Closed
paulomorgado opened this issue Dec 11, 2023 · 10 comments · Fixed by #4642

Comments

@paulomorgado
Copy link
Contributor

NSwag.AspNetCore has an upper version limit for Microsoft.Extensions.FileProviders.Embedded.

Is there a reason for that?

As it is, NSwag.AspNetCore is causing a NU1608 on projects targeting .NET 8.0.

@RicoSuter
Copy link
Owner

Not sure, can you create a PR to fix it?

@paulomorgado
Copy link
Contributor Author

The use of a NuSpec file is intended or legacy?

Can we move that to using dotnet pack/msbuild -t:pack?

@lahma
Copy link
Collaborator

lahma commented Dec 12, 2023

I think using csproj to guide pack is always better, as long as the output is identical.

@El-Gor-do
Copy link

NSwag.AspNetCore also depends on NSwag.Generation.AspNetCore which has upper limits on Microsoft.Extensions.DependencyInjection.Abstractions and Microsoft.Extensions.Options. Can these upper limits also be removed?

@paulomorgado
Copy link
Contributor Author

Just created #4642 to remove the upper limits.

The usage of NuGet MSBuild targets to produce the packages will be addressed in a later PR.

@dougclutter
Copy link

Trying to upgrade our .NET 7 site to .NET 8 and we're running into this limit too. Is there any way to work around this until a fix is released?

@paulomorgado
Copy link
Contributor Author

Can you try adding a NoWarn to the PackageReference?

 <PackageReference Include="NSwag.AspNetCore" Version="13.20.0">
   <NoWarn>NU1608</NoWarn>
 </PackageReference>

@dougclutter
Copy link

@paulomorgado - Thanks for sharing that snippet but it didn't work for me.

Here's what I ended up with:

	<PropertyGroup>
		<NoWarn>1701;1702;CA2007</NoWarn>
	</PropertyGroup>

	<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
		<DefineConstants>DEBUG;TRACE</DefineConstants>
	</PropertyGroup>

	<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
		<NoWarn>$(NoWarn);NU1608</NoWarn>
		<GenerateDocumentationFile>true</GenerateDocumentationFile>
		<TreatWarningsAsErrors>true</TreatWarningsAsErrors>		
	</PropertyGroup>

Just posting it here in case it helps someone else.

@arakis
Copy link

arakis commented Dec 26, 2023

I get NU1107, and i'm unable to supress it via NoWarn:

MyProject.csproj : error NU1107: Version conflict detected for Microsoft.Extensions.FileProviders.Embedded. Install/reference Microsoft.Extensions.FileProviders.Embedded 8.0.0 directly to project MyProject to resolve this issue. 
MyProject.csproj : error NU1107:  MyProject -> AnotherProject1 -> AnotherProject2 -> AnotherProject3 -> Microsoft.Extensions.FileProviders.Embedded (>= 8.0.0) 
MyProject.csproj : error NU1107:  MyProject -> NSwag.AspNetCore 13.20.0 -> Microsoft.Extensions.FileProviders.Embedded (>= 7.0.0 && < 8.0.0).

Can sombody please make a pre-prerelease? The latest nuget pre-release is 14.0.0-preview12, but latest git tag is 14.0.0-preview14.

@paulomorgado
Copy link
Contributor Author

Yeah! Some NuGet warnings are hard or impossible to suppress.

Maybe you can find some help at https://github.com/NuGet/Home/discussions.

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 a pull request may close this issue.

6 participants