visual-studio-2010

Visual Studio 2010 indentation after for loop.

Why am I getting this behavior right after the if block? Am I missing something? for (;;) if (/*...*/) { // statements } // statements indented to match the if indentation instead of the for loop; ...

How to maximize Visual Studio panels?

Is there a way to quickly maximize (and then restore) Visual Studio 2010 panels? For instance, I'd like to temporarily maximize the Output window or unit test results window. In Eclipse, I would just double-click the window tab but in VS, this undocks the window. The desired behavior is: double-click to maximize the window, then double-...

What is the scope order of .config files

Somehow I screwed with my IIS7 settings, and VS2010 doesn't want to start websites in debugging mode. I spent a few hours convulsively scavenging before I found a solution. It just needed to put into web.config <system.webServer> <validation validateIntegratedModeConfiguration="false" /> </system.webServer> Now, I'd like to put that...

VS2010 Keyboard Shortcut - Show ToolTip

Hi Question: How to display the mouse hover over tooltip in VS2010 using a keyboard shortcut? Ctrl Shift Space gives some detail on overloads.. Cheers Dave public ActionResult About() { return View(); } ...

Get controller name in View T4 template

I have a problem similar to the one described here: http://stackoverflow.com/questions/1128003/mvc-t4-mvctexttemplatehost-and-customized-controller-t4-template but hopefully, simpler. I have a custom View templates (View.tt, Create.tt) for ASP.NET MVC project. I can't figure out how to get the controller name in these view templates. mv...

Why can't I get Win32_UninterruptiblePowerSupply to work?

I have some simple code: ManagementObjectSearcher searcher = new ManagementObjectSearcher("select * from Win32_UninterruptiblePowerSupply"); ManagementObjectCollection items = searcher.Get(); foreach (ManagementObject item in items) { // Some code here... } The "items" object is semi-null. It's actually an object, but a cal...

Unit tests in Visual Studio 2010 will not run because "No agents are marked..."

With VS 2010 I generated some unit tests for some properties on a partial class. They fail to run with the following error message: "Failed to queue test run 'yvx7xcy@MDROAWKS0379 2010-06-23 18:21:08': Test run 'yvx7xcy@MDROAWKS0379 2010-06-23 18:21:08' could not be executed. No agents are marked online to execute test ru...

How to filter a query result?

Currently I can not quickly filter the result of a work-item query - running a query will give us a result table and within this table, there's no mean to filter the table rows to display just the ones containing some certain text. Do you know how to filter that or have any addons/tools suggestion for that? Thank you. Nam. ...

Why I can only see "??" at any address before 0x70000 in Visual Studio Debug Memeory window?

I am debuging with Visual Studio 2010. I want to see the raw memory bytes in the Debug Memory window. But I noticed that before 0x70000, the memory content is not shown, only a "??" mark for each byt. Why can't I see the content? ...

Using Mercurial with Visual Studio 2010

I am currently using Mercurial via Tortoise Hg for some of my side projects. I was wondering if there is tighter integration of Mercurial with Visual Studio 2010 via a plugin or some similar mechanism. What I'm thinking about is very similar to the git extensions which provide a plugin for VS. The plan is to eventually host the projects ...

Unit tests in VS2010 (solution in release mode)

Hi there, I am trying to run my unit tests (Test->Debug->Tests in current solution) in VS 2010. The solution is built in Release mode. When I try to do that, VS is crashing. Do you have any ideas? Cheers ...

VS2010 "Copy to output directory" not working?

I'm trying to publish my web solution to the file system, using the "Only files needed to run this appllication" option. I have the following problems: a) I have a connectionStrings.config file that should be included; I've marked this file as Content and Copy Always. b) For testing purposes, I've added a textfile.txt that should not ...

Which C# assembly contains Invoke?

Alternate question: Why is VS10 so keen to complain about Invoke? In my continuing quest to make my app work become the worlds best C# programmer, I have decided that threads are a Good Thing™. MSDN has a helpful article on making thread-safe calls to controls, but it (and seemingly every other article on the subject) obliquely referen...

In Visual Studio 2010, is there a way to easily comment out lines in CSS?

Does anybody know if there is a way in Visual Studio 2010 to highlight and comment out lines in CSS files like you can with all other files (by clicking a button)? Perhaps a Visual Studio extension? Commenting them manually is cumbersome. ...

How can you link to a different version of MFC from a Visual C++ project in Visual Studio 2010?

I have a VC++ project in VS2010 that is linking to some dll's built with VS2008. Works fine until I try to pass MFC objects to the VS2008 dll. The artifact of the VS2010 VC++ project (a .dll) is linking against the latest version of MFC that shipped with VS2010, whereas the VS2008 .dll is linking against the previous version of MFC tha...

How do I setup IIS when debugging in Visual Studio 2010?

In Visual Studio 2010 I have created a WebService (WCF) Application and a client to consume said service. My 3 options as far as what servers to use for debugging are: Visual Studio Development Server, Local IIS Web Server, Custom Web Server. I know I can't use the VS Development Server if I want my service to be accessible outside of ...

VS2010 F# Smart Tag to add open import declarations

EDITS corrected terminology from Intellisense to Smart Tag OK, I readily admit that Intellisense/Smart Tags have spoiled me. I've grown accustomed C# in Visual Studio notifying you to add using import declarations when typing in a class name for a namespace that has not yet been imported. You get the nice little colored underscore whi...

How do I configure Qt to work with Visual Studio 2010?

I downloaded open-source version of Qt from the site and have compiled it with nmake, but I'm having trouble using it in my projects. It seems that Visual Studio can't find the Qt headers, even though I added the paths to my PATH, INCLUDE, and LIB variables. I tried installing the Qt Visual Studio add-in but it only supports Visual Studi...

Debugging a Web Setup custom action

Other forum posts suggest that you put a Debugger.Break call or a MessageBox.Show call into the custom action code, then attach the VS debugger to the process when the interrupt occurs in the Setup execution. Neither of these has worked for me. Setup runs to completion without the interrupt. (Using VS2010). I'm at a loss. Thanks for...

Custom solution configuration not showing up in Visual Studio 2010

I added a solution configuration called 'Staging'. It does show up on the drop down in VS, but not in the Configuration Manager in 'Package/Publish Web' screen. On this screen, the ones I see in the dropdown are: Active (Release) Debug Release All Configurations I don't see Staging in here for me to package in the Staging mode ...