Posts Tagged visual studio

How to ignore whitespace formatting in merge conflicts in TFS in Visual Studio 2010.

Hate when you see all Blue because someone reformatted the code?

Fix it.

In Visual Studio, select Tools / Options / Source Control / Visual Studio Team Foundation System and click the Configure User Tools button.

In the dialog, Add an item with the following settings.

  • Extension : .*
  • Operation : Compare
  • Command : C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\diffmerge.exe
  • Arguments : %1 %2 %6 %7 %5 /ignorespace

If you are 64 bit,

C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\diffmerge.exe

image

 

image

Happy Coding!

, , , ,

No Comments

Visual Studio 2010 – Intellisense nonsense

I started getting really annoyed with the Intellisense in VS 2010. It doesn’t automatically highlight the best match for what I am typing. It seems to loosely highlight it, but hitting enter or . doesn’t act upon it.

Well, I figured out how to make it work, but requires a small change in workflow. Hit TAB. Start typing, and when the box highlights AROUND, because it doesn’t seem to select it, hit the TAB key.

Easy solution to an annoying feature. I switch between 2008 and 2010 so much I can’t remember if 2010 has always been this way, or I pissed it off.

Annoying Intellisense irritating me

Happy Coding!

, , ,

2 Comments

How to ignore the return code of a prebuild event tool in Visual Studio 2005/2008/2010…

I have seen a ton of crazy workarounds for handling this seemingly simple task. It turns out that most people change the project targets and other nitty gritty manual edit file changes. It turns out the way I am doing it is much easier.

Visual Studio gets really annoyed when a tool returns anything but zero,and it has good reason. The compiler directives tell it to do that in your project file. So, what the remedy, make every tool return zero…Impossible you say! Nope. Easy.

So, it’s so easy it will probably annoy you. Take your scripts and put all the calls into a batch file. Make the last line of the batch file EXIT 0

Yup Exit 0 <– thats a zero.

Here is the one I use to disable my service when I build, so I don’t get the annoying file in use error.

net stop "Your service name here"
EXIT 0

Happy coding!

, , , , ,

2 Comments

TFS Corrupt Cache: Team Foundation Server just won’t let go of stale data

Does your Team Foundation Server work items get a little stale and not want to refresh? Your queries stop working right?

Your manager wondering why you aren’t taking on the new critical tasks assigned to you?

Well, you may be a victim of the TFS corrupt cache.

Simple fix:

Run the following after shutting down all Visual Studio instances.

del /S /F %userprofile%\local settings\application data\microsoft\Team Foundation\*.*

Hopefully this gets you out of seeing the same old thing over and over.

Happy Coding!

, , , , , ,

No Comments

Visual Studio 2008 Designer crashes when editing WPF xaml…

I have been banging my head on the wall about my Visual Studio just disappearing from view whenever I open one of my WPF forms. As you can imagine, this puts a pretty big cramp in development efforts when you can never use the designer.

I looked in my event viewer and found this error hanging out.

Event Type:	Error
Event Source:	.NET Runtime
Event Category:	None
Event ID:	1023
Date:		3/10/2010
Time:		11:03:02 AM
User:		N/A
Computer:	BSEEKFORD00111
Description:
.NET Runtime version 2.0.50727.3603 - Fatal Execution Engine Error (7A2E10D2) (0)

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

The resolution is that it turns out your probably installed Power Commands for Visual Studio 2008. You can uninstall them, which sucks. Or you can apply a really easy patch.

Go to your devenv.exe.config file sitting in your \Program Files\Microsoft Visual Studio 9\Common7\IDE

Add this to the bottom of the dependent assemblies section:

<dependentAssembly>

<assemblyIdentity name="Microsoft.PowerCommands" publicKeyToken="null" culture="neutral"/>

<codeBase version="1.1.0.0" href="C:\Program Files\PowerCommands\Microsoft.PowerCommands.dll"/>

</dependentAssembly>

Start Visual Studio back up and rock on.

Note: Make sure the path you enter matches where everything is installed. DUH!

Credits to these guys for all their help.

Happy Coding!

, , , , , , ,

No Comments

ATLRX.H missing, oh where have you gone? At least in Visual Studio 2008

I pulled out some old code to work on a legacy project of mine and lo and behold I get “Error 29 fatal error C1083: Cannot open include file: ‘atlrx.h’: No such file or directory”. Not exactly a pretty error and worse, this file was part of the standard ATL includes.

So what the heck happened to my good ole’ friend? Well, the geniuses at Microsoft decided it would be better to sit on CodePlex. So, you can download it from here.

The library is called the ATL Server Library. Just download it, and set your include path in Visual Studio to point to it. Or get creative and copy the files into an existing include path in the program files folder(under the visual studio folder of course.

Happy Coding!

, , , , ,

1 Comment

Visual C++, Precompiled Headers and Windows 7

I upgraded to Windows 7 and I really am enjoying the new interface….but….. I went to compile my ActiveX toolset projects that are all written in C++ and I started getting  precompiled header errors.

So I rebuilt and rebuilt and still got the error:

Error    1    fatal error C1859: ‘.\Release/HTTP Wizard.pch’ unexpected precompiled header error, simply rerunning the compiler might fix this problem    d:\SSI\C++\v3\HTTP Wizard v3\HTTPAccess.cpp    5    HTTP Wizard

So I rebuilt and rebuilt. No avail. I turned off Precompiled headers and then everything worked fine. What a pain.

It turned out the reason is due to the virtual tables being rebased by Windows 7 for security which totally screws up the precompiled header logic, which requires the headers to be in the same memory locations.

Apparently the development team at Microsoft knows about the issue and will eventually fix it. So, lets hope that service pack comes out soon.

I guess I am lucky my build machine is really beefy, but for active development having the precompiled header is nice.

So, go have a Margarita and the  compiler errors won’t bother you as much…..

, , , , , ,

No Comments

ASP.NET State server won’t start on Windows 7 64 bit. File is missing?

I went to launch my state server for ASP.NET to handle my local sites state information, in preparation for production, and the service just wouldn’t play nice. I tried to start it and it says the file doesn’t even exist.

Good times, right? So I went into the registry to see where it was pointing..%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\aspnet_state.exe  (Yes, the path is visible on the service control properties as well)

I checked the disk and surprise surprise, it actually wasn’t there. However, there is this suspiciously obvious looking folder called Framework64. AHAH! You look in there and voila! It is in there.

Looks like the framework installer sucks. So I fixed the key and it magically started working. Amazing how when you point to the actual file it works,eh?

The fix is to change this:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\aspnet_state
key: ImagePath
%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\aspnet_state.exe
to this:
%SystemRoot%\Microsoft.NET\Framework64\v2.0.50727\aspnet_state.exe

Happy coding!

, , , ,

8 Comments

What is the Visual Studio 2008 resolve using hotkey/shortcut..

I hate manually typing the using statements at the top of my classes so I invariable just type the class/object name for the type I want to use then use the Visual Studio resolve function. Right click -> Resolve.

Well, its a real pain to move to the mouse to resolve when I am typing away. So I finally got off my laurels and looked up the keyboard shortcut.

Here is the magic: CTRL + .

That’s right, CONTROL PERIOD. <insert female joke here ;) >

Hope this saves you a few clicks.

, , ,

1 Comment

Where did that Visual Studio 2008 menu go….

So I was working in Visual Studio had a hankering for debugging an already running process. Easy right? Debug -> Attach to Process. Well, it’s not so easy to do when the menu option dissapears. I pulled up my Debug menu and it had 4 options. Windows, Start,Step Over, Step Into. Hmmm.. missing something there right.

Well, after pulling a few hairs out I figured out how to get my Attach to Process option back.

Its painful but effective. Tools -> Import and Export Settings. Reset to Visual Studio default. Pick the best generic settings and finish the wizard.

All your menus will be back to normal. You just lose all of your keyboard shortcuts and custom settings you painstakingly setup.

, , ,

No Comments