C
C#3y ago
Xan.Nava

❔ Target runtime doesn't support default interface implementation.

As the title says. My csproj file https://pastebin.com/wFbwGJDn I am trying to use this in unity which supports this feature on 2022.2b. The documentation for unity says it is using the fallowing. https://docs.unity3d.com/2022.2/Documentation/Manual/dotnetProfileSupport.html .NET Framework (any version) Supported
Pastebin
other - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
14 Replies
Anchy
Anchy3y ago
You have passworded the paste
Xan.Nava
Xan.NavaOP3y ago
Fixed
Anchy
Anchy3y ago
I think that version uses C# 7.3 and default interface implementations were in C# 8.0? I see you have the language version as 9.0 but I'm sure not sure if it's supported what are you trying to do exactly? oh I see you have Unity 2022 so it should be supported googling it, it looks like default interface methods are not supported with Unity
Xan.Nava
Xan.NavaOP3y ago
A good detail. It is a class library that I am going to be using with Unity, I just checked in unity I can do it, but the external class library I can't. I am figuring that it isn't using C# 9.0 in the class library, but the only place I can set it is in the csproj file(as in the settings it just says automatically detected based on framework). Do you know how to use C# 9.0 with .framework 4.8/4.8.1
Anchy
Anchy3y ago
I think I saw a post saying you can't use it in class libraries ah the dotnet issue says it is available in c# 9.0
333fred
333fred3y ago
There's a very good reason we don't officially support using new language versions with old frameworks: it doesn't all work Even if you set your language version to C# 9, you will not be able to use DIMs on .NET Framework, period You will get that same error
Xan.Nava
Xan.NavaOP3y ago
Then how is Unity allowing it? Actually I know the answer, Unity is pretty hacked together already.
333fred
333fred3y ago
I don't know that they are
333fred
333fred3y ago
Xan.Nava
Xan.NavaOP3y ago
You were to quick, linked the wronge page XD They are using .netframework 4.8 with rosylin and C# 9.0
333fred
333fred3y ago
They are not using framework If they're supporting dims, they're not using framework Framework does not and never will support dims
Xan.Nava
Xan.NavaOP3y ago
Ah they have .net framework api support, but it is running dims? https://docs.unity3d.com/2022.2/Documentation/Manual/dotnetProfileSupport.html I unfortunately had to move my external library into the unity project to continue with my integration. If/when they actually move to .net 6.0 and make their engine freindly to actual .net developers I will start to use good practices again... Ah mono supports framework, but it seems to be a mass of features.
Accord
Accord3y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server