UnityVS Visual Studio无法打开

30byixjq  于 2023-11-21  发布在  其他
关注(0)|答案(9)|浏览(223)

我使用UnityVS生成Visual Studio项目,但项目文件 *.CSharp.csproj无法打开。
我发现问题是ProjectTypeGuids使用了一个未知的类型:E097 FAD 1 -6243-4DAD-9 C 02-E9 B 9 EFC 3FFC 1,谷歌也不能告诉我那是什么。
有人有同样的问题吗?
项目文件为:

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  3. <PropertyGroup>
  4. <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
  5. <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
  6. <ProductVersion>10.0.20506</ProductVersion>
  7. <SchemaVersion>2.0</SchemaVersion>
  8. <ProjectGuid>{70B74EA9-8515-0DD0-B4E6-E001BFFC1148}</ProjectGuid>
  9. <OutputType>Library</OutputType>
  10. <RootNamespace></RootNamespace>
  11. <AssemblyName>Assembly-CSharp</AssemblyName>
  12. <FileAlignment>512</FileAlignment>
  13. <ProjectTypeGuids>{E097FAD1-6243-4DAD-9C02-E9B9EFC3FFC1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
  14. <TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>
  15. <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
  16. <TargetFrameworkProfile>Unity Subset v3.5</TargetFrameworkProfile>
  17. <CompilerResponseFile></CompilerResponseFile>
  18. </PropertyGroup>
  19. <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
  20. <DebugType>pdbonly</DebugType>
  21. <Optimize>false</Optimize>
  22. <OutputPath>Temp\UnityVS_bin\Debug\</OutputPath>
  23. <ErrorReport>prompt</ErrorReport>
  24. <WarningLevel>4</WarningLevel>
  25. <DefineConstants>DEBUG;TRACE;UNITY_STANDALONE_WIN;ENABLE_MICROPHONE;ENABLE_TEXTUREID_MAP;ENABLE_AUDIO_FMOD;UNITY_STANDALONE;ENABLE_MONO;ENABLE_TERRAIN;ENABLE_SUBSTANCE;ENABLE_GENERICS;ENABLE_MOVIES;ENABLE_WWW;ENABLE_IMAGEEFFECTS;ENABLE_WEBCAM;RENDER_SOFTWARE_CURSOR;ENABLE_NETWORK;ENABLE_PHYSICS;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_SHADOWS;ENABLE_AUDIO;ENABLE_DUCK_TYPING;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;UNITY_4_2_2;UNITY_4_2;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_WIN;UNITY_TEAM_LICENSE</DefineConstants>
  26. </PropertyGroup>
  27. <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
  28. <DebugType>pdbonly</DebugType>
  29. <Optimize>false</Optimize>
  30. <OutputPath>Temp\UnityVS_bin\Release\</OutputPath>
  31. <ErrorReport>prompt</ErrorReport>
  32. <WarningLevel>4</WarningLevel>
  33. <DefineConstants>TRACE;UNITY_STANDALONE_WIN;ENABLE_MICROPHONE;ENABLE_TEXTUREID_MAP;ENABLE_AUDIO_FMOD;UNITY_STANDALONE;ENABLE_MONO;ENABLE_TERRAIN;ENABLE_SUBSTANCE;ENABLE_GENERICS;ENABLE_MOVIES;ENABLE_WWW;ENABLE_IMAGEEFFECTS;ENABLE_WEBCAM;RENDER_SOFTWARE_CURSOR;ENABLE_NETWORK;ENABLE_PHYSICS;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_SHADOWS;ENABLE_AUDIO;ENABLE_DUCK_TYPING;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;UNITY_4_2_2;UNITY_4_2;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_WIN;UNITY_TEAM_LICENSE</DefineConstants>
  34. </PropertyGroup>
  35. <ItemGroup>
  36. <Reference Include="mscorlib" />
  37. <Reference Include="System" />
  38. <Reference Include="System.XML" />
  39. <Reference Include="System.Core" />
  40. <Reference Include="Boo.Lang" />
  41. <Reference Include="UnityScript.Lang" />
  42. <Reference Include="UnityEngine">
  43. <HintPath>Library\UnityAssemblies\UnityEngine.dll</HintPath>
  44. </Reference>
  45. <Reference Include="UnityEditor">
  46. <HintPath>Library\UnityAssemblies\UnityEditor.dll</HintPath>
  47. </Reference>
  48. </ItemGroup>
  49. <ItemGroup>
  50. <Compile Include="Assets\Scripts\scaleform\SFCamera.cs" />
  51. <Compile Include="Assets\Scripts\scaleform\SFCxForm.cs" />
  52. <Compile Include="Assets\Scripts\scaleform\SFDisplayInfo.cs" />
  53. <Compile Include="Assets\Scripts\scaleform\SFDisplayMatrix.cs" />
  54. <Compile Include="Assets\Scripts\scaleform\SFEvents.cs" />
  55. <Compile Include="Assets\Scripts\scaleform\SFGamepad.cs" />
  56. <Compile Include="Assets\Scripts\scaleform\SFInitParams.cs" />
  57. <Compile Include="Assets\Scripts\scaleform\SFKey.cs" />
  58. <Compile Include="Assets\Scripts\scaleform\SFLifecycleEvent.cs" />
  59. <Compile Include="Assets\Scripts\scaleform\SFManager.cs" />
  60. <Compile Include="Assets\Scripts\scaleform\SFManager_Imports.cs" />
  61. <Compile Include="Assets\Scripts\scaleform\SFMovie.cs" />
  62. <Compile Include="Assets\Scripts\scaleform\SFMovie_Imports.cs" />
  63. <Compile Include="Assets\Scripts\scaleform\SFRTT.cs" />
  64. <Compile Include="Assets\Scripts\scaleform\SFSentinal.cs" />
  65. <Compile Include="Assets\Scripts\scaleform\SFValue.cs" />
  66. <Compile Include="Assets\Scripts\scaleform\SFValue_Imports.cs" />
  67. <Compile Include="Assets\Scripts\UI\MyCamera.cs" />
  68. </ItemGroup>
  69. <Import Project="$(MSBuildExtensionsPath)\SyntaxTree\UnityVS\2012\UnityVS.CSharp.targets" />
  70. </Project>

字符串

pes8fvy9

pes8fvy91#

这通常发生在三种不同的场景中:

  • 用户正在使用Visual Studio的试用版。目前UnityVS需要完整的Visual Studio。
  • 安装无法重新创建Visual Studio扩展缓存。如果存在分散的devenv.exe进程,则会发生这种情况。请确保没有devenv.exe进程正在运行,然后重新安装UnityVS。
  • 用户在GAC中安装了与当前UnityVS冲突的UnityVS旧破解版本。

还有一种情况是,你没有安装Unity所需的.NET 3.5框架(Unity的类库是.NET 3.5的子配置文件),但错误消息通常是明确的。

6kkfgxo0

6kkfgxo02#

我已经修复了这个问题,删除并重新安装UnityVS。UnityVS安装程序的“修复”功能没有改变任何东西,所以我需要先完全卸载它。

j7dteeu8

j7dteeu83#

您可以手动删除proj文件中的这些标记。

  1. <ProjectTypeGuids></ProjectTypeGuids>

字符串
错误信息应该消失了,但你不能使用调试功能。我仍然在寻找解决方案。

vs3odd8k

vs3odd8k4#

一个对我有效的解决方案是在我的Unity项目中强制重新导入Visual Studio Tools for Unity资产(通过导入自定义包并导航到Program Files文件夹中的包)。
我认为旧版本的工具在我的Unity项目中没有被替换,即使我重新安装了工具并以通常的方式添加它。

x6492ojm

x6492ojm5#

我知道这是一个老问题,但这花了我大约一天的时间来解决。对于我的用例:

  • 我有一个Unity 2021.1.x项目。我升级到2021.2.x(实际上是一个完全干净的安装-我重新安装了Windows)和Visual Studio 2022 17.2预览版。
  • 我从根目录删除了所有.sln和.csproj文件(当然是备份它们)。
  • 我重新生成了所有的csproj文件(和sln)。在Unity中编译工作正常,但在VS中打开任何文件都会产生错误:
  1. There is a missing project subtype.
  2. Subtype: '{E097FAD1-6243-4DAD-9C02-E9B9EFC3FFC1}' is unsupported by this installation.

字符串

  • 从Visual Studio安装程序中强制卸载并重新安装工作负载“Game development with Unity”可以正常工作,随后重新生成项目和解决方案文件也没有产生任何问题。
ivqmmu1c

ivqmmu1c6#

完全删除UnityVS并重新安装帮助我使用Visual Studio 2013 Ultimate。还在Unity项目中删除并重新导入了UnityVS包,不确定这是否是必需的。

7rfyedvj

7rfyedvj7#

我得到了错误“此项目与当前版本的Visual Studio不兼容”。“修复”不会解决这个问题,但卸载并重新安装没有'devenv.exe进程运行,是解决方案。我使用Visual Studio 2013社区,并通过Unity工具栏打开项目(Visual Studio Tools\Open in Visual Studio)。
@JB Evain -额外感谢你在我自己的类似问题上为我指明了正确的方向。

yr9zkbsy

yr9zkbsy8#

我在Visual Studio 2010 Professional中遇到了同样的问题,因为我安装了另一个我没有使用的Visual Studio版本(2013 Express)。
其他解决方案都不适合我,但在使用安装盘对VS2010进行**修复后,它又开始工作了。

hivapdat

hivapdat9#

在Unity的软件包管理器中删除Visual Editing软件包后,不再出现此错误。到目前为止没有错误。

相关问题