visual-studio-2010

How to change a file which is too large (got warning from StyleCop)?

I am recieving warning about my file by StyleCop. Warning 1 CR0005: The file is very long at 508 lines. Please consider refactoring to make it 500 or fewer lines. Warning 2 CR0002: Method is too long. It is 58 lines long. Consider refactoring to make it 50 or fewer lines. How are you guys making changes to your codes? What are...

R/C++ Interface

How to use RCPP_MODULE(yada) in C++. My C++ program gives error if I use const char* hello( std::string who ){ std::string result( "hello " ) ; result += who ; return result.c_str() ; } RCPP_MODULE(yada) { using namespace std; function( "hello", &hello ) ; }; Error are: 1. Error 1 error C2065: 'yada' : undeclared identifier 2. Error ...

Why does Resharper rename variables to start with an underscore?

I've never understood this, and frankly, it pisses me off to see it in code: variable names that begin with an underscore. What is the point of this? I've just installed Resharper 5.1, trying it out and it seems nice, though this one thing is ruining it for me. I haven't checked, but I'm hoping I can turn it off. But why is it done in...

Unit-test passes in Debug, but hangs when Run

I have an odd problem. I have a unit test that keeps getting stuck in Run Mode. When I run the same test in Debug, with no breakpoints, the test passes every time. Basically, it is a socket connection test. I first disconnect a socket, and then try to reconnect, and I am trying to check if the reconnection was successful. Somewhere in...

VS2010 Debugger Not Responding

I am working on a large website that is comprised of multiple applications. We are still using web forms. All of the applications are in a common directory that serves as the root directory in my localhost. The site was originally built in 2005 on 3.5 but has been migrated to 2010 still running on 3.5 (2.0). My problem is that my debugge...

How to cover exceptions in Visual Studio Code Coverage

I am new to code-coverage, and I am trying to get my unit tests to cover %100 of my code. My first question is, is this possible/feasible? My second, more specific question is, I have the following method: /// <summary> /// Clears frames, control groups, display groups /// </summary> public bool Clear() { try { this.Fr...

silverlight 4 error in .xaml

Hi I have the following code: <navigation:Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" ...

What am I missing that is making sql deploy not work?

Hi I am trying to use the package/publish sql in VS 2010. So I went through this tutorial http://msdn.microsoft.com/query/dev10.query?appId=Dev10IDEF1&amp;l=EN-US&amp;k=k%28WEBAPPLICATIONPROJECTS.DEPLOYSQLWALKTHROUGH%29;k%28TargetFrameworkMoniker-%22.NETFRAMEWORK%2cVERSION%3dV4.0%22%29&amp;rd=true I imported the connection string from...

IIS 7 ASP.Net 4 - Code Behind Auto Compile Not Working

I fired up my first asp.net 4 app put together with visual studio 2010 and IIS doesn't seem to compile my code behinds on the fly for some reason, I have to build the site manually. How do I configure my app to compile code behinds on the fly? I looked around but I must be missing something. Never had this issue before. Thanks all, b...

Visual Studio 2010 locks up when running unit tests

I'm running MSTest unit tests in VS2010 and whenever I do the VS IDE locks us and goes to '(Not Responding)' if I try to click on it anywhere. The tests run fine on other people's computers with the same OS (Win7) and the same version of VS2010, has anyone run across this before? Any idea how to debug this? Update: Should mention, I ca...

Is it possible to create a dependency graph using the architecture explorer?

VS2010 has got an option in the Architecture menu called "Create dependency graph". It works great except it seems to be all or nothing - all solution items end up in that graph and its very slow for our large solution. I want to create a dependency graph by class, whose root is only a single class that I specify. Is it possible to cr...

How to use Mercurial from Visual Studio 2010?

Version Control noob alert I've already installed both Mercurial, TortoiseHg and VisualHG into Visual Studio 2010. I've set in Visual Studio my source control to Mercurial. When I right click on my solution, I already see HG's buttons in the context menu that appears there. My question now is, how do I make this version control thing...

Refactor a C# Class

I'm currently working on a local application, which has access to a SQL Server 2008 Express. What I did was create a Class that manages all the access and actions over the database (e.g. INSERT,DELETE,etc) but the class is growing really large, and has at least 40 methods. So my question was: Is there a way to refactor this kind of class...

VS2010 C code - String pooling

Hi, Below code crash in VS 2010 when you compile with following flag and if you add /GF- or remove the opimization flag they don't crash. The crash occur at assembly code which translate 'if( path[i] == '/' )'. I like to understand the optimization that compiler does here and lead to crash. Looking forward for some pointers. -Karthik ...

Adding F# to Visual Studio 2010 C# express - is it possible?

Hi, My question relates to: http://stackoverflow.com/questions/977132/will-there-be-a-f-express-edition Given there is no VS 2010 F# express - I would like to know what the latest wisdom is for installing F# onto VS 2010 C# express. Is it possible at all? Thanks. ...

Editing a style (Generic.XAML) with Visual Studio...

...any support for EDITORS? Or do I have to open the solution in Blend for being able to do some editing in a design surface? ;) ...

How to suppress a StyleCop warning?

I'm using StyleCop and want to suppress some warning which does not suit my style. I prefer to have solution for 1) in-line code suppressing and 2) global setting suppressing . I've searched the internet but still not sure how to do the suppressing. For method 1), They said to add the lines [assembly: SuppressMessage("Microsoft.Design"...

C# project 2010, standalone executable on other computer

Hi All, I have a C# project that I have created in Visual Studio Express 2010. This program uses a 3rd party C# class that relies on/calls a C++ dll. I just copied the filename.dll into the bin/debug and bin/release folders of the project folder, and the application ran fine. I am under the assumption that I can copy the release execut...

"Source" parameter of the "MIDL" task. Multiple items cannot be passed into a parameter of type "Microsoft.Build.Framework.ITaskItem".

Hi All I am trying to migrate one of projects earlier in VS2008 to VS2010. On building I get the following error C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(317,7): error MSB4094: "hdxBinding.idl;hdxBlinking.idl;HDXCommandObject.idl;hdxds.idl;HSCProcessStatus.idl;HSCSelectableWindow.idl" is an invalid value f...

How to supress StyleCop warning "SA1201: All methods must be placed after all properties." ?

I'm writing a group of methods which are a mix of private/public and need to put into the same region (using #region). I used method mentioned in here but I can not get this warning supressed. Please help. [Edit] I need to supress this particular warning only - not for the whole project/solution. But I'm willing to know how to do that ^...