Questions tagged [visual-studio-2010]
Visual Studio 2010 is an integrated development environment (IDE) from Microsoft. Use this tag only for questions arising from the use of this particular version of Visual Studio, and not about any code just written in it.
visual-studio-2010
46,586
questions
1673
votes
7
answers
164k
views
Why does changing 0.1f to 0 slow down performance by 10x?
Why does this bit of code,
const float x[16] = { 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8,
1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6};
const float z[...
1192
votes
7
answers
708k
views
push_back vs emplace_back
I'm a bit confused regarding the difference between push_back and emplace_back.
void emplace_back(Type&& _Val);
void push_back(const Type& _Val);
void push_back(Type&& _Val);
As ...
767
votes
12
answers
935k
views
Writing to output window of Visual Studio
I am trying to write a message to the output window for debugging purposes. I searched for a function like Java's system.out.println(""). I tried Debug.Write, Console.Write, and Trace.Write. It does ...
734
votes
10
answers
431k
views
Interop type cannot be embedded
I am creating a web application on the .NET 4.0 framework (beta2) in C#.
When I try to use a assembly called "ActiveHomeScriptLib", I get the following error:
Interop type
'ActiveHomeScriptLib....
577
votes
19
answers
385k
views
How do I run Visual Studio as an administrator by default?
I recently discovered that even while logged into my personal laptop as an administrator, Visual Studio does not run in administrator mode and you need to explicitly use Run As Administrator.
Is ...
566
votes
5
answers
541k
views
What is "stdafx.h" used for in Visual Studio?
A file named stdafx.h is automatically generated when I start a project in Visual Studio 2010. I need to make a cross-platform C++ library, so I don't/can't use this header file.
What is stdafx.h ...
540
votes
25
answers
824k
views
Error 'LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt' after installing Visual Studio 2012 Release Preview
I've installed Visual Studio 2012 Release Preview, and it appears to be fine, but now when I try to use Visual Studio 2010 to compile C++ projects, I get the following error message:
LINK : fatal ...
533
votes
13
answers
836k
views
Is there a format code shortcut for Visual Studio?
In Eclipse there is a shortcut, Ctrl+Shift+F, that re-indents code and fixes comments and blank lines. Is there an equivalent for Visual Studio 2010?
532
votes
16
answers
1.1m
views
The type or namespace name could not be found [duplicate]
I have a C# solution with several projects in Visual Studio 2010.
One is a test project (I'll call it "PrjTest"), the other is a Windows Forms Application project (I'll call it "PrjForm"). There is ...
523
votes
54
answers
414k
views
The name 'InitializeComponent' does not exist in the current context
If I create a new project in Visual Studio 2010 SP1 and select "WPF Application" and tries to build the generated application, I get the error
The name 'InitializeComponent' does not exist in the ...
439
votes
26
answers
334k
views
This project references NuGet package(s) that are missing on this computer
I have an ASP.NET MVC5 application that worked yesterday and now I am getting this error when I try to build:
This project references NuGet package(s) that are missing on this computer.
I have the ...
416
votes
27
answers
256k
views
Cannot import the keyfile 'blah.pfx' - error 'The keyfile may be password protected'
We just upgraded our Visual Studio 2008 projects to Visual Studio 2010. All of our assemblies were strong signed using a Verisign code signing certificate. Since the upgrade we continuously get the ...
382
votes
3
answers
162k
views
Running two projects at once in Visual Studio
I created a solution in Visual C# 2010 Express that contains two projects: one is the client, the other is the server. I would like to debug both at the same time, but I can only seem to run one of ...
379
votes
13
answers
279k
views
How to use Boost in Visual Studio 2010
What is a good step by step explanation on how to use the Boost library in an empty project in Visual Studio?
366
votes
17
answers
657k
views
Type or namespace name does not exist [closed]
I have a WCF Data Service project built with Visual Studio 2010, which was working fine. All of a sudden, it didn't compile anymore. It was giving me messages like:
Error 7 The type or namespace ...
336
votes
6
answers
131k
views
How to Turn Off Showing Whitespace Characters in Visual Studio IDE
I don't know what I did but I don't know how to get rid of those arrows on the left.
332
votes
11
answers
175k
views
Visual Studio: How to show Overloads in IntelliSense?
Once code has been written, the only way I know of to view the overloads for a method is to actually edit the method by deleting the Parenthesis () and reopening them.
Is there a shortcut key that I ...
326
votes
15
answers
222k
views
How do I cancel a build that is in progress in Visual Studio?
Almost unconsciously I hit the keyboard build macro that builds my entire solution. This can happen just as I notice a code change. The build dominates my computer, and I basically have to wait till ...
313
votes
9
answers
64k
views
Is std::unique_ptr<T> required to know the full definition of T?
I have some code in a header that looks like this:
#include <memory>
class Thing;
class MyClass
{
std::unique_ptr< Thing > my_thing;
};
If I include this header in a cpp that does ...
312
votes
14
answers
153k
views
Auto select file in Solution Explorer from its open tab
Normally, many files in Visual Studio 2010 are opened in many tabs, while massively working on a project. Many times, I find myself right-clicking on a tab title and searching for Show/...
306
votes
14
answers
131k
views
How to debug a single thread in Visual Studio?
I have a solution with some projects. There are several break-points in different projects. I want to trace the first thread hit one of these break-points and continue tracing that single thread ...
301
votes
37
answers
103k
views
Visual Studio 2010 - recommended extensions [closed]
What are your recommended extensions for Visual Studio 2010?
(Please indicate if its free or not And also its purpose / function too)
296
votes
17
answers
187k
views
Cannot obtain value of local or argument as it is not available at this instruction pointer, possibly because it has been optimized away
Visual Studio 2010 kills (there is no other word) data in one of the arguments of the function in the unsafe block.
What could cause this error? The following message shows by the debugger.
Cannot ...
264
votes
49
answers
274k
views
Unable to load DLL 'SQLite.Interop.dll'
Periodically I am getting the following exception:
Unable to load DLL 'SQLite.Interop.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
I am using 1.0.82.0. version,...
261
votes
7
answers
53k
views
Visual Studio Clicking Find Results Opens Code in Wrong Window
I'm using Visual Studio 2010 and when I do a "Find in Files" the results are returned to the "Find Results 1" window which is docked below my code editor window.
Before, I would double click on one ...
258
votes
29
answers
389k
views
Configuration System Failed to Initialize
I'm currently creating a Login form and have this code:
string connectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
try
{
using (OdbcConnection ...
254
votes
10
answers
160k
views
IIS Express Windows Authentication
I'm trying to use IIS Express with VS2010 to host a silverlight application. I modified my applicationhost.config file to allow for modification of the proper configuration settings. I have the ...
250
votes
8
answers
143k
views
Visual Studio Disabling Missing XML Comment Warning
I have a project with over 500 Missing XML Comment warnings. I know I can remove the XML Comment feature, or paste empty comment snippets everywhere, but I'd prefer a generic solution where I can ...
247
votes
7
answers
89k
views
See all breakpoints in Visual Studio 2010+
Is there a window in Visual Studio 2010 and newer where I can see all the breakpoints that I have in my project or solution?
247
votes
20
answers
235k
views
Dependent DLL is not getting copied to the build output folder in Visual Studio
I have a visual studio solution.
I have many projects in the solution.
There is one main project which acts as the start up and uses other projects.
There is one project say "ProjectX". Its reference ...
236
votes
13
answers
274k
views
How to Publish Web with msbuild?
Visual Studio 2010 has a Publish command that allows you to publish your Web Application Project to a file system location. I'd like to do this on my TeamCity build server, so I need to do it with the ...
234
votes
7
answers
151k
views
How to compare Lists in Unit Testing
How can this test fail?
[TestMethod]
public void Get_Code()
{
var expected = new List<int>();
expected.AddRange(new [] { 100, 400, 200, 900, 2300, 1900 });
var actual = new List<...
233
votes
12
answers
230k
views
“Unable to find manifest signing certificate in the certificate store” - even when add new key
I cannot build projects with a strong name key signing - the message in the title always comes up.
Yes the project was initially copied over from another machine. However even if I add a new key via ...
232
votes
13
answers
111k
views
Is there a way to delete a line in Visual Studio without cutting it?
I want to delete a line just like hitting Ctrl + X without anything selected, but without saving the line to the copy stack. Is this possible?
I'm using Visual Studio 2010.
223
votes
5
answers
90k
views
Visual Studio 2010 - C++ project - remove *.sdf file
I would like to know if I can safely delete the sdf file that stores information for Visual Studios Intellisense - is it going to be rebuilt the next time that I open the solution?
Do I lose anything ...
222
votes
21
answers
1.3m
views
How to find server name of SQL Server Management Studio
I installed Microsoft SQL Server 2008.
When I start SQL Server Management Studio (SSMS), I get the Connect to Server login window with a blank textbox for Server name. I have tried a lot of names, ...
221
votes
23
answers
387k
views
Why doesn't Console.Writeline, Console.Write work in Visual Studio Express?
I just open a console application and I type
Console.WriteLine("Test");
But the output window doesn't show this. I go to the output window with Ctrl + W, O.
But nothing shows up when I run ...
219
votes
4
answers
241k
views
Using data member in lambda capture list inside a member function
The following code compiles with gcc 4.5.1 but not with VS2010 SP1:
#include <iostream>
#include <vector>
#include <map>
#include <utility>
#include <set>
#include <...
209
votes
19
answers
94k
views
Is there a way to quickly find files in Visual Studio 2010?
Does Visual Studio 2010 have a built-in way to quickly find/open files, similar to the Ctrl+Shift+O function in Eclipse?
Or does ReSharper offer this functionality?
204
votes
15
answers
103k
views
How to locate a file in Solution Explorer in Visual Studio 2010?
I have a huge solution with multiple projects. Sometime I need to navigate to a file in Solution Explorer. Using the VS 2010 'Navigate To' feature I can open any file by name in Visual Studio 2010 but ...
204
votes
13
answers
116k
views
UTF-8 without BOM
I have javascript files that I need them to be saved in UTF-8 (without BOM), every time I convert them to the correct format in Notepad++, they are reverted back to UTF-8 with BOM when I open them in ...
200
votes
7
answers
94k
views
How do I install a NuGet package into the second project in a solution?
I'm currently working on a solution that initially contained one project (My.First.Project.Name). I've installed Castle Windsor by executing:
Install-Package Castle.Windsor
I've just added another ...
199
votes
13
answers
219k
views
Asp.net 4.0 has not been registered
When I try to open my Visual Studio project I get the following error:
Asp.Net has not been registered on the webserver you need to manually configure your webserver for Asp.net 4.0.
Update:
...
198
votes
18
answers
128k
views
Copy object values in Visual Studio debug mode
In Visual Studio debug mode it's possible to hover over variables to show their value and then right-click to "Copy", "Copy Expression" or "Copy Value".
In case the variable is an object and not just ...
198
votes
10
answers
175k
views
Visual Studio 2010 shortcut to find classes and methods?
Is there any shortcut in Visual studio 2010 to find classes/interfaces?
I was using Resharper few years back to do that. Here now, I don't have the Resharper and looking something similar in Visual ...
197
votes
30
answers
141k
views
Visual Studio 2010 always thinks project is out of date, but nothing has changed
I have a very similar problem as described here.
I also upgraded a mixed solution of C++/CLI and C# projects from Visual Studio 2008 to Visual Studio 2010. And now in Visual ...
197
votes
14
answers
154k
views
Visual Studio: How to "Copy to Output Directory" without copying the folder structure?
I have a few dll files in \lib folder of my project folder. In the property page of dll, I have selected "Build Action" as "Content" and "Copy to Output Directory" as &...
197
votes
13
answers
204k
views
Getting the PublicKeyToken of .Net assemblies [duplicate]
What is the simplest way to find the Public-Key-Token of an assembly?
The simplest way I can think of would be a simple right-click, get public key, but this functionality isn't there, maybe there is ...
193
votes
9
answers
402k
views
Indentation shortcuts in Visual Studio
I'm using Visual Studio 2010 and C#. How can I indent the selected text to left/right by using shortcuts?
In the Delphi IDE the equivalents are Ctrl+Shift+I and Ctrl+Shift+U
192
votes
3
answers
280k
views
How to run specific test cases in GoogleTest
I am trying to write a function/method for my project, which will ask to user which all test cases are you going to run?
It looks like below...,
Test_Cases_1
|_TestNo1
|_TestNo2.......