Search Unity

Local package outside of project folder

Discussion in 'Package Manager' started by _karl, Jul 12, 2018.

  1. _karl

    _karl

    Joined:
    Feb 6, 2017
    Posts:
    13
    Hi.
    Upfront, I am using the (currently) newest Unity 2018.2.0f2 with Package Manager 1.9.11.
    I have created a local package inside the Packages Folder and referenced it in the manifest.json and everything works fine.
    But when I move the Package outside of the Project folder(and change the path in the manifest) something strange happens.
    Unity does recognize the package and the code compiles normally. But when I want to open the C# Project via the Assets menu, it gives me an error and does not open the Visual Studio:

    NotSupportedException: Visual Studio Tools: Project file has no matching compilation unit for <AssemblyName xmlns="http://schemas.microsoft.com/developer/msbuild/2003">Packagename</AssemblyName>
    SyntaxTree.VisualStudio.Unity.Bridge.ProjectFilePostprocessor.OnGeneratedCSProject (System.String path, System.String content)
    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.CallOnGeneratedCSProject (System.String path, System.String content) (at C:/buildslave/unity/build/Editor/Mono/AssetPostprocessor.cs:178)
    UnityEditor.VisualStudioIntegration.SolutionSynchronizer.SyncProjectFileIfNotChanged (System.String path, System.String newContents) (at C:/buildslave/unity/build/Editor/Mono/VisualStudioIntegration/SolutionSynchronizer.cs:320)
    UnityEditor.VisualStudioIntegration.SolutionSynchronizer.SyncProject (MonoIsland island, System.Collections.Generic.Dictionary`2 allAssetsProjectParts, UnityEditor.Scripting.Compilers.ResponseFileData responseFileData, System.Collections.Generic.List`1 allProjectIslands) (at C:/buildslave/unity/build/Editor/Mono/VisualStudioIntegration/SolutionSynchronizer.cs:313)
    UnityEditor.VisualStudioIntegration.SolutionSynchronizer.GenerateAndWriteSolutionAndProjects (ScriptEditor scriptEditor) (at C:/buildslave/unity/build/Editor/Mono/VisualStudioIntegration/SolutionSynchronizer.cs:245)
    UnityEditor.VisualStudioIntegration.SolutionSynchronizer.Sync () (at C:/buildslave/unity/build/Editor/Mono/VisualStudioIntegration/SolutionSynchronizer.cs:217)
    UnityEditor.SyncVS.SyncSolution () (at C:/buildslave/unity/build/Editor/Mono/SyncProject.cs:190)
    UnityEditor.SyncVS.SyncAndOpenSolution () (at C:/buildslave/unity/build/Editor/Mono/SyncProject.cs:181)​

    I had this working already in a previous Unity Version I think. I do not remember if it was 2018.1 or 2018.2.beta.
     
  2. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,536
    Use the VS 2017 installer to update your VS installation to the latest version.
     
    trogalsky likes this.
  3. ShawnFeatherly

    ShawnFeatherly

    Joined:
    Feb 22, 2013
    Posts:
    57
    wmg901024, pcg and jhangstoerfer like this.
  4. M_R

    M_R

    Joined:
    Apr 15, 2015
    Posts:
    559
    Hi, I have the same problem on osx.

    VS for mac version: 7.5.4 (Build 3)
    vs4m tools for unity version: 1.5.0.1
    Unity 2018.2.0f2

    edit:
    solved by switching VS to the beta channel and updating to
    VS 7.6 Preview (7.6 build 2086)
    tools 1.6.0.2
     
    Last edited: Jul 26, 2018
  5. Toylips

    Toylips

    Joined:
    Feb 15, 2013
    Posts:
    28
    the same Mac problem