Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Enter the 2020.2 Beta Sweepstakes for a chance to win an Oculus Quest 2.
    Dismiss Notice

[Solved] Is there a way to force Unity to regenerate csproj files?

Discussion in 'Data Oriented Technology Stack' started by Lieene-Guo, Apr 15, 2020.

  1. Lieene-Guo

    Lieene-Guo

    Joined:
    Aug 20, 2013
    Posts:
    415
    Is there a api or some thing that I can force unity to regenerate .csproj and .sln? including package .csproj for Entitiies or Collections

    The default behavior of csproj generation is like it only update thoese csproj that has change, adding or removing source file. But if I delete the csproj itself for some reason, it is not considered dirty. so even if all .csproj and .sln is deleted. by double clicking a source Unity wont make new ones. By using Open in c# Project from context menue It generates only .csproj for assembly define in Asset folder, no including package assembly. My Preferences->External Tools-> Generate all .csproj files is Checked.

    And the reason, I remove .csproj files is a TestRuner+Burst bug keep corrupting my .csproj. I am trying to figure out why.

    But I really want to know if I can force unity to regenerate ALL .csproj by some UnityEditor Api or so.
     
  2. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    2,558
    upload_2020-4-15_12-20-50.png

    Under Preferences/External Tools

    Shouldn't be too hard to reverse it and call it from from a script if API doesn't already exist.
     
    Lieene-Guo likes this.
  3. Lieene-Guo

    Lieene-Guo

    Joined:
    Aug 20, 2013
    Posts:
    415
    :( I don't have it as I am on 2019.3.2f1
    Are you on 2020?
     
  4. Lieene-Guo

    Lieene-Guo

    Joined:
    Aug 20, 2013
    Posts:
    415
  5. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    2,558
    This screenshot was 2019.3.9f1

    So either it was added in a later 19.3 version or I guess rider might inject it in
     
  6. Lieene-Guo

    Lieene-Guo

    Joined:
    Aug 20, 2013
    Posts:
    415
    Where is that?....
    On my Unities..
    2020.1.0
    upload_2020-4-15_12-3-9.png
    2019.3.2
    upload_2020-4-15_12-3-47.png
     
  7. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    2,558
    Must be a rider feature.

    Rider master race.
     
  8. Lieene-Guo

    Lieene-Guo

    Joined:
    Aug 20, 2013
    Posts:
    415
    Thanks for the hint.
    upload_2020-4-15_14-12-26.png
    I got it now.
    It's nether UnityEditor version nor Rider Inject.
    But Rider/VSCode Editor package version 1.2.0 up would have this
     
  9. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,085
    Truth truth
     
  10. Vivraan

    Vivraan

    Joined:
    Feb 2, 2018
    Posts:
    13
    Is it possible to do something similar in 2018.4 LTS? Kinda stuck on this release for our project.
     
  11. dormouse

    dormouse

    Joined:
    Mar 1, 2011
    Posts:
    66
    I simple question:
    Why it shows: Generate all .csproj files,
    sometimes, it shows individually:
    Generate .csproj for:
    Embedded Packages..
    ..
    ...


    Thanks
     
  12. Lieene-Guo

    Lieene-Guo

    Joined:
    Aug 20, 2013
    Posts:
    415
    It depends on which IDE you are using and Unity's package version of your IDE's supporter tools.
     
unityunity