❔ 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
You have passworded the paste
Fixed
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
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
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
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
Then how is Unity allowing it? Actually I know the answer, Unity is pretty hacked together already.
I don't know that they are
It is allowed in unity.
https://issuetracker.unity3d.com/issues/default-interface-implementation-error
https://docs.unity3d.com/2022.2/Documentation/Manual/CSharpCompiler.html
updated link
You were to quick, linked the wronge page XD
They are using .netframework 4.8 with rosylin and C# 9.0
They are not using framework
If they're supporting dims, they're not using framework
Framework does not and never will support dims
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.
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.