Using System.Security;
System.Security.Cryptography.Xml.SignedXml signedXml = new System.Security.Cryptography.Xml.SignedXml(lic);
First Unity/VS complained that
So I added a reference to System.Security in Visual Studio (C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Security.dll)…but Unity keeps complaining that
I then tried to directly copy the ‘System.Security.dll’ inside the asset folder (thus removing it from VS references) but there I get a:
What am I doing wrong please? How should I proceed?
Thanks a lot!
Each time I quit and launch VisualStudio I can see that the reference to ‘System.Security.dll’ is lost
Why is it so?
Removing ‘System.Security.dll’ from the asset folder doesn’t give me the ‘missing assembly’ error that I had from the beginning
Does it mean that I don’t need to include it anymore?
What’s the meaning of this ‘mcs.rsp’ and what does ‘-r’ stand for?
In summary, all seems now to work with NO reference to the dll in VisualStudio and NO copy of the dll in the asset folder!
Would you please help me understand what’s happening here?
Thanks again!!
PS:
How can I fix VisualStudio from removing reference to the dll and then complaining that ‘The type or namespace name Xml' does not exist in the namespace System.Security.Cryptography’. Are you missing an assembly reference?’
Do I have to worry about this or not?
Unity doesn’t look at what you change in VS project. It generates them every time you open unity or add or remove a script.
You definitely don’t need to include System.Security.dll into your project. Unity has its own copy in <EDITOR_INSTALL_DIR>\Data\Mono\lib\mono\2.0. It is not used by default, but “mcs.rsp” file contains a list of extra arguments that should be passed to the compiler. And that’s what it contains: it tells it to reference System.Security.dll.
I also get the same using NET 4.6. Tried switching to newer version to work around SSL issues with SNI certificates but I can’t get past the NotFoundException.
I’ve added toe rsp file but it doesn’t work, building for iOS and Android
I was just making repro case and found out that enabling performance reporting service causes this error. After disabling performance reporting, problem goes away. I filed bug report anyways though.
I am trying to use the System.Security.Cryptography.ProtectedData class but have been running into many issues.
Firstly, the ProtectedData class is not even located in the default System.Security.Cryptography namescape supplied by unity. So, I go to the Nuget package manager to download the System.Security.Cryptography.ProtectedData dll. After importing that, and placing it in my plugins folder, I still have an error, albeit a different one.
This error states: “The type name ‘ProtectedData’ could not be found in the namespace ‘System.Security.Cryptography’. This type has been forwarded to assembly ‘System.Security, Version=4.0.0.0, Culture=neutral, PubliCKeyToken=b03f5f7f11d50a3a’ Consider adding a reference to that assembly.”
So, I then delete the ProtectedData dll that I placed in the plugins folder, and place the System.Security dll in the plugins folder. After doing that, I get an error stating that it failed to load the assembly System.Security.dll.
I have tried adding the text file with text “-r:System.Security.dll” but that does not fix any of these issues either.
I am using 2017.3.1f1 right now, and would like to stay with this version if it is possible to fix this issue. Is there some fix for this version, or would I have to upgrade to the latest version? Is there even a fix for this in Unity 2018 as of yet?