-
Notifications
You must be signed in to change notification settings - Fork 119
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
The type or namespace name 'Span<>' could not be found #28
Comments
I did more testing today. In the empty project where LASP initially imported successfully, I managed to get rid of the errors by reimporting the project. However, I realized that the error is caused by a third party plugin called Quantum Console. As soon as I imported it the exact error appeared again and I couldn't do anything to make it disappear. |
Seeing the same issue on 2019.3.10f1 with the ReadOnlySpan in ChannelLayout and the Spans in Device. |
@Ryne9 Are you using Quantum Console too? |
Nope, two biggest libraries I'm using are UniVRM and TwitchLib, I can test adding them to a new project tomorrow and seeing what happens. |
@Ryne9 Thanks for the additional info. I'd appreciate if you could check which one causes the error. |
@MateiGiurgiu Thank you very much for further testing. It seems that there is something wrong with the API compatibility setting. Actually, I only tested LASP with the .NET Standard 2.0. I'll do extensive tests with .NET 4.x for the next version of LASP. Just out of curiosity, do you need .NET 4.x for your project? I have never used .NET 4.x on my projects, so I overlooked the point. |
Personally I've never needed to change API compatibility until I wanted a Twitch library so I used TwitchLib.Unity which required it. After this issue I did think of rewriting/investigating since Lasp is way more important for my project at the moment |
Twitch requires .NET 4.x. Okay. That's a valuable input. Thanks. |
My thoughts are on the same lines as @Ryne9. I don't need .NET 4.x in the project at the moment. When I got LASP, the only reason I wanted to see if it works properly on both compatibility levels was that the project is in early development and I might need some plugins in the future which may require 4.x and I didn't want to have problems at that point. Long story short I am developing an audio visualizer app and at the moment I implemented a custom system to process the audio signal (taken using NAudio) using FFT in order to generate the spectrum. Then I discovered LASP which seems way more attractive due to low-latency and normalization features among others. Therefore, I prefer to stick with .NET Standard 2.0 if LASP will become a core component of the project. Is LASP using the libsoundio wrapper that you wrote? And, if yes, does that mean that LASP only supports 64bit systems? |
Yes, it only supports x64 at the moment. |
@keijiro I just found a limitation of .NET Standard 2.0. I was trying to make a windows native file browser dialog and I require System.Windows.Forms.dll. I made a file csc.rsp and added: "-r:System.Windows.Forms.dll". However, this works only with .NET 4.x. |
Unsafe should work as long as your project settings (or asmdef) "allow for unsafe code" which is unchecked in your case |
Got this error and fixed it by setting the API compatibility level to .NET Standard 2.0 as mentioned above: Though I am not quite clear on the difference between the two options. From what I've read, setting the compatibility level to .NET 4.x should not remove support for any feature, only increasing the available API surface. Maybe Anyway it could be useful to add this info to the readme 🙂 |
+1 this issue, Net 4.x is now often required by various other tools. |
No. Those documents are written in the .NET 3.5 era so has been outdated. Now, NET Standard 2.0 is the recommended option in general cases.
Actually, that's a new feature in .NET Standard 2.1. We can use it on .NET Standard 2.0 by adding the nuget package. |
Could you give me an example? I'm curious about the reasons why .NET 4.x is still used in some cases.
This error message is not related to LASP. Please try removing other unrelated packages. |
@marcospgp Sorry. The first paragraph in the last reply might be not correct. I should admit that I'm not a .NET specialist. Please ask a specialist for further details. |
Note that there is the same issue in KlakNDI. The conclusion here is the same to KlakNDI. There is no plan for fixing it, but this issue should be kept opened for future reference. |
@keijiro A json data storing tool I am using requires .NET framework which is only supported in 4.x . And I am unsure what exactly you mean since in the error it states that a namespace is missing from LASP - and the script that is asking for it is from Klak Audio. (Which is the reason I am trying to install LASP in the first place). |
@Nolram12345 If you're using KlakLasp, it's not compatible with the current version of LASP. |
@keijiro Then what version do I need ? Is it even still supported/does it still work ? |
Lasp v1 is still in the master branch. https://github.com/keijiro/Lasp/tree/master I haven't been touched it for some years, so I'm not sure if it still works. Please use the issue tracker on the KlakLasp repository for further questions. It's not relevant to the original question in this thread. |
@keijiro Sure. Thank you. |
Unfortunately I'm also in the same boat. I'm getting this Span<> error on import and I'm trying some stuff out with Arduino depth sensors (or Kinect as a backup) but it seems that both require .Net 4.x. I'm really keen to try Lasp out though... |
I think the issue is with the NuGet package dependencies (e.g. The 'correct' solution is either to target .NET Standard 2.0, or (probably) manually include the correct .NET 4.x Here's an 'incorrect' solution though: you might be able to get away with adding |
@hnguyen094 Thanks for the write-up. That matches with my understanding. |
Had the same issue with both 2.0 and 4x for some reason. Not sure if it makes much difference as Unity apparently doesn't use .NET 2.1 yet however I downloaded and installed .NET core 2.1 The solution for me was to directly download the dll for Span.
After I did that I had error finding reference to Unsafe so did the same with the Unsafe package. Answer taken from and changed slightly by me, hope this helps someone :) |
adding the following lines to the manifest.json fixed this issue for me in klakNDI.
and then inside the '"dependencies": {' bracket: hope this helps. |
I ran into this on version 2020.3.14f1 even when using .NET Standard 2.0. Switched to 2019.4.0f1 instead and I'm able to use the library with no errors. |
Add these to manifest file "scopedRegistries": [ |
the 'incorrect' solution worked for me after I switched to IL2CPP backend on 2019.4.6. Hope this helps! |
I get this error when I import the package. I mention that I am using the package manager for this as described in the readme. The weird thing is that a couple a days ago I managed to import this into an empty project and it worked. I tried deleting the cache, switching the scripting backend. Importing System.Memory from NuGet but nothing seems to be able to fix it.
Do you have any idea what might be the cause?
Using Unity 2019.3.15f1 and Visual Studio 2019
The text was updated successfully, but these errors were encountered: