visual-studio-2010

Tutorial for Unit Testing with VS 2010

Hi I am new in unit testing and need some book or tutorial. I have looked alot in google, but can't find anything. I saw this question, but there is no answer, that's why I am asking it too. Is there anything from which I can start? Thanks. ...

Yet another C# Deadlock Debugging Question

Hi All, I have a multi-threaded application build in C# using VS2010 Professional. It's quite a large application and we've experienced the classing GUI cross-threading and deadlock issues before, but in the past month we've noticed the appears to lock up when left idle for around 20-30 minutes. The application is irresponsive and alth...

How to export Visual Studio 2010 extensions

Hi all. I want to reinstall my Windows 7 and how can i export extensions from VS 2010 ? And after reinstaling import them? Is it possible ? I have lot of ext. will by easy way how to install them after VS reinstall. Thanks ...

How do I get Visual Studio 2010 to open in the same layout/state it was in before I closed it?

This is a simple question, but one that I can't seem to find an answer to. At work I have VS 2010 on a Windows 7 machine with 3 monitors. I also have nvidia's 'nView' and UltraMon to utilize my 3 monitors. What happens is when I open VS 2010 it opens as not maximized, but is fit to one monitor. This compacts everything in the VS window...

TryCast fails where DirectCast works (.NET 4.0)

Hi, I find this behavior of TryCast in .NET 4.0 / VS 2010 rather confusing. In my understanding TryCast works like DirectCast, but will return Nothing instead of throwing an exception if a conversion is not possible. VS 2010 / .NET 4 ?TryCast(CType(1, Object), String) Nothing ?DirectCast(CType(1, Object), String) "1" VS 2008 / .NET...

Where would I start if I want to create a code generator for Visual Studio 2010?

I use the repository pattern for pretty much all of my projects. I have a .edmx/.dbml file that has my database tables referenced, and then for each table I create a 'Tablename'Repository.cs Each of these classes have the same methods with only the type of table being called being changed. public IQueryable<Area> FindAll() public IQuer...

Visual Studio 2010 crashes when trying to set CssClass property

Many times when I'm editing a .aspx file and type CssClass=, the Visual Studio IDE hangs then crashes with option to restart. Clearly this is happening while VS is trying to populate the Intellisense with available classes. Nine times out of ten I already know what class I want. Is there a way to disable Intellisense just on CSS classes?...

Editing ASPX in Visual Studio 2010

I have recently upgraded from Visual Studio 2005 to Visual Studio 2010 (and also moved from Windows XP 32 bit to Windows 7 64 bit). Whenever I edit an ASPX file in my project VS2010 throws an exception: "A first chance exception of type 'System.InvalidOperationException' occurred in System.Web.dll Additional information: Operation is n...

parallel.for question

I have a foreach loop that processes a few thousand xmlnodes from an xmlnodelist. I'm trying to integrate the Parallel.For options from .net 4 but I get an error that "No overload for method 'For' takes 3 arguments'. But every example I see so far has it written this way. Does someone know what I need to change to get this to compile?...

Force Resharper to open designer when navigating with CTRL+SHIFT+T

When I press CTRL+SHIFT+T dialog for file search pops up, I find file I'm interested in, and when I press Enter - if file is .resx or .dbml - it's opens in text editor. Can I force Resharper to open file in whatever editor is used by default (same as when I double click on file in Solution Explorer)? ...

How can I avoid the Visual Studio 2010 message "(Build Only Project) which is not currently available"?

I've bound the key combination Ctrl+B, Ctrl+B to the Build Only Project command. I have a solution with a web application, several business layer dlls, and several Silverlight projects. I want to build the Silverlight project I'm working in with the key stroke to avoid building everything everytime. I'm growing tired of having to right c...

How to configure subsonic 3.0.0.4 using mysql with Visual Studio 2010?

I downloaded subsonic 3.0.0.4 and i am trying now to configure it to work with mysql and Visual studio 2010. My project is .net 3.5 and i am creating a data access layer class library to use later in a website. I can't figure which files i should add to my project and where to edit. Last step i reached is in this screen shot: ...

IIS, Visual Studio 2010: How to exclude files from being in my IIS folder?

I have a Visual Studio solution that is linked to an IIS Virtual Directory. Is there any way to exclude files/folders from my solution from showing up in the IIS Virtual Directory? Oh, and currently I'm running IISV5.1, but on the deployed server it'll probably be IIS6 or II7. Also, to that point... are there any files/folders that ARE ...

How to check programmatically that Debug and Release builds of VS2010 use the exact same configuration?

We have a Visual Studio 2010 solution, with C#/C++/VB.Net as well as other projects. It is not MsBuild-based. My co-workers and I mostly work with Debug build, and Release is rarely used, but is used indeed (say that there is a Release-only bug; those do pop-up from time to time.) The nightly builds follow their own separate process, a...

VS10 "Additional Include Directories" Point to VS9 Includes

I installed VS10 side-by-side with VS9 and created a very simple application using it: #include <cstdlib> #include <vector> #include <algorithm> using namespace std; class A { }; class B : public A { }; A* get_a() { return new B; } int main() { vector<A*> a_list; vector<B*> b_list; generate_n(back_inserter(a_list), 10, g...

Why is build action: None ignored for a *.cs file?

In a project I have a bad file, and I'd like to keep it. I know, I can use "Exclude from project", but this hides the file (in VS 2010, in VS 2008, it was still visible). But instead, I clicked, under properties, Build Action: None. When I compile, the project compiles, but when I look in the error list, it still shows the errors of this...

Visual Studio 2010 hangs up when opening a .sql file

I may have an unstable development environment and I need to figure out what might be causing the problem. I launch VS 2010, and simply open any ordinary (or blank) .sql file and it shows up incorrectly drawn inside the IDE. It draws the document tab, but nothing else. If I type on the keyboard at that point, VS locks up. This only ...

Visual Studio 2010 Macro to delete SQL files from a database project

I've discovered that in Visual Studio 2010 Professional it is possible to refresh the database for a SQL Server Database Project (This feature is normally only available to the Premium and Ultimate versions). All you need to do is delete all the SQL files from the "Schema Objects" folder (but leave the folder structure intact) and the "...

Remove Styles Not Used In Resource Dictionary

I have a pretty large resource dictionary and I was wondering if there was an easy way to clean it up by removing any unused element (style, brushes, etc) ...

Find in files is slow when targeting a solution

My VS 2010 solutions has two projects in it. When I use the "Find in Files" dialog and search for a string in any of the individual projects I get the results back instantly, if I target the solution, there is a 2 second delay. Does anybody know what else VS is doing when searching in a solution (besides searching the 2 projects)? ...