This 40 minutes video is definitely going to save my 400+ minutes. Thank you Mr. Tim.
Thanks Tim, great video! When making a video like this with lists, I've seen other videos where they have sections in the play bar. I don't know how to do this, but it makes it really easy to see when you start and end a specific tip. Again though, great video and I appreciate your time to make these.
That comes from putting timestamps in the description. That is something I have left for the community to do because of how much additional time it takes to record these (times change during the recording so I cannot identify the time positions until after a recording is produced). In this case, a community member named Ralfs stepped up and posted the timestamps so I added them to the description. The video now has the chapters labeled by tip.
Speaking of shortcuts...
0:00 - Intro
1:48 - Auto curly braces with Shift+Enter(bonus: Extract class into its own file)
3:50 - Add missing using directives when paste code
5:54 - Inheritance margin
9:30 - Remove unused references
11:56 - Editor config user interface
18:26 - Code clean-up (Format document profiles)
23:26 - Class constructors and properties
27:54 - Parameter validation - auto null checks
30:25 - Auto and full property conversion
32:29 - Experimental Razor editor
39:42 - Concluding remarks
Love this! Used to type as crazy in my beginnings, took me ages but as the time goes by, I've learnt some shortcuts and now extented using your tips. Thanks!
Good video, always enjoy your presenting style, what you would normally do vs what you can now do. Very similar to videos we do to show new features added to a system. Always enjoy coming back to your channel, learning more, and seeing the strides you keep making. Keep up the good work! :)
Amazing! Thank you! The Shift+Enter for curly braces especially is so useful. You almost think why it has not been there all along!
Creating some short templates for very common things has done wonders for me. I created one that’s activated with pgs (property getter setter). So after typing scope type and name I type pgs and enter and my auto property is done. I used to keep ones for the special properties used in Xaml apps as well. At any rate, it feels a bit like the shift enter because it’s not really a huge amount of automation but it speeds up code writing considerably.
Type 'if' and see how unimpressed you are with shift+enter. Then try 'do', 'else' and many others. Shortcuts have been around for years.
Also, you don't need to go to the end of the line before typing shift-enter
@@IAmTimCorey I'm using Visual Studio 16.10.4 but shift+Enter does not add the curly braces just a normal space. Do I need to enable it somewhere?
Great Stuff Tim. Thanks for sharing the knowledge. Much appreciated.
2:12 #1 Smart line break
3:50 #2 Add missing using directive
5:55 #3 Show inheritance margin
9:35 #4 Remov unused references
11:55 #5 EditorConfig with GUI
18:35 #6 Code cleanup tool
23:25 #7 Add properties to constrctor
27:57 #8 Test parameters
30:25 #9 Convert properties
32:28 New razor editor
This is a great video, thank you.
A tip from me, when creating a constractor , you can select all the properties(simply mark it with your mouse) and then create a constractor with all those properties from the quick action menu.
Thanks, i was wondering if it was possible to do something like that, much appreciated!
I usually don't have time to pursue these changes. Thank you very much TIm.
Fantastic video Tim! I knew a couple, but not all 10. Could you share your editorconfig file? I'm interested to know what settings you use on a day to day basis.
Thanks for the video.
Is there a tip when creating a new blazer component it automatically creates the partial code behind class? That would be nice
Very nice tips - Thanks.
One thing I would add, remember if you change your settings that you save your settings Tools | Import and Export Settings and make sure the export location is included in your backups.
Amazing ❤️
@@IAmTimCorey Hi is there any difference in Dot net programming on AMD Ryzen and Intel processor in terms of performance and compatibility? Or both works same with dotnet ?
If you ctrl+. on a blank line inside your class, you can get a dialog to choose which properties to initialize when generating a constructor. Easier than adding the properties to the constructor one by one - especially since they're all checked by default.
About time for number 4!! That took too long to get implemented!
That's a hard one to get implemented (and they are still trying to get it right). Sometimes the only way to truly know what is an unused reference is to run the application.
this was really helpful, thanks for this amazing content!
can you also make one for docker?
Thanks for the video. Just a note, 'Remove Unused References' is suggesting removal of a project I am definitely using. When I removed the suggested project, the main project would not compile. I tried this in a separate branch, so no big deal, but just a note of caution. Probably want to branch before trying this feature.
Correct. The discovery is not perfect, so you want to be able to roll back your changes. That's why source control is so important.
Editorconfig is fairly old and allows you to change your editor settings for various IDEs (intellij, visual studio, vs code, and more) using 1 config file.
The newer usage of adding IDE specific directives is useful, but needs more standardization.
Seems like VS finally started to learn something from Resharper
Hi Tim! Thanks for "sifting through the fine print" on VS2019, to point these handy additions! The + catch is great! I did notice at the outset, you had a "value:" kinda faded in at the "Hello World." It's bugging the heck out of me, so I had to ask how you got it there? Anyway, thanks again!
Here is the video and time-code when I explain how to get those: czcams.com/video/f0YeVirKPfw/video.html
@@IAmTimCorey Great! Thanks, Tim! I got it! It's not under the editor anymore (since it's checked on your VS16.10.3, you may not have noticed it has its own grouping now). Still in C# Editor, still in Advanced and still Experimental, but all the way at the bottom of the list, just above "Inheritance Margin." (It "blossomed," too!) Anyway, I found the the feature, which is important for me, since I'm still working my way up to Developer, albeit more slowly now with work beginning. With everything to learn I can use any "hint" I can get!
P.S. I'm using the + feature in Getting Started in C# too! It's great!
It looks like they're trying to incorporate features that Resharper has had for years. :) Good to see this for when R# isn't available.
BTW, can i somehow disable the new behaviour where righclick in the text editor outside selected area desects the text? I am quite used to rearanging my code with copy/paste, and now have to after selecting the block of text move the mouse carefully back over it before poping up context menu by rightclick and selecting simple "Copy".
Other program, like Android Studio or notepad.exe, don't do that.
I would like to see a video on creating console apps with C#. Like parsing command line arguments, adding mandatory and optional arguments, displaying help, etc. Is there a library for this?
Even more of a time-saving tip for #1, I notice that you move the cursor outside of the parentheses before hitting Shift+Enter to add the brackets. You don't need to do that. Just hitting Shift+Enter inside the parentheses will still do the same job.
I'm not 100% sure about the Remove Unused References thing. Just tried it on a project I'm working on - a library of Blazor components, which currently has about 20 Blazor components, all of which reference Microsoft.AspNetCore.Components - and guess which reference it considered "unused"...
Also, my .editorconfig files don't appear to have the UI (and I'm on 16.10.3).
Good tip on the curly braces. I did it to more clearly show what was happening but you are right, it works anywhere on that line. As for unused references, that’s going to be a tricky one for chained references, which is why it asks you before just removing everything.
Can you do a project on WinUI 3.0 a.k.a Project Reunion? How to setup and install the correct libraries/extensions into VS2019?
Didn't know about Remove unused references. Tried now. Doesn't work in my project. When I create my own library and then reference it in another library and use classes from it in code, the "Remove unused references" option says that I don't use my library and proposes to remove it... If I accept, the build fails.
Do you have a video that goes over the in-depth implementation of Repository patterns?
Wow. Over the past 10 years, they've implemented about half the things I've always had in ReSharper.
Hey Tim, the sign up w/ Google link seems broken on the Patreon page, others are working fine.
I'm not sure if this is new but I've notice lately when i do binding on xaml IntelliSense triggers and suggests the list of available properties in my VM.😁
Would like to point out that refactoring the class allows for constructor generation with multiple properties in a single step (works at least since 2017 though) But I prefer this method. Just throwing it out as nice to know.
the Shift + Enter working on .razor files but the cursor not in the center of the curly braces :)
I'm not sure, but I think moving a class to its own file has been there since, I don't know, version 14? I could be wrong though, I've worked with several different IDEs recently and could be mixing stuff.
Thanks for sharing, I'm sure someone will double check you on it. ;-)
Removed unused references is not showing in my VS version 16.10.4
ctrl k + ctrl x gets me the snippets but when I type things like "prop" or "ctor" the snippet is not in the list that I can use to complete. Have been trying to find what makes that visible similar to what you have in the video. Thank you for all the great videos.
In Options/Text Editor/C#/IntelliSense, you can choose if you want them to appear or not, but I don't know how it's worded in English.
I can't find the "Remove unused references" on VS 2019 Community (version 16.10.3). Is it just me? OR that feature is not available on Community? or it does not work on ASP MVC project?
Can we get a video about designing a solution, how to know the classes and methods we need?
my first project in my work was done, it delivered what i needed but lots of methods were too long, and i repeated some parts many times because it wasnt planned well at all.
today we might start working on a new project and i want to plan it correctly (maybe a way to make the solution reusable too, not only for this one customer)
thanks for your great work
Tim has several videos covering full application development from Requirements thru development already. If you go to his CZcams channel page - czcams.com/channels/-ptWR16ITQyYOglXyQmpzw.html you will find play list for the TimCo app and C# App from Start to Finish. Both cover the requirements and design. In the C# App series Tim covers the WOULD Pattern in the first 5 lessons which is his approach for designing an application.
Also, on www.iamtimcorey.com you will find several Start to Finish courses.
The 4-th trick - in the "same" way we can remove the unused usings in c# classes !)
Hi, How did you move cursor to the parameter section after ctor + Tab (on 24:00 in this video )? Do you use some hotkeys for this?
That was just an invisible pause in the video where I accidentally moved the cursor while it was paused. Sorry, not a shortcut or hotkey.
The function of Tip #4 "Remove unused references" does not take into account links to packages in a xaml markup (wpf applications) and suggests to remove packages that are actually in use. If the project does not use a version control system, the result can be disastrous.
Good to know. I would submit that as a bug or check to see if it is already submitted as a bug. I'm sure that is tricky to get right, but it is something that needs to be addressed.
Fantastic video but in my interface it doesn´t appear the option to remove unused extensions.. even if clicked i´m using version 16.10.4
Others had similar issues and covered in other comments. Also, someone commented in this video about how to resolve something similar - czcams.com/video/qv6ZflueASY/video.html
suggestions from other folks that may help you find what you need -
"You must have VS2019 - v16.8 and above .. Tools > Options > Text Editor > C# or Basic > Advanced and select Display inline parameter name hints"
"In VS settings: Text Editor > C# > Advanced > Display inline parameter name hints"
Tim, not sure if you’ll read this but your most recent videos audio sounds strange. Did you get a new mic set up lately? It seems to be chopping off high frequencies or using an aggressive pop filter. Makes it difficult to understand what you’re saying in your latest videos. Just an FYI!
Yep, we tracked down the issue and believe we have it solved. Thursday's video should demonstrate the changes.
Anybody Help?? I have installed Visual studio 2019 (update 16.10.4), and also enabled remove unused reference, but still not showing option for remove
Resharper needs to look out, but really as long as VS doesn't come with resharpers Ctrl+T find everything I will still have a use for resharper.
I'm started using Rider 2 years ago after using VS for more than 10 years, never looked back. It runs in 64-bit space, fast startup and a whole lot of refactors. And shift shift (find every things is awesome). Resharper slows down VS a lot and because VS runs in a 32-bit spaces it knibbles also RAM. You don't have this problem using the Rider IDE.
So, I tried the editor config a few weeks ago, and unfortunately the things I set as errors did not stop my code from compiling. And some Google searches suggested that they are working on adding that ability.
Tim Corey videos are like at 1x when they are at 2x. So this video is actually 20 mins 27,5 secs :)
@@kemalemin VLC maybe? If you play media content through a 3rd party player there's tons of power. Then again... he's commenting on CZcams so ¯\_(ツ)_/¯
2.5x - Really? That like hooking the HDMI cable straight to the jugular.
Shift + Enter will work in VS2017?
@@IAmTimCorey Hi Tim, I love the way you explain every step. And you are the only one till now who replied to my comments.
Thank You ❤️
Any idea why shift+enter doesnt put a curly braces rather a new line. Tools>options>Environment>Keyboard>Edit.Breakline seems to be assigned to shift+enter
any Idea on how it can be fixed?
@@IAmTimCorey ah thanks, I'm using VS2019 for class work. That's why I was confused why it wasn't working.
Looks like many of these features are already existing in Resharper and/or Roslynator.
Yep, although these are built-in and don't slow your Visual Studio instance down to use them (and they are free).
I think I will not use the Shift-Enter shortcut because my biggest enjoyment when I type shift - curly braces and hit enter, makes me feel good.
I want to make Intellisense work after press any key, as it works in vscode or jetbrains ides? Is that possible?
What I mean is after you made mistake and removing letter by one then Intellisense won't work if you continue typing that word right.
Yep, that is possible. There is an option in the Tools->Options section to do so. You can also type Ctrl+J to bring up Intellisense whenever you want.
"Show inheritance margin" doesn't work on my machine. Blue icon is just inactive :( VS2019 v16.10.3
Couple things. First, try restarting Visual Studio. Second, make sure you have an actual inheritance inside of your code (one class inheriting from another class you control). If these steps still fail to get it to work, submit a bug in Visual Studio.
code cleanup should open an overview per profile with info on the files with the most cleanup to perform
That would take a lot of behind-the-scenes processing, especially in a real-world production application.
No I mean, only when requested, like a cleanup advise/overview, so you know where best spend your time refactoring.
Wow.. after watching this, I updated VS2019 to latest and the day has been nothing but reboots and failures. So many odd things I lost track. Everything from the code folding being WAY out of sync with the code and copy paste pasting multiple copes and then locking up.. wow. Starting to think I test my code more than MS does. Can you revert VS to an earlier release?
It sounds like you might have other issues on your machine. I had weird Visual Studio issues that turned out to be a failed Windows update.
@@IAmTimCorey Actually, Today I should be able to find out if it was ReSharper that broke with this update but man!!! what a mess. Thanks TIm.
In VS2022 I cant do the Tip#7... There is no "Generate constructor " in dropdown menu at all
I went back from 16.10.1 to 16.9, as the .10 series were giving us a lot of performance issues. Did they fix that yet?
I haven't had the performance issues recently (and I was having them earlier) so I think so (at least in my case).
@@IAmTimCorey Alas: This morning (7 hours ago) I upgraded to 16.10.3. But again had many issues: popups staying in the screen, code cleanup getting stuck at 50%, crashing of internal analyzers.
I've already reported so many bugs to MS. Getting a bit tired of this. Going back to 16.9 again. 16.10 isn't their best version.
Do you have Resharper installed? I have a report from another user who was having similar issues. The end result was that Resharper wasn't compatible with the latest version and was causing all kinds of issues.
@@IAmTimCorey hi and thanks for your response. I already knew about the resharper issue, but that's not our case. My colleagues are also having problems like mine. Maybe it's our workload? We're mostly maintaining old .net framework asp.net apps
That could be. I would definitely submit a bug report to Microsoft. They do read every report and that might expose something that they haven't encountered yet (or flag it as more important).
is there anyone that has a simple mvc sln file for ecommerce? I cant seem to find one online that is working. student here, any links is appreciated thanks!
"Simple" and "ecommerce" don't typically go together. It sounds like you are looking for a pre-done project. I don't know of any.
Using spaces over tabs? You monster! The rest of the video is pretty solid though.
Hi teacher Tim. You are the Indiana Jones of Visual Studio. You discover the treasures to show them to us in your videos. Thank you to help us to become more efficient with C#!
move alt + arrow cant effect why?
Tools -> Options -> Keyboard then select Edit.MoveSelectedLinesUp, click "Press shortcut keys" input and press Alt + Up (or whatever you want for it). And the other one is Edit.MoveSelectedLinesDown, click "Press shortcut keys" input and press Alt + Down (or whatever you want for it). stackoverflow.
Tested Tip #4 - it's risky and make sure you apply version controlling fellow devs
from 20 years Microsoft inline Jetbrains Resharper into VS
It's not a competition, we all know Resharper was way ahead for refactoring
My time saving tip for VS 2019 : If you plan at working in the morning, run VS at night before you go to sleep and it should be ready when you wakeup.
It sounds like you need to update Visual Studio. That hasn't been an issue for me in the latest version.
I really like your knowledge, but why do you always need hours for short topics ....
Context matters. Here is an example that might help. I could do a demo of a brake pad from a car. I could say "this is a brake pad. It's job is to stop the car when you hit the brake pedal." That would be a short tutorial that told you what you need to know about a brake pad. However, if you take a step back and think about the real world, how does that prepare you to be a mechanic working on brakes? Brake pads do not function in a vacuum. You need to know how the go on the car. You need to know how the rotors and the brake pads interact. You need to know about the warning signs of bad brake pads. You need to know how the brake fluid interacts with the signal to engage the brake pads. These are all contextual and all take time. You might feel good about learning something in the two-minute tutorial, but it wasn't actually valuable to anything but your theoretical knowledge of vehicle parts. It wasn't until you learned how to use the brake pads that it became practical knowledge. That's what I teach. I teach practical knowledge that prepares you to use whatever I teach in the real world. 5-minute videos are theory. They have their place, and I'll be doing some in the future, but don't confuse them for practical content. Practical content takes time and context. Now ironically, you are posting this on a video that is 40 minutes long and shares 10 tips in that time, but I am assuming you are talking about my videos as a whole.
@@IAmTimCorey lol thank you for your large explanation. Ironically, it is large like the most of your videos. :D
Your content is good anyway and I just like the sharing of your nice knowledge. So don't stop and keep it up... 👍
If you really want to save your time use Rider. It's much better and faster than VS
Your speech is a little bit slowly, Tim.. I set the speed to 1.25
That's what the speed controls are for. Talking, typing, and thinking all at the same time is tough. Plus, speaking a bit more slowly helps me enunciate better.
A good design takes a lot more thinking than typing. If these tips make a big difference, you're probably writing a hack. The only exception is comments, which for a good design will occupy at least 75% of typing time. But these tips won't help there.
Production applications take hundreds of thousands of lines of code. Just because you should plan before you build doesn’t mean building won’t require code. This is a bad take.
I'm a junior programmer with barely 3 months of experience.
You're my teacher and savior Tim.
Thank you!
You are welcome.