visual-studio

How to measure developer build time...

I wanted to write a small app that would sit in my taskbar and monitor what Visual Studio was doing all day. Specifically, what I really want to figure out is how long I spend waiting on Visual Studio to build my solution each day. Could someone point me in the right direction. Is there something in the Visual Studio SDK that would he...

Is there any way to identify if it is a test or not (.NET)?

I want that my application catches the exceptions and e-mail them when running in production, but when I am running my MSTest unit tests I want it to throw the exceptions, so I can debug. My current code always e-mails the exceptions. There is any way to know if the current process was invoked by the unit tests? One way I can think is t...

How to add ProjectItem element in a VS project template that references a file that does not exist in the template?

How do I define a Visual Studio project template such that the include attribute references a non-existent file? That is, the file will exist once the resulting csproj is in place. But the file does not exist within the vs template zip. I have this: <ProjectItem ReplaceParameters="True" TargetFileName="..\GlobalVersionInfo.cs"> <...

ASP.NET: Execute MSBuild tasks after publishing

I have an ASP.NET project. There is a 'Publish...' option in the context menu of the project (Visual Studio 2008). Can I add some custom MSBuild tasks that will be performed each time after publishing? If not, what is the best way to write MSBuild script that will publish the project (the same way as 'Publish...' option) and then execu...

HttpContext.Current.User.Identity.Name is Empty

I have a silverlight application (using MVC) and when i'm building in visual studio, using Visual Studio Development center, there's no problem, the HttpContext.Current.User.Identity.Name has a Value But when i'm using the same project with IIS 7.5 (i'm using Windows 7), HttpContext.Current.User.Identity.Name stays empty Anyone who can...

Web Deployment Projects, Web Application Projects and Team Build 2008

I've switched from a Website Project to a WAP (Web Application project). The WDP (Web Deployment Project) is used to set and potentially in the future make other web.config changes. However I notice that the team build is building everything twice, once on behalf of the solution file and then again because of the WDP. Any idea how I c...

How can I qualify a .NET type with assembly name for Visual Studio debugger to disambiguate while using an ambiguous type?

I am using the VS debuggers 'Immediate Window' to call a static API on a class which is an ambiguous type defined in 2 different assemblies. The call fails with the following message: The type exists in both and This message makes sense since this is indeed the case. My question is how can I work around this in the debugger to speci...

what is the most unobtrusive way of using precompiled headers in Visual C++?

Say I have a single project, with files A.cpp, B.cpp, C.ppp and matching header files (and that's it). The C++ files include system headers or headers from other modules. I want to compile them to a library with command line actions (e.g., using Make), using 'cl', with the precompiled headers feature. What are the steps I should do? Wh...

Cannot save database project: *.dbp file in Visual Studio

I have a database project (.dbp) open in Visual Studio 2008 as part of a solution. I've added a new sql script to the project. When I try to save the database project so that I can check it in, VS shows me a dialog: Some Unicode characters in this file could not be saved. To save all the information in this file, use 'Save As'; and ...

Any way to get Visual Studio to save the file before running an external tool?

I've have a couple of external tools set up to run Doxygen for me, either on the currently displayed file, or the currently active project. What's annoying is, there doesn't seem to be an option anywhere to save the file before running the tool. So I'll hammer in some Doxygen blocks, hit the hotkey to run Doxygen, flip over to Firefox ...

Visual Studio 2005 hangs when opening markup files

I'm working on a web application project in Visual Studio 2005 and as of the last day or two every time I open any markup file (ascx, aspx, etc) Visual Studio hangs and never recovers. If you try to click anything in the UI - code, menus, close window 'X' - I get the tray icon telling me that Visual Studio is busy and to continue waiting...

<Subtype>Designer</Subtype> Added then removed by Visual Studio on load/unload

Anyone see this before? I have a large Visual Studio project that keeps adding [Subtype] Designer[/Subtype] to my .vcproj then removing it on the next open and close of the project. There is only one class defined in StoredImageControl.cs. Anyone know how to shut this off as it is really messing up my revision control. This is befor...

Shared "SQL Server 2005 Server Project" in Visual Studio 2008 Database Edition GDR 2

Hi after toying around with SQL Server 2005 Database projects, I have been pointed to the Visual Studio 2008 Database Edition GDR 2 extension (by our Microsoft rep), which allows for the creation of "SQL Server 2005 Server Project" projects. As far as I understand it, this lets you create a project with all the shared objects (logins b...

How to persist custom objects between calls to a Visual Studio debugger visualizer?

I need to persist an object between calls to a debugger visualizer I'm writing, but it doesn't need to persist between IDE sessions. The EnvDTE.Globals object for the IDE seemed like an obvious place to store this object. If the type of the object being stored is already loaded in the IDE, e.g. a list of integers, I can successfully s...

Want to revert back 3 revisions, how?

Let's say I have a user's object, I deleted a property and all things in the web project that used this property (admin pages that updated the property, data layer etc etc). Now I was told that we need that property, looking at Subversions log it seems the correct code is 3 revisions back. How can I go back, then somehow get any update...

Use a single Visual Studio solution to build both x86 and x64 at the same time?

I've got an x86 Visual Studio solution with many project files in it. Some of the DLLs are designed to work as plug-ins to other applications on a user's system. We're expanding some of the DLLs to be able to support 64-bit applications. What I'd like to do is setup the solution/projects so that just hitting "Build" will build both th...

Adding reference to correct version of IBM.Data.Informix library

When I go to reference the Informix client libraries for .NET in Visual Studio (Website->Add Reference) they show up as IBM.Data.Informix (version: 2.81.0.0; Runtime: v1.1.4322; Path: C:...\Client-SDK\bin\netf11\IBM.Data.Informix.dll) This actually works, but after running into some trouble loading my application on the production serve...

The "abc" parameter is missing a value

I'm having problems with a SQL Reporting Services 2005 report prompting for a parameter value, which is set as a list of values from a query. When navigating to the report directly, or using a "jump to hyperlink" and specifying the reports url, it works fine. However when it's accessed via a link from another report using "jump to repo...

How can I reorder sub-expressions in Visual Studio?

I would like to re-order sub expressions in an if statement. Here is an example: Input: if ((a == 1) || (a == 3) || (a == 2)) { } Desired output: if ((a == 1) || (a == 2) || (a == 3)) { } Is there any tool that can automatically reorder these sub expressions? Or the following identical code: Input: switch (a) { case: 1; ...

Is there a way to tell if all validators have been satisfied?

OnclientClick of a button I hide a panel client side. I only want to hide it however if all input is valid. Is this possible in Javascript? ...