Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Support .editorconfig in C# project generation

Discussion in 'Editor & General Support' started by Laicasaane, Mar 21, 2019.

  1. Laicasaane

    Laicasaane

    Joined:
    Apr 15, 2015
    Posts:
    293
    I'm using Unity 2018.3.8f1 and it doesn't recognize the .editorconfig file inside Assets folder. So when the C# solution is regenerated I must manually add it back.

    I expect when the .editorconfig file is at the same level or below the .asmdef, it should be included in the project of that .asmdef. Otherwise, if it's not be within any project, it should be a "Solution Item".
     
    Last edited: Mar 21, 2019
  2. Karnsteiner

    Karnsteiner

    Joined:
    Mar 24, 2013
    Posts:
    29
    This would be a really nice quality of life addition, using editor configs seems to be pretty prevalent even among the official Unity repositories that I've seen, but having to re-add them every time the solution is opened for the first time is annoying especially if switching between projects.
     
    dog_funtom and kthrose like this.
  3. Laicasaane

    Laicasaane

    Joined:
    Apr 15, 2015
    Posts:
    293
    In the meanwhile, we could use this solution instead.
    https://github.com/zaikman/unity-editorconfig
     
  4. JonathanBolten

    JonathanBolten

    Joined:
    Dec 15, 2012
    Posts:
    50
    It's 2023, is this still the best way to have a Visual Studio .editorconfig file in a Unity project? I'm surprised searching for this didn't have more results or solutions.
     
  5. Laicasaane

    Laicasaane

    Joined:
    Apr 15, 2015
    Posts:
    293
    No. From Visual Studio 2019.4 you can already use .editorconfig the normal way. Just put it on the project folder where .csproj files are generated.
     
    JonathanBolten likes this.
  6. JonathanBolten

    JonathanBolten

    Joined:
    Dec 15, 2012
    Posts:
    50
    Thanks. I was confused because the editorconfig wasn't showing up in the Visual Studio project, but it does appear to be using the settings from it... which is all that matters.
     
  7. Bloodberet

    Bloodberet

    Joined:
    Mar 6, 2015
    Posts:
    10
  8. CSEliot

    CSEliot

    Joined:
    May 9, 2014
    Posts:
    30
    Recently checked this out, the requirements for install result in more than a handful of other packages not working.
    Soooooooooo ... anyone else w success? I know it's in preview ...