Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

2020.1.0a8 (and earlier) Visual Studio .sln file not saved...

Discussion in '2020.1 Beta' started by Deleted User, Oct 14, 2019.

  1. Deleted User

    Deleted User

    Guest

    How to reproduce:
    1. create a project
    2. add a script to the camera, or the light, or any object,
    3. add code to the script in Visual Studio and save the script,
    4. go back to Unity and test your code,
    5. save the project and quit Unity,
    6. quit Visual Studio: Visual Studio will ask you about saving the .sln file.
    The .sln file should be saved automatically as soon as you save the script or the project in Unity.
     
    Last edited by a moderator: Oct 14, 2019
  2. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Yeah I get this nagging too.
     
  3. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    yup ... its bad and have to restart unity everytime and delete all of VS project :[
    unity 2020.1.0a8 + VS 16.3
     
  4. Deleted User

    Deleted User

    Guest

    Why?
     
  5. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    cus of this :
    Capture.JPG

    some of assemblies can't detect on vs if open scripts again :/
     
  6. Deleted User

    Deleted User

    Guest

    @LeonhardP The problem is still there with 2020.1.0a9.
     
  7. miniwolf_unity

    miniwolf_unity

    Unity Technologies

    Joined:
    Apr 10, 2018
    Posts:
    138
    I am in contact with Microsoft to look into why this problem occurs.
     
    Deleted User likes this.
  8. Deleted User

    Deleted User

    Guest

    Thanks!

    Since you are here, do you know that the faulty Visual Studio Editor package is still installed in some of the toturials that are proposed in the Learn section?
     
  9. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    I passed the information on to the appropriate team.
     
    Deleted User likes this.
  10. sailro

    sailro

    Microsoft

    Joined:
    Jul 30, 2014
    Posts:
    167
    Bonjour @APSchmidt,

    I do not repro your issue with the sln file. Could you share with me more information:

    - In Visual Studio, Help/About, use copy info and paste the result here (or send us everything to vstusp[at]microsoft[dot]com). Perhaps one of your VS extensions is interfering.
    - In Unity, Help/About could you share the VSTU version you see displayed (on the bottom left corner of the window).
    - Following your repro could you share the content of the solution file before AND after your manual last save before quitting ?

    Thank you and best regards
    Sebastien
     
  11. Deleted User

    Deleted User

    Guest

    What version of Unity did you use to try and reproduce the problem? This happens only with 2020.1.
     
  12. Deleted User

    Deleted User

    Guest

    Capture.JPG
    Capture2.JPG

    Sorry, I have no idea how to do that. (See below)
     
    Last edited by a moderator: Oct 24, 2019
  13. Deleted User

    Deleted User

    Guest

    Okay, I tried the following:
    1. started the project in 2020.1.,
    2. opened the script from Unity,
    3. Visual Studio opened, I didn't modified the script,
    4. the content of the .sln file open in Notepad++ is the following:
    Code (CSharp):
    1. Microsoft Visual Studio Solution File, Format Version 12.00
    2. # Visual Studio 16
    3. Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assembly-CSharp", "Assembly-CSharp.csproj", "{5CCFC07A-2A51-79A4-10FA-4ABD2D79C9B0}"
    4. EndProject
    5. Global
    6.     GlobalSection(SolutionConfigurationPlatforms) = preSolution
    7.         Debug|Any CPU = Debug|Any CPU
    8.         Release|Any CPU = Release|Any CPU
    9.     EndGlobalSection
    10.     GlobalSection(ProjectConfigurationPlatforms) = postSolution
    11.         {5CCFC07A-2A51-79A4-10FA-4ABD2D79C9B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    12.         {5CCFC07A-2A51-79A4-10FA-4ABD2D79C9B0}.Debug|Any CPU.Build.0 = Debug|Any CPU
    13.         {5CCFC07A-2A51-79A4-10FA-4ABD2D79C9B0}.Release|Any CPU.ActiveCfg = Release|Any CPU
    14.         {5CCFC07A-2A51-79A4-10FA-4ABD2D79C9B0}.Release|Any CPU.Build.0 = Release|Any CPU
    15.     EndGlobalSection
    16.     GlobalSection(SolutionProperties) = preSolution
    17.         HideSolutionNode = FALSE
    18.     EndGlobalSection
    19. EndGlobal
    Even though I didn't modify the script, VS asked about saving the .sln on quitting which I did. The content of the .sln file open in Notepad++ is now the following:
    Code (CSharp):
    1. Microsoft Visual Studio Solution File, Format Version 12.00
    2. # Visual Studio Version 16
    3. VisualStudioVersion = 16.0.29418.71
    4. MinimumVisualStudioVersion = 10.0.40219.1
    5. Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assembly-CSharp", "Assembly-CSharp.csproj", "{1555CFEA-8013-20C8-0315-C35A555A8F51}"
    6. EndProject
    7. Global
    8.     GlobalSection(SolutionConfigurationPlatforms) = preSolution
    9.         Debug|Any CPU = Debug|Any CPU
    10.         Release|Any CPU = Release|Any CPU
    11.     EndGlobalSection
    12.     GlobalSection(ProjectConfigurationPlatforms) = postSolution
    13.         {1555CFEA-8013-20C8-0315-C35A555A8F51}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    14.         {1555CFEA-8013-20C8-0315-C35A555A8F51}.Debug|Any CPU.Build.0 = Debug|Any CPU
    15.         {1555CFEA-8013-20C8-0315-C35A555A8F51}.Release|Any CPU.ActiveCfg = Release|Any CPU
    16.         {1555CFEA-8013-20C8-0315-C35A555A8F51}.Release|Any CPU.Build.0 = Release|Any CPU
    17.     EndGlobalSection
    18.     GlobalSection(SolutionProperties) = preSolution
    19.         HideSolutionNode = FALSE
    20.     EndGlobalSection
    21.     GlobalSection(ExtensibilityGlobals) = postSolution
    22.         SolutionGuid = {351217FB-0D9F-403B-9615-45C80AEA767A}
    23.     EndGlobalSection
    24. EndGlobal
    Note: Visual Studio was updated just before I did that, it still asks about saving the .sln file on quitting.

    Note 2: The same content of the .sln file in a 2019.2 project. This content is unchanged if I open the script and do not modify it.
    Code (CSharp):
    1. Microsoft Visual Studio Solution File, Format Version 12.00
    2. # Visual Studio 16
    3. Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assembly-CSharp", "Assembly-CSharp.csproj", "{D0639992-E2EC-E986-9972-A3E6FA1E3A45}"
    4. EndProject
    5. Global
    6.     GlobalSection(SolutionConfigurationPlatforms) = preSolution
    7.         Debug|Any CPU = Debug|Any CPU
    8.         Release|Any CPU = Release|Any CPU
    9.     EndGlobalSection
    10.     GlobalSection(ProjectConfigurationPlatforms) = postSolution
    11.         {D0639992-E2EC-E986-9972-A3E6FA1E3A45}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    12.         {D0639992-E2EC-E986-9972-A3E6FA1E3A45}.Debug|Any CPU.Build.0 = Debug|Any CPU
    13.         {D0639992-E2EC-E986-9972-A3E6FA1E3A45}.Release|Any CPU.ActiveCfg = Release|Any CPU
    14.         {D0639992-E2EC-E986-9972-A3E6FA1E3A45}.Release|Any CPU.Build.0 = Release|Any CPU
    15.     EndGlobalSection
    16.     GlobalSection(SolutionProperties) = preSolution
    17.         HideSolutionNode = FALSE
    18.     EndGlobalSection
    19. EndGlobal
     
    Last edited by a moderator: Oct 24, 2019
  14. Deleted User

    Deleted User

    Guest

    From what I notice, these two lines are added automatically when VS is opened from within Unity 2020.1 whether you modify the script or not.
     
  15. sailro

    sailro

    Microsoft

    Joined:
    Jul 30, 2014
    Posts:
    167
    Ok,

    So I tried with a custom build of 2020.1.a06 on which we are working with @miniwolf_unity, and I do not repro.
    Just downloaded the latest a09, and indeed I repro on this one.

    Seb
     
  16. Deleted User

    Deleted User

    Guest

    The problem was there in a08 too but it's not really important. :)
     
  17. sailro

    sailro

    Microsoft

    Joined:
    Jul 30, 2014
    Posts:
    167
    @miniwolf_unity we had a deeper look, and we repro even when disabling completely our bridge (so with pure generation on the Unity side).

    Starting with a08, for this super simple scenario, Unity is generating a csproj and a solution with distinct ProjectGuids !? for the project.

    After reading the solution, VS detects the mismatch and try to fix that in-memory. That's why it is asking about saving the .sln file on quit.

    In the example @APSchmidt gave:

    - Unity is generating the csproj with a ProjectGuid = 1555CFEA-8013-20C8-0315-C35A555A8F51
    - Unity is generating the solution with a ProjectGuid = 5CCFC07A-2A51-79A4-10FA-4ABD2D79C9B0
    - Then VS loads the solution, detects the mismatch and want to use 1555CFEA-8013-20C8-0315-C35A555A8F51 in the solution instead of 5CCFC07A-2A51-79A4-10FA-4ABD2D79C9B0.

    Given ProjectGuids are generated using a hash on a name, starting with a08, the island/project name is perhaps changing between the csproj and the sln generation.

    What do you think @miniwolf_unity ?

    Regards
    Seb
     
  18. miniwolf_unity

    miniwolf_unity

    Unity Technologies

    Joined:
    Apr 10, 2018
    Posts:
    138
    That sounds like we introduce a regression indeed. The ProjectGUID should match. We just updated with an entire new test suite, and it sounds like one of the tests verified the invalid case, which caused this to have been fixed incorrectly. I will get on that. To keep track of this issue, it would be great if a bug could be created.
     
  19. Deleted User

    Deleted User

    Guest

    Maybe you should do that; you know what words to use.
     
  20. miniwolf_unity

    miniwolf_unity

    Unity Technologies

    Joined:
    Apr 10, 2018
    Posts:
    138
    This problem has been resolved and was merged in October 18th.
    So it should be available in the next alpha release. :)
     
    Deleted User likes this.
  21. Deleted User

    Deleted User

    Guest

    I'll be back to you when it's released. :)
     
  22. Deleted User

    Deleted User

    Guest

    Fixed in 2020.1.0a11. :)
     
    miniwolf_unity, Peter77 and LeonhardP like this.