Visual Studio 2013 force check of code - c#

Let me explain what I'm trying to do. So in SQL Management studio, you can click the checkmark box to have it refresh/evaluate your query before trying to execute the query.
What I'm wondering is if there is something similar in VS to do the same thing. Let me explain the scenario...
I had some code with calls to a function. I am removing this function to consolidate code. I know the function is called numerous times, so I commented the whole function. I knew without a doubt there would be errors, and along with that the color boxes for them should have shown up in my scroll bar.
Nothing did (either in error output window or scroll bar). So I ran a build (knowing it would fail) and of course it did with my error output now populated as well as my scroll bar.
Is there a similar functionality in VS that I am not aware of that will force not only the error window to output outstanding errors, but also force the scroll bar to update as well without doing an entire build (like SQL's check query)?

In Visual Studio 2013 a build (CTRL-SHIFT-B) is the only option. A full rebuild works as well of course, but is not required.
Things may change in Visual Studio 2014, when Roslyn is introduced.

Related

Is there any way to NOT get a Designer error when deleting code? (C#, Visual Studio, WinForms)

I'm making a WinForms program for my Diploma final project using C# and Visual Studio.
Sometimes I accidentally double-click a tool and that opens up the main event for the tool, like button_Click. But when I delete that code and check the Designer, it gives me an error message. If I choose to ignore it, all of the Form's formatting is lost and I have to start over (real pain in the a**).
I usually just click the - to minimise the code block and then add comments that the code is unused. But as you can guess, this makes for a really ugly and unorganised coding page.
Is there any way for me to remove the code and not get a Designer error?
Go to the Form.Designer.cs file or F12 on the InitializeComponent() method.
Then on the right margin look for the red dots and delete the events pointed to methods that have been deleted.
Anyone got a quicker way?

Visual Studio Code Order In AutoCompletion

I recently switched to Visual Studio Code and I love it! It starts so quickly andI just enjoy the open source environment more than Visual Studio. But there's one problem that I have encountered that bothers me more than it should.
Before I could if I wanted to autocomplete the syntax for an if statement I'd just be able to type in "if" and touble tap tab, but now the autocompletion IntelliSense things pop up in the wrong order:
The red box is the wrong one that gets displayed first and the green box is the one I want at the top. My question is if there's a way to configure it so that I get that statement at the top. It's the same with for-loops, foreach-loops and pretty much every other autocompletion that I want to use.
Create snippet (or edit) ctrl+shift+p Preferences: Configure User Snippets
settings (ctrl+,)
"editor.snippetSuggestions": "top",

Visual Studio 2013 Update 2 - Remove Project dropdown in C# navigation bar?

I recently updated my Visual Studio 2013 to Update 2 RTM. Now for my C# files, the navigation bar has a new dropdown for Projects, instead of just having Types and Members like it used to. The Projects dropdown is taking up valuable screen real estate.
Is there a way to hide that Project dropdown in the navigation bar?
See this link for a picture of what a navigation bar looks like.
Update: I added a picture of what my navigation bar looks like for a C# file.
I don't think as things currently stand that you can disable it, but its name is apparently "Context Switcher".
According to this MSDN blog, it would appear to be a new feature intended to help you manage shared files in Universal Apps. I agree that it's confusing, and I'm not a big fan.
A thorough search of the VS options for anything related to "Navigation Bar", "Context Switcher", or "Universal Apps" comes up empty and there don't seem to be any extensions offering this capability either. As far as I know these would be the main avenues for configuration, so my conclusion is that we are stuck with it until the next VS update or until someone gets around to making an extension that can disable it.
If you prefer, you can disable the navigation bar entirely in "Tools > Options > Text Editor > All Languages > Navigation Bar" (or you can disable the bar on a language by language basis.)
Update: As of Visual Studio 2013 Update 3, you can drag and adjust the relative sizing of the 3 drop down lists in the navigation bar.
From a little local testing it looks like the sizing you set is shared between all files and solutions and it persists after closing and reopening visual studio.
I shrank the context switcher down to just the visible text, and it feels more well proportioned and closer to the classic Class and Member drop down layout.
A specific issue has been opened at:
http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/5748900-add-option-to-exclude-the-new-shared-file-dropdow
Please vote !
In Visual Studio 2013 Update 3, which was released this week (http://www.visualstudio.com/news/2014-aug-4-vs) , we have added the ability to re-size the splitters in the Navigation Bar to your own taste. We will save this setting for you. This means if you don't want to use real-estate on the Context Switcher, you can make it very small, but without changing the keyboard behavior of the Navigation Bar. We hope you like this change, which will also appear in the next public release of Visual Studio "14".
There is no (official anyway) way to hide the project dropdown currently. We are considering it though.
Please file a suggestion on http://visualstudio.uservoice.com or file a bug on https://connect.microsoft.com to get your feedback heard.

Visual Studio 2012: "Live Error List" - how to turn it off?

While I edit C# code in Visual Studio 2012, the "Error List" window continually updates with a list of current syntax errors etc. I find this very distracting and would like to turn it off.
Does anyone know how to turn it off?
(I don't really know what this VS feature is properly called, so someone might already have answered it... Apologies if this is the case.)
You can try with based on : General and deselecting the "Always show Error List if build finishes with errors"
Tools -->Options--> Projects and Solutions --> General and deselecting the "Always show Error List if build finishes with errors".
I usually unpin it (with the pin icon in its top right corner), and call it up when I want to see it by moving the mouse onto its title. Once you compile your project, the window will automatically come up if there are any errors.

Is there a utility that can monitor open windows/ in .net winforms?

This is a general question, but I'll explain my specific need at the moment:
I want to find the framework class that enables one to choose an image at design-time. I can find the editor that is used at run-time - its the Drawing.Design.ImageEditor. At design time, however, a different editor pops up which allows one to choose an image from resources.
I'm guessing I could run some kind of program, then open up the image editor, from the property grid, and see what new windows/classes have been created?
Thanks
Yes, you can see what's being used by using another instance of Visual Studio and use Tools + Attach to Process (managed) to look at the call stack. It is a Microsoft.VisualStudio.Windows.Forms.ResourcePickerDialog. That is not something you can use in your own code, the Visual Studio designer assemblies are not re-distributable. Nor would they be useful, they monkey with the design-time state of the project.
Making you own isn't that hard, just use Reflection to iterate the properties of Properties.Resources and find the ones that have the Bitmap or Icon type. Display them in a ListView to allow the user to pick one. Adding resources at runtime isn't an option.
A tool with similar functionality to what you mention is Spy++ which you can find in your Visual Studio folder on the start menu (under the sub menu Visual Studio Tools).
However, if I understand you correctly, I don't think the design time editor you're talking about is written in managed code and even if it was, I'm fairly sure it's not in the framework. It's just part of Visual Studio itself and as far as I know you can't get hold of the source code for that.

Categories

Resources