-
Notifications
You must be signed in to change notification settings - Fork 139
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
Api Compatibility Level .Net 4.x problem #72
Comments
There is a compatibility issue in UnityNuGet packages with .NET 4.x profile. Some users found the same issue in the LASP package. You can solve the issue with manually importing the There is another hacky way to work around the issue: Navigate to Player Settings -> Other Settings, then edit Script Define Symbols to add Although this could cause another issue in another package, you can successfully avoid the problem if you're lucky enough. |
Thanks for the help. I removed "org.nuget.system.buffers": { and "org.nuget.system.memory": "4.5.4" "jp.keijiro.klak.ndi": { in packages-lock.json. Then manually imported the two Packages Something i do wrong here. |
my packages-lock.json looks like this { |
an my manifest { |
after a restart i always get the original packages-lock.json. I am sure did not completly understand your adwise "You can solve the issue with manually importing the System.Buffer and System.Memory packages, and removing the dependency from package.json." |
Could you try the second workaround?
|
Hey there, |
@ToxMox Did you try the |
@keijiro yup. It won't work even with setting the compatibility level to 2.x You mentioned: "You can solve the issue with manually importing the System.Buffer and System.Memory packages, and removing the dependency from package.json." I would love to try this but would it be possible to get more specific instructions of what this exactly means please? Thank you for your time! 👍 |
That's weird. This issue only happens with the .NET 4.x profile. Is your issue actually the same as in the first post? #72 (comment) |
@keijiro Apologies. I guess it isn't really the same exact error but somewhat adjacent. This is on a fresh 2020.1.0f install > Create new 3D project. > |
Just wondering. Is this something I can work around or will I need to wait for an update to fix? Or maybe I did something wrong? Should I start a separate issue since this one isn't actually the same as OP? Thanks! |
Hi! I have the same issue as well, but on Span<> in Find.cs. |
Edit: feels like a different issue, so will be opening a new one. May be related or the same issue: Unity: 2020.2.0a19 |
I believe I found a hacky workaround. Feels like doing something heavily wrong but as the saying goes; if it works and it's stupid, it ain't stupid :) Unity 2020.1.1f1, HDRP 9.00 (if that matters) Workaround:
After this, our project started to work as expected. But beware, I would consider this highly experimental. |
Hey, I've tried to get the package running on two machines (PC and Mac) on a fresh Unity 2019.4.13f1. Both run into the same two problems: First I get an error about package resolving, then the issue about Span<> missing. I haven't been able to resolve the issue - NET_STANDARD_2_0 define does not fix the issue, and configuring the packages manually hasn't helped yet so far. I'd really need to test this, any help would be greatly appreciated! |
@Sampoman It seems that the UnityNuGet registry has a problem. I reported it to the author. xoofx/UnityNuGet#17 |
@Sampoman The problem was fixed on the UnityNuGet registry side. Clear the Package Manager cache directory and retry opening the project. |
Running into this as well with the latest, what is the recommended solution? I've tried deleting the Package Manager cache to no avail. Unity2019.4.14f1 |
@v2k I'd recommend defining |
Actually, it looks like it was conflicting with Unity's Collection and Jobs preview packages. Removing those resolved it. namely:
|
Hi @keijiro, have you talked to xoofx regarding those compatibility issues, any plans to resolve this? |
@hybridherbst No. My understanding is that it can be resolved by defining |
I find that both very hacky and very dangerous. Setting compile directives for stuff that isn't actually active certainly sounds like a catastrophic failure to happen... @xoofx maybe you have some input on this? |
OK. The proble still exists. This is how you can reproduce it:
You get an error: NET_STANDARD_2_0 workaround is not working.. Can you please tell me if this will be resolved? |
So I don't understand the problem of this thread clearly, but UnityNuGet doesn't support (and will never) .NET 4.x, so I would advice to not try to workaround that. If you app is still on .NET 4.x migrate it. .NET 4.x is a dead end. |
@xoofx Thanks for the explanation. So, the conclusion is that the current implementation of KlakNDI doesn't support .NET 4.x. To solve the problem, I have to rewrite several parts of the implementation. I'm not motivated to do so, though. @hybridherbst Out of curiosity, is there any reason to use .NET 4.x? Is it possible to migrate to .NET Standard 2.0? |
@keijiro switching from .NET 4 to .NET Standard 2.0 removes a ton of available libraries. While some of those gone are available on Nuget, adding those often results in dependency clashes to older versions of those that are directly shipping with the Unity Editor, usually unresolvable (at least for us, not sure if there's rcp magic to resolve). Especially for experiential projects that interface with unusual (and/or older) hardware and software we found switching to be not viable; that being said, for new projects we already try to but sometimes (rarely) run into the same issues. |
@hybridherbst Thanks for the input. Although there is no plan for fixing this issue, now I can understand what the actual problem is. |
Note: This is a known issue of KlakNDI, and there is no plan for fixing it at the moment. I'd like to keep this issue open for future reference. |
Note: The situation will change in Unity 2021.2 because it gets |
I confirmed that this issue was resolved in Unity 2021.2b14. Now you can use the package with both the .NET Standard and .NET Framework profiles. Although the HDRP issue (wrong dependency to System.Memory from the Searcher package) still exists, it will be solved on the HDRP side. So I close this issue now. Please feel free to reopen it if it reproduces on 2021.2b14 or later versions. |
tested in
Unity 2019.4.2fa
and
Unity2019.4.3f1
To reproduce switch your Project with the TestCard scene to Api Compatibility Level .Net 4.x
switching to Api Compatibility Level .Net 4.x
is resulting in following error
Error: Could not load signature of Klak.Ndi.Interop.Find:get_CurrentSources due to: Could not load file or assembly 'System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. assembly:System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51 type: member:(null) signature:
a build results in
Packages\jp.keijiro.klak.ndi\Runtime\Interop\Find.cs(26,19): error CS0246: The type or namespace name 'Span<>' could not be found (are you missing a using directive or an assembly reference?)
Would it be possible to make it compatibel with .Net 4.x ?
NDI is the only method i found (Spout and DesktopDuplication is currently only DX11) i can stream to DX12 scenes with Raytracing enabled.
Thanks.
The text was updated successfully, but these errors were encountered: