0

So, im writing a game Client/Server that shares 1 project.

The server is written using .net CORE, and the client needs the library to be in .net framework, so ive added a "Commons" project that builds in .net framework 3.5

However, for that reason, the server won't natively run on linux.

I was wondering, googled a bit couldn't find an actual way of doing it, but making "Commons" project a .net CORE project, but also make it possible to build his DLL in .net framework to import in the game client.

So the server would use a .net CORE version, and the Client would use a .net framework version of the same library.

Would that be possible somehow ?

Thanks for any attention !

4
  • Please specify the versions of .NET and .NET Core that are in use. The only version number you've provided is that you're currently building the common library against .NET 3.5... it's very likely that you should target .NET Standard instead, but we can't tell for sure without knowing the platform versions that need to consume the library. Commented Nov 13, 2018 at 14:50
  • I can target the .net framework from 2 to 3.5 The .net core version im using netcoreapp2.1 Commented Nov 13, 2018 at 14:52
  • Should I target .net standard in the common library ? Would it work as .net core for the server ? (runs in Linux) Commented Nov 13, 2018 at 14:52
  • Given your comment about Unity, it sounds like you should probably try to update to newer versions of Unity that support more recent versions of .NET. Trying to use .NET Core (very modern) with .NET 3.5 (10 years old) is bound to be painful. (But I would strongly urge you to give all of this information in your question.) Commented Nov 13, 2018 at 15:47

1 Answer 1

1

I don't see why exactly have you chosen .NET Framework 3.5 but the solution is to compile the library against .NET Standard. The question remains how far can you go with this compilation.

.NET Framework 3.5 is not compatible with any version of .NET Standard, the earliest version is 4.5 as published in docs, here: https://learn.microsoft.com/en-us/dotnet/standard/net-standard

Obviously, the further .NET Standard version you chose, the higher .NET version you have to pick on the client side, as standard grows continuously and hence drops support for the older frameworks.

If you could upgrade your client project to .NET 4.5, having the lib in .NET standard 1 would resolve your compatibility issue.

Sign up to request clarification or add additional context in comments.

1 Comment

The client is being written in Unity3D so the maximum version the library I can use is .net framework 3.5 as far as I know. I haven't tested with .net standard I will test it out :D

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.