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 Packagename
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.Dictionary2 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.