Unity2018 Open C# Project Error

错误日志

升级到Unity2018之后,使用 Open C# Project 打开VS工程,出现报错,无法启动VS。

错误日志如下:

ArgumentException: Value does not fall within the expected range.
SyntaxTree.VisualStudio.Unity.Bridge.CompilationUnit.LanguageOf (SyntaxTree.VisualStudio.Unity.Bridge.CompilationUnit unit)
SyntaxTree.VisualStudio.Unity.Bridge.CompilationUnit.CompilationUnits (System.String method)
SyntaxTree.VisualStudio.Unity.Bridge.CompilationUnit.CompilationUnits ()
SyntaxTree.VisualStudio.Unity.Bridge.ProjectSystem.UnitySolutionBuilder..ctor ()
SyntaxTree.VisualStudio.Unity.Bridge.ProjectSystem.UnitySolutionBuilder.CreateSolutionFromAssetDatabase ()
SyntaxTree.VisualStudio.Unity.Bridge.ProjectFilesGenerator.GenerateProject ()
SyntaxTree.VisualStudio.Unity.Bridge.ProjectFilePostprocessor.OnPreGeneratingCSProjectFiles ()
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.AssetPostprocessingInternal.OnPreGeneratingCSProjectFiles () (at C:/buildslave/unity/build/Editor/Mono/AssetPostprocessor.cs:194)
UnityEditor.VisualStudioIntegration.SolutionSynchronizer.Sync () (at C:/buildslave/unity/build/Editor/Mono/VisualStudioIntegration/SolutionSynchronizer.cs:207)
UnityEditor.SyncVS.SyncSolution () (at C:/buildslave/unity/build/Editor/Mono/SyncProject.cs:190)
UnityEditor.SyncVS.SyncAndOpenSolution () (at C:/buildslave/unity/build/Editor/Mono/SyncProje

Unity Down Assistant

在Unity的Download Assistant中进行下载VS组件

vs_Enterprise安装Unity组件

在vs_Enterprise.exe 中安装unity的组件也是失败

其它排查方法

怀疑是Unity的问题,重新安装 Unity,问题无法解决。

更换其它版本的unity,比如2018.2.9f1,问题无法解决。

解决方案

如果是VS2015,则可以通过下载新版本的Visual Studio Tools  For Unity 进行更新。(公司机器测试通过)

如果是VS2013,下载新版本的Visual Studio Tools  For Unity 更新后也是失败(家里机器)。

更新VS2017,问题得到解决。

相关帖子:https://forum.unity.com/threads/error-with-unity-and-visual-studio-bridge-vs-project-not-updating-when-new-scripts-added.511761/

原文地址:https://www.cnblogs.com/zhaoqingqing/p/9691680.html

时间: 2024-09-30 07:16:36

Unity2018 Open C# Project Error的相关文章

安装qwt-6.1.0时 make出错 :Project ERROR: Unknown module(s) in QT: svg

如果出现这样的错误:Project ERROR: Unknown module(s) in QT: svg 很 有可能 qmake 版本不一致造成的. qmake  , qtcreator  , qtdesigner 和 QT 的版本必须一致.要么是 QT4 ,要么就是 QT5, qtcreator是QT5特有的core,ui编译IDE,其中ui编辑会调用qtdesigner.  我的linux 中安装了QT4和QT 5.所以安装的时候出现了一些版本不兼容的问题,后来把版本一一统一后,问题就消除

[ERROR ]Failed to execute goal org.codehaus.mojo:flatten-maven-plugin:1.1.0:flatten (flatten) on project

今天在启动项目的时候,莫名的Maven install命令的时候出现错误 错误提示:Failed to execute goal org.codehaus.mojo:flatten-maven-plugin:1.1.0:flatten (flatten) on project [ERROR] Failed to execute goal org.codehaus.mojo:flatten-maven-plugin:1.1.0:flatten (flatten) on project lis: 4

My impressed software error

To tlak about an impressive project error. It is not the recently project I did. Because they will very hard to finish, but I will find the error easily from my code. The project give me a deep impression is the code I write in the one grade. It is a

error RC1205: invalid code page

Get followings error and warnings when building project: error RC1205: invalid code pagewarning C4005: '__useHeader' : macro redefinitionwarning C4005: '__on_failure' : macro redefinition Explanation from MSDN: Resource Compiler Fatal Error RC1205 Th

Git you are not allowed to push code to protected branches on this project?

error: You are not allowed to push code to protected branches on this project....error: failed to push some refs to ... there's no problem - everything works as expected. In GitLab some branches can be protected. By default only 'master' user can com

Qt5.8以上版本编译Oracle数据库的OCI驱动教程

在前一篇的文章中我已经发过一个相似的文章,详情请点击:Qt5编译oracle驱动教程. 在那一篇文章中已经可以解决了Qt5的常用版本的Oracle数据库驱动的支持,但是在新的Qt开发工具中那种方法竟然失效了,具体出现在Qt5.7.1之后的版本. 这次我带来Qt5.8.0的编译教程,Qt5.9的版本同样适用. Qt版本是Qt5.8.0,安装路径是默认的 C:\Qt\Qt5.8.0,Oracle客户端版本oracle 11g 安装路径是 D:\app\Xiao\product\11.2.0\clie

Wex5----错误收集

1. WeX5_V3.4 仿淘宝 生成本地App包报错????? :CordovaLib:generateDebugSources 注: 某些输入文件使用或覆盖了已过时的 API. 注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译. :CordovaLib:compileDebugJava :CordovaLib:extractDebugAnnotations :CordovaLib:mergeDebugProguardFiles :CordovaLib:proces

QT嵌入式平台配置

Qt5 on ARM platforms - IntroductionQt5 ARM 平台移植#################################################### Introduction: This short post covers the background of Qt5, architec tural details, configuring for eglfs with Graphics drivers, building, and known i

Please install Android target

今天在执行ionic build android时出现以下错误: [Error: Please install Android target: "android-22". Hint: Open the SDK manager by running: D:\Program\ Files\ (x86)\Android\android- sdk\tools\android.BAT You will require: 1. "SDK Platform" for androi