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

[.NET 8.0] Conflict #280

Closed
cocoon opened this issue Jul 23, 2023 · 7 comments
Closed

[.NET 8.0] Conflict #280

cocoon opened this issue Jul 23, 2023 · 7 comments

Comments

@cocoon
Copy link

cocoon commented Jul 23, 2023

Hi there,

I just discovered a conflict with the current .NET 8.0 preview 6.

Recently IPNetwork was added to System.Net here:
dotnet/runtime#82779

Error

Program.cs(3,10): error CS0433: The type 'IPNetwork' exists in both 'System.Net.IPNetwork, Version=2.6.598.0, Culture=neutral, PublicKeyToken=717343cc2c25edcf' and 'System.Net.Primitives, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' [...\test.csproj]

The build failed. Fix the build errors and run again.
Program.cs(3,10): error CS0433: Der Typ "IPNetwork" ist in "System.Net.IPNetwork, Version=2.6.598.0, Culture=neutral, PublicKeyToken=717343cc2c25edcf" und "System.Net.Primitives, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" vorhanden. [...\test.csproj]

Steps to reproduce

  • Install .NET 8.0 Prev 6 SDK (x64): [Download]
  • Start a terminal:
mkdir test
cd test
dotnet new console
dotnet add package IPNetwork2
echo var ip = System.Net.IPNetwork.Parse(""); >> Program.cs
rem VERIFY that TargetFramework is net8.0
more test.csproj
dotnet run

Story

Because of another existing problem (that has nothing to do with IPNetwork), to be able to start processes without windows, I needed to switch to .NET 8 and triggered the conflict.

My current workaround is to rename this IPNetwork class to IPNetwork2.

just for completeness, the other unrelated problem:

dotnet/runtime#68259

UseShellExecute = false

  • StartInfo.CreateNoWindow = false
  • StartInfo.WindowStyle = ProcessWindowStyle.Hidden
  • redirect output

the fix:
microsoft/playwright-dotnet#2623

@jeffpatton1971
Copy link

I noticed this as well, it's not a deal breaker for me since I'm not doing anything in .net8 (still preview yes?) but it did look like perhaps several of the namespaces/types are there.

@Ponderfly
Copy link

	<PackageReference Include="IPNetwork2" Version="2.6.609" >
		<Aliases>IPNetwork2</Aliases>
	</PackageReference>

extern alias IPNetwork2;

IPNetwork2.System.Net.IPNetwork

@loop-evgeny
Copy link

Just ran into this as well. Why is this library, which is not part of the BCL, adding types to the System namespace? That's just asking for issues like this.

@cocoon
Copy link
Author

cocoon commented Sep 26, 2023

Just ran into this as well. Why is this library, which is not part of the BCL, adding types to the System namespace? That's just asking for issues like this.

Isn't it great, that the source is available and everybody just can change it easily?

nefarius added a commit to nefarius/Nefarius.Utilities.AspNetCore that referenced this issue Nov 17, 2023
Fixed this dumb nonsense lduchosal/ipnetwork#280
nefarius added a commit to nefarius/Nefarius.Utilities.AspNetCore that referenced this issue Nov 17, 2023
Fixed this dumb nonsense lduchosal/ipnetwork#280
@MaxwellDAssistek
Copy link

This needs to be fixed now that .net 8 is GA.

@Goltom
Copy link
Contributor

Goltom commented Jan 16, 2024

The fix is on the way! #298

@lduchosal
Copy link
Owner

PR was approved and nuget published

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

7 participants