P
P
patch12015-09-08 22:12:58
Programming
patch1, 2015-09-08 22:12:58

How to work with the registry in Unity3d?

Good evening. Actually the problem when working with the registry in Unity3d

System.NotImplementedException: The requested feature is not implemented.
at Microsoft.Win32.RegistryKey.OpenSubKey (System.String name, RegistryKeyPermissionCheck permissionCheck) [0x00000] in /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/Microsoft.Win32/RegistryKey.cs:452 
at (wrapper remoting-invoke-with-check) Microsoft.Win32.RegistryKey:OpenSubKey (string,Microsoft.Win32.RegistryKeyPermissionCheck)
at RegZ.RegFind (Microsoft.Win32.RegistryKey key, System.String find) [0x000b9] in E:\Работа\Autorun\Unity Autorun\Unity Autorun\Assets\Scripts\RegZ.cs:40

Actually indicates that supposedly there is no OpenSubKey method. Although in .Net 2.0 it exists.
The namespace is connected using Microsoft.Win32; It does not give errors until the moment when the OpenSubKey methods are called. And then I caught the error through a try catch exception)) in fact, for Unity this is not an error and compiles under Windows calmly. Windows 7 sp1. What could be the problem?)
ps In .net 2.0 this method is supported, I checked it when writing code in Visual studio under Net framework 2.0.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
C
Curly Brace, 2015-09-08
@stasuss

Well, it's a cross-platform, why the registry? It is only available in Windows.
There are PlayerPrefs.

G
GavriKos, 2015-09-08
@GavriKos

You need to look at the documentation not for .Net, but for Mono. Mono is not completely analogous to dotnet.

D
Daniil Basmanov, 2015-09-09
@BasmanovDaniil

According to this page , Microsoft.Win32 was supported in at least the fourth branch. If my memory serves me, something was cut out in the fifth version, maybe the registry got under a hot hand. It may also be that in your project settings api compatibility level is set to .NET 2.0 Subset, check. In general, if you wish, you can always put the Microsoft dlls in the Plugins folder and work with them, this is how I drew Windows forms.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question