Search Unity

Editor strips public variables on prefabs when closing Visual Studio

Discussion in 'Editor & General Support' started by kwcae, Aug 15, 2018.

  1. kwcae

    kwcae

    Joined:
    May 26, 2017
    Posts:
    34
    After updating to 2018.2.0f2 I've noticed an issue where visual studios loads two projects when i double click a .cs file. The first is the usual MyApplication.csproj but it also loads as part of the MyApplication solution a MyApplication.player.csproj

    This causes some issues where VS is detecting changes to player.csproj each time you change a script file in the main project or close VS after saving your edited files.

    If one clicks save when prompted to instead of discard, VS overwrites the player project resulting in any prefab with public variables that were assigned in the inspector being stripped. Obviously a very bad thing.

    I've tried the Unload Project option in VS but it doesn't have any permanence.

    I'm using VS 2015 and VS 2017 is not an option at the moment as i work for a company which is larger than the legal limits for VS 2017 community, requiring weeks to months of back and forth with purchasing to get licences for the team.

    Target Platform is UWP and the HoloLens
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    You mean it loads two projects that are physically in different folders? Can you show a screenshot?
     
  3. kwcae

    kwcae

    Joined:
    May 26, 2017
    Posts:
    34
    Not two different folders, the same project folder contains the one .sln file and four .csproj files (automatically generated)

    Can't upload media from work, file sharing sites are blocked at the firewall. best i can offer at the current time is the below structure.

    MyProjectFolder
    MyProject.sln
    MyProject.csproj
    MyProject.Editor.csproj
    MyProject.Player.csproj
    Unity.PackageManagerUI.Editor.csproj

    Usually the only the MyProject.csproj is the only one that is affected in VS.

    I re-started the unity project and re-imported the scenes into a fresh project in case the solution was broken. It still behaves the same, except now i get the issue described in this thread in addition to the current issue...(https://forum.unity.com/threads/can...ntity-have-been-imported.524007/#post-3506078)

    I guess I've just got bad luck this month...

    As far as i can tell, the VS project that's generated by unity isn't ignoring the other .csproj files in the generated .sln (This is an assumption). It may be related to the UWP platform as i get 30 warnings when unity is started stating things like
    Unity extensions are not yet initialized, so we cannot say if the 'C:/Program Files/Unity 2018.2.0f2/Editor/Data/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll' is compatible with platform WindowsStoreApps
    UnityEditorInternal.InternalEditorUtility:GetPrecompiledAssemblies(Boolean, BuildTargetGroup, BuildTarget)
    UnityEditorInternal.InternalEditorUtility:GetMonoIslandsForPlayer() (at C:/buildslave/unity/build/Editor/Mono/InternalEditorUtility.cs:396)
    System.Reflection.MethodBase:Invoke(Object, Object[])
    SyntaxTree.VisualStudio.Unity.Bridge.CompilationUnit:CompilationUnits(String)
    SyntaxTree.VisualStudio.Unity.Bridge.CompilationUnit:CompilationUnitsForPlayer()
    SyntaxTree.VisualStudio.Unity.Bridge.ProjectSystem.UnitySolutionBuilder:CreatePlayerProject(CompilationUnit)
    SyntaxTree.VisualStudio.Unity.Bridge.ProjectSystem.UnitySolutionBuilder:CreateSolution()
    SyntaxTree.VisualStudio.Unity.Bridge.ProjectSystem.UnitySolutionBuilder:CreateSolutionFromAssetDatabase()
    SyntaxTree.VisualStudio.Unity.Bridge.ProjectFilesGenerator:GenerateProject()
    SyntaxTree.VisualStudio.Unity.Bridge.ProjectFilePostprocessor:OnPreGeneratingCSProjectFiles()
    UnityEditor.Modules.ModuleManager:RegisterAdditionalUnityExtensions()


    To add insult to injury, after the solution re-build, i get "Packages\com.unity.package-manager-ui\Editor\Sources\UI\Common\VersionItem.cs' could not be found." messages when trying to enter debug more...

    Edit, More issues... when opening the VS project the following sizable failures are spammed by VS.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\UI\PackageList.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\UI\PackageList.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\UI\PackageList.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\UI\Common\UIUtils.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\Services\Common\OperationSignal.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\Services\Interfaces\IAddOperation.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\UI\PackageManagerExtensions.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\Services\Packages\PackageOrigin.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\Services\Packages\PackageTag.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\Services\Packages\PackageOrigin.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\Services\Packages\PackageOrigin.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\Services\Packages\PackageListExtensions.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\Services\Common\ThreadedDelay.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\Services\Interfaces\IOperationFactory.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\Services\Common\Resources.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\Services\Common\ApplicationUtil.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\UI\PackageManagerWindow.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\Services\Upm\UpmSearchOperation.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\Services\Packages\Package.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\Services\Upm\UpmAddOperation.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\UI\PackageGroup.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\Services\Upm\UpmBaseOperation.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\Services\Interfaces\IListOperation.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\External\SemVersion.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\Services\Packages\PackageInfo.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\Services\OperationFactory.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\UI\PackagesLoading.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\UI\PackageItem.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\UI\PackageDetails.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\Services\Packages\PackageFilter.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\UI\Common\Alert.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\UI\Common\PopupField.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\Services\Upm\UpmRemoveOperation.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\Services\Upm\UpmListOperation.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\Services\Packages\PackageInfoListExtensions.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\UI\Common\LoadingSpinner.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\Services\Packages\PackageState.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\UI\PackageSearchFilterTabs.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\AssemblyInfo.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\Services\Interfaces\IBaseOperation.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\Services\Packages\PackageGroupOrigins.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\Services\Interfaces\IRemoveOperation.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\UI\Common\VersionItem.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\UI\Interfaces\IPackageManagerExtension.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\Services\Packages\PackageCollection.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\Services\Interfaces\ISearchOperation.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\Services\Upm\UpmOperationFactory.cs'.
    [Failure] Could not find file 'C:\00 Unity Projects\ATA-IITSEC-2018\Packages\com.unity.package-manager-ui\Editor\Sources\External\SemVersionExtension.cs'.
     
    Last edited: Aug 16, 2018