Visual Studio 2010 - Is there a plugin for customizing the compiler output? - visual-studio-2010

Basically, our solution is composed of about 30 sub-projects.. and growing. Compiling this monster is fast and compiler warnings/errors/general output just scrolls by in a mishmash of ... well, poo. On unix it's easy to write a filter to "pretty-ify" the compiler output into something readable and, ultimately, useful.
Has anyone done this for VS2010? Something color coded as a minimum and one that would consolidate all the different projects would be ideal. Essentially, I'd love to have my compiler output displayed in a tree form with options to have all the children be closed unless there is a warning or error.
I also don't mind creating something for this or even having a macro that runs after the compiling is done that creates a more organized output of the whole mess.
Thanks in advance,
Scott

try vscommands 2010. It can colour the build/debug outputs and you can define your own formatting (warnings, errors, exceptions, code contracts ect.)

Related

Visual Studio Obfuscation

I am trying to test different obfuscators. Before obfuscating I used Reko decompiler. It seems that the exe is already obfuscated - please look at the screen shot. Can someone please explain - why all the methods and variables seems as if the exe is already obfuscated?
Symbol names are not compiled into executable machine code.
They can be preserved, but in this case they are saved in separate .pdb file. If you don't generate it during build, or don't make available to debugger/decompiler, it cannot figure out variables and function names (except for the imported/exported ones)
High level constructs, like for or while are implemented with jumps and conditional jumps, so it is not possible to figure out if a loop was implemented via for or goto or if a conditional was if statement or ternary operator.
Optimization hugely transforms code, throwing away unnecessary parts, making some operations at compile time, etc.

Swap text blocks in Visual Studio

Is there any built-in way to swap two arbitrary text blocks in Visual Studio? (I happen to be using VS2015).
Example: you have a method such as FooBar(target, source) and you decide it would make more sense to be FooBar(source, target). If you've called FooBar in a lot of places you might need to run multiple operations to swap the various pairs of variable names.
Having this done also within comments could also be useful.
While obviously you could do this with multiple search & replaces, or multiple Edit->Refactor->Renames (^R^R), those approaches are somewhat prone to error, and are more tedious.
If this doesn't actually exist within Visual Studio but another tool like Notepad++ (for instance) has this capability, that is almost as good.
These questions are similar but for more specific scenarios:
Does anyone know a visual studio keyboard short cut to swap around two sides of a statement?
Invert assignment direction in Visual Studio
Visual Studio has the built in functionality to reorder parameters. You can select this by using Edit > Refactor > Reorder Parameters.... Changing parameters in this form will update all the method calls in addition to the method. You can also request to preview all the changes which will be made.
More information here.

Keep different versions of one program - Visual Studio

I have a program. There are two versions of it, one has two lines commented out. I would probably do the same improvements to both codes, so in the end the difference will be the same two lines.
Now, I need an easy way to manage both. Currently, I have both in one project and I keep commenting and uncommenting the lines for each build. So, I have two possible solutions:
Keep two projects. This will be very unproductive. I need to do the same improvements to both projects.
Have a settings value. (e.g. a bool named isClient1) This is simple and good, I would set it to true or false when I'm building it, however it's no different from what I'm doing right now. Setting a value to true or false doesn't seem to be any easier than commenting/uncommenting two lines.
Is there an ideal way? (Visual Studio 2013)
You can try conditional compilation. With conditional compilation you can create a new "configuration" in your project such as "release2" and then specify a symbol for that configuration so that when "release2" is selected then those two lines will be commented or uncommented.
Take a look at this example here: http://pinter.org/?p=1060

Create Visual Studio 2010 extension to generate compiler warning

I want to create an extension to recognize specific comments in my code. I will use this to signal code smells by using the //# comment prefix. One feature of this extension will be to generate warnings for each comment encountered while compiling the code. Is it possible to do this?
I don't think you can hook into the compiler to generate warning. However, the "Error List" view aggregates errors, warnings and messages from multiple sources. Would it be good enough for you to simply append to that list?
Here's a link I could find on the subject : http://www.mztools.com/articles/2008/MZ2008022.aspx
There is a sample called CodeSweep that detects certain strings in comments (it is written to look for mild swear words) that adds tasks to your Task List. http://code.msdn.microsoft.com/Code-Sweep-3bfb7bb5 Reading this code could help you write your own extension if you can't use it as-is.
You could also use the existing task functionality and add your own keywords (like the out-of-the-box //HACK and //TODO - you could add //SMELL) which is quicker but gives you less control. http://msdn.microsoft.com/en-us/library/zce12xx2(v=VS.100).aspx. This may be all you need.

Get rid of Hungarian notation in C# code in automated manner?

I have a large codebase that uses Systems Hungarian for most variable names, which basically means I have lots of objQueue's, objCommon's, dtDataSet's et cetera.
Is there any way to convert most of them? Especially, I want to get rid of irritating obj ones that have absolutely no sense, make variable names seem similar and the code completely unreadable.
There was a similar question but it was asking whether it's worth to do the replace.
Answers like “leave it as is” are not of any use to me because I'm definitely sure I need to do this.
The codebase is really large, and I don't want to rename variables one by one. Neither do I want to run Find & Replace because I'll get false hits and mess up code even further.
Is there any automated tool to make such replacements in Visual Studio? Some addin for Resharper, whatever?
Alas, but it seems like there is no bulk rename tool for C#.
Please correct me if I am wrong.
One solution would be to use something like Visual Assist's rename feature.
Other than that, a very careful search'n'replace (with a build between each modification followed by a check-in into source-control).

Resources