Unity The type name ‘Registry‘ could not be found in the namespace ‘Microsoft.Win32‘...

版本号

Unity The type name ‘Registry‘ could not be found in the namespace ‘Microsoft.Win32‘..._第1张图片

具体报错内容:

Console Error Pause:
在这里插入图片描述

解决

  1. 点左上角File→Build Settings
    Unity The type name ‘Registry‘ could not be found in the namespace ‘Microsoft.Win32‘..._第2张图片
  2. 点左下角Player Settings
    Unity The type name ‘Registry‘ could not be found in the namespace ‘Microsoft.Win32‘..._第3张图片
  3. 找到other settings下的Configuration→Api Compatibility Level
    Unity The type name ‘Registry‘ could not be found in the namespace ‘Microsoft.Win32‘..._第4张图片
  4. 把它换成 .NET Framework
    solution4
    unity会自动编译,报错就没有了

原因

看到提示Version=4.1.0.0,应该是需要设置unity使用的.Net版本。这里没有其他选项,就换个 .NET Framework试试,就成功了…


参考链接:游戏开发unity杂项系列: CSharpCodeProvider could not be found in the namespace Micrrosoft.CSharp

你可能感兴趣的:(unity)