Це відео не доступне.
Перепрошуємо.

Editorconfig In Visual Studio In 10 Minutes or Less

Поділитися
Вставка
  • Опубліковано 15 сер 2024

КОМЕНТАРІ • 49

  • @ferrarijuan
    @ferrarijuan 2 роки тому +9

    What great timing again Tim. We just today discussed this topic and how we are going to go about enforcing common coding styles. This is going to help a lot. Thanks for the video.

  • @EricKing
    @EricKing 2 роки тому +10

    Those Visual Studio bugs are embarrassing. Thanks for the video.

  • @NiquelBones
    @NiquelBones Рік тому +3

    For anyone having issues creating the editorconfig file, it's actually not rendering in the solution explorer, you'll have to open the solution in the regular windows explorer and drag the created file to the IDE to open it, if you're having more issues there is a video called "EditorConfig file doesn't work in Visual Studio 2022? Here is a workaround" that gives a good explanation and solution.

  • @Tsunami14
    @Tsunami14 2 роки тому +2

    I remember a previous video of yours which showed how to set coding styles at a per-user level, and my immediate question was if this can be set per project/solution and checked into source control.
    Glad to see this has been addressed.

  • @YousefSh
    @YousefSh 2 роки тому +1

    I do wish you ran code cleanup so we can see it in action. But this video helped me understand editorconfig a lot!

  • @MrBan001
    @MrBan001 Рік тому +1

    can I create a .editorconfig that has all values of the default settings from visual studio inside it? Because all the settings which are Visual Studio Settings and not read from the .editorconfig could still be different per developer

  • @alekseev74
    @alekseev74 2 роки тому +2

    Nice feature. Will use it in my new project.

  • @biscuitbakerful
    @biscuitbakerful 2 роки тому +1

    Tim, I had to add an additional step to get VS to use file scoped namespaces. I had to update my project properties to use C# version 10.
    example:

    net6.0
    10

    • @IAmTimCorey
      @IAmTimCorey  2 роки тому +1

      Are you using VS2019? You shouldn’t need to do that. Glad you got it to work, though.

    • @biscuitbakerful
      @biscuitbakerful 2 роки тому +1

      @@IAmTimCorey I am using VS2022, but we are using .Net 5 at work.

  • @almightyknight127
    @almightyknight127 Рік тому

    Thanks man,this is exactly what I was looking for

  • @sandroco
    @sandroco Рік тому

    Very informative, thx :) But in my case the Code Style settings have no effect. If I set "Prefer Braces", "Yes" and "Error", no error is shown when I create a
    if(x)
    y = x
    statement. Even if I restart VS (VS Community 2022) nothing happens. I have added the configfile to the solution. Why's that?

  • @milestonetrucks9588
    @milestonetrucks9588 2 роки тому

    I do not get a choice of new editor config. I get New Item , or installation config I'm using Visual Studios 2022 running 6.0 ? any help

  • @matejlaskomulej
    @matejlaskomulej 5 місяців тому

    It doesn't really work well.
    ```
    root = true
    [*]
    end_of_line = lf
    insert_final_newline = true
    charset = utf-8
    indent_style = space
    indent_size = 4
    trim_trailing_whitespace = true
    ```
    This for example removes trailing whitespace in *.cs files, but not in *.md. `Ctrl+K,Ctrl+D` doesn't work in markdown at all, and I cannot find the fix with google or chatgpt for the life of me.

  • @unnamedsandwich
    @unnamedsandwich Рік тому

    Hi previously when I open .editorconfig, it opens with code and not this interface. How do I revert it to that?

  • @edburdo
    @edburdo 2 роки тому

    Hi Tim. Great video. I have a question... when I add the EditorConfig to my solution (VS2019) - It's all text. I don't have the nice UI that you do. Just the text. Is that a plugin, or difference in project types?

    • @IAmTimCorey
      @IAmTimCorey  2 роки тому +2

      I think that’s the problem. I’m using VS2022. If this isn’t for work, VS2022 Community Edition is free and you can install it side by side with VS2019.

  • @thelebanesehunter
    @thelebanesehunter Рік тому

    I'm trying to add editConfig as you did, also using another way by clicking on the project tab > add new item > search for editorConfig and click on the default one, or the .NET one, but still don't see anything added on my solution explorer, any idea?

    • @michael-tsai
      @michael-tsai Рік тому +1

      Hi, I think it's a bit late for this. If the issue still exists, I just record a video showing a workaround. You can find that video from my UA-cam channel.

  • @richiehatch6719
    @richiehatch6719 2 роки тому +1

    I don't have the option to add a new editor config when right-clicking. Does anyone know how to address this?
    Edit: I am using VS 2022, and the menu item does not show up even in brand new projects. I do have the intellicode module installed.
    Second Edit: For anyone else having issues, as of now, download and install the preview version of 2022.

    • @IAmTimCorey
      @IAmTimCorey  2 роки тому

      It sounds like you might have needed an update or a feature added. I'm using Visual Studio 2022 Community Edition (not the preview edition) and it works.

    • @richiehatch6719
      @richiehatch6719 2 роки тому

      @@IAmTimCorey That's crazy, not sure what I need to add then because I can add the new editor config but I still don't have the good looking UI.
      I appreciate the response! Let's me know that something still isn't correct.

    • @IAmTimCorey
      @IAmTimCorey  2 роки тому +2

      OK, further update: mine just disappeared with the latest update in VS2022 (non-preview). It is still in the preview version. It must be a glitch. You can still right-click and add new item and add the .NET editorconfig.

    • @richiehatch6719
      @richiehatch6719 2 роки тому

      @@IAmTimCorey Ah! I appreciate the update. I spent far too long trying to figure out why it wasn't working.

    • @richardzhang8028
      @richardzhang8028 2 роки тому

      Right click .editorconfig file, then "Open With ...", then choose resource file, you will get an error. Then you are good.

  • @syltis1994
    @syltis1994 Рік тому

    Anyone has any experience with VS not doing anything when you select the option to add a EditorConfig file? I have to add it manually, and even then VS does not display it in the Solution Explorer. VS 2022.

  • @sumanthdsharma
    @sumanthdsharma 2 роки тому

    I created editor configuration file in visual studio 2022 but it never throws any error if do just what you did. Block and other thing it didn't complain of anything.

    • @andreibicu5592
      @andreibicu5592 Рік тому

      Neither on my side. I wonder why use this instead of other external analyzers ?!

  • @christianista
    @christianista Рік тому

    It's not possible to import this file as default for all projects ?

    • @IAmTimCorey
      @IAmTimCorey  Рік тому

      No, not really. This file is meant to be shared with your team, so even if you set up your Visual Studio to use these defaults, it would not work with your team.

  • @TCFdemonblade
    @TCFdemonblade 2 роки тому

    Nice feature, but it is not working properly.
    If you init a git repo, the editorconfig won't save anymore.
    The only way to use it with git is to generate the file again by using the button from VS Setting.

  • @user-rz1hv
    @user-rz1hv Рік тому

    editorconfig is broken in vs 2022, at least for wpf projects, "Syntax tree is required to accomplish the task but is not supported by document [XAML file name].xaml"

    • @IAmTimCorey
      @IAmTimCorey  Рік тому

      Interesting. Have you submitted a ticket about it?

    • @user-rz1hv
      @user-rz1hv Рік тому

      @@IAmTimCorey not yet

  • @NeZversSounds
    @NeZversSounds 2 роки тому

    What a BS, I don't have it on VS 2022 as it is shown in the video nor in the documentation under New Item.

    • @IAmTimCorey
      @IAmTimCorey  2 роки тому

      If you are on the Windows version of Visual Studio 2022 and have updated, you should have it. If not, submit a support ticket. Also, make sure you are looking in the right spot to add it. It is on the Add menu when clicking on the Solution or Project files. You can also add it manually when adding new files (not new projects).