EzDevInfo.com

visual-studio-2010 interview questions

Top visual-studio-2010 frequently asked interview questions

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)


Source: (StackOverflow)

Targeting .NET Framework 4.5 via Visual Studio 2010

Today I installed the .NET Framework 4.5 on my machine expecting to be able to use it from Visual Studio 2010, since it's just a minor update that should't pose problems for Visual Studio 2010. Unfortunately I am not, even manually removing certain 4.0 and adding the corresponding 4.5 assemblies resulted in the original 4.0 assemblies still being referenced in the project.

Is it possible to target version 4.5 from Visual Studio 2010 and if yes, how? I'd really like to use the ribbons...


Source: (StackOverflow)

Advertisements

What is Microsoft.csharp.dll in .NET 4.0

This DLL is added by default in Visual Studio 2010 projects. What is this new assembly used for? It does not seem to contain much after looking at it using Reflector and Google does not seem to have much to say about it either.


Source: (StackOverflow)

How to Run Visual Studio as Administrator by default

Recently discovered that even while logged into my personal laptop as Admin, Visual Studio does not run in admin mode and you need to explicitly use Run As Admin

Is there a way to Make it run as Admin by default other than creating a shortcut etc. ?


Source: (StackOverflow)

How to use Boost in Visual Studio 2010

What is a good step by step explanation on how to use Boost in an empty project in Visual Studio 2010.


Source: (StackOverflow)

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 there is a push_back overload taking a rvalue reference I don't quite see what the purpose of emplace_back becomes?


Source: (StackOverflow)

What's the use for "stdafx.h" in Visual Studio?

The stdafx.h is automatically generated when I start a project in VS2010. I need to make cross-platform C++ library, so I don't/can't use this header file.

What is this for? Is it OK that I just remove this header file?


Source: (StackOverflow)

Writing to output window of Visual Studio?

I am new to C#. I am trying to write a message to output window for debugging purposes. I searched for a function like java's system.out.println(""). Tried Debug.Write, Console.Write, Trace.Write. It does not give an error but not print anything too.

"Define DEBUG constant" and "Define TRACE constant" options are checked.

Tools > Options > Debugging > "Redirect all Output Window text to the Immediate Window" option is not checked.

Configuration: Active (Debug)

Note: I created project with wizard as "Windows Forms Application" if relevant. I have no idea where to look.


Source: (StackOverflow)

Asp.net 4.0 has not been registered

When I try to open visual studio project I get following error.

Asp.Net has not been registered on the webserver you need to manually configure your webserver for Asp.net 4.0.


Update:
Never mind I fixed it:

I just repaired .net Framework 4.0 and the issue was resloved.


Source: (StackOverflow)

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?


Source: (StackOverflow)

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[16] = {1.123, 1.234, 1.345, 156.467, 1.578, 1.689, 1.790, 1.812,
                     1.923, 2.034, 2.145,   2.256, 2.367, 2.478, 2.589, 2.690};
float y[16];
for (int i = 0; i < 16; i++)
{
    y[i] = x[i];
}

for (int j = 0; j < 9000000; j++)
{
    for (int i = 0; i < 16; i++)
    {
        y[i] *= x[i];
        y[i] /= z[i];
        y[i] = y[i] + 0.1f; // <--
        y[i] = y[i] - 0.1f; // <--
    }
}

run more than 10 times faster than the following bit (identical except where noted)?

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[16] = {1.123, 1.234, 1.345, 156.467, 1.578, 1.689, 1.790, 1.812,
                     1.923, 2.034, 2.145,   2.256, 2.367, 2.478, 2.589, 2.690};
float y[16];
for (int i = 0; i < 16; i++)
{
    y[i] = x[i];
}

for (int j = 0; j < 9000000; j++)
{
    for (int i = 0; i < 16; i++)
    {
        y[i] *= x[i];
        y[i] /= z[i];
        y[i] = y[i] + 0; // <--
        y[i] = y[i] - 0; // <--
    }
}

when compiling with Visual Studio 2010 SP1. (I haven't tested with other compilers.)


Source: (StackOverflow)

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 name 'Services' does not exist in the namespace 'System.Data' (are you missing an assembly reference?) C:\U...s\Visual Studio 2010\Projects...\DataService.cs ...

Error 8 The type or namespace name 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference?) DependencyResolver.cs 3 14

Error 10 The type or namespace name 'Web' does not exist in the namespace 'System.ServiceModel' (are you missing an assembly reference?)

Error 12 The type or namespace name 'DataService' could not be found (are you missing a using directive or an assembly reference?)

How can I fix it?


Source: (StackOverflow)

VS2010 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 VS2008 to VS2010. And now in VS2010 one C++/CLI project always runs out of date. Even if it has been compiled and linked just before and F5 is hit the messagebox "The project is out of date. Would you like to build it?" appears. This is very annoying because the dll is very low-tiered and forces almost all projects of the solution to rebuild.

My pdb settings are set to default value (suggested solution of this problem).

Is it possible the get the reason why VS2010 forces a rebuild or thinks a project is up to date?
Any other ideas why VS2010 behaves like that?


Source: (StackOverflow)

Seeing the console's output in Visual Studio 2010?

I am writing a simple C# program with some outputs (Console.WriteLine("...");). The problem is, each time I run it, I cannot see the program's output in the output window.

The "program output" tag is already checked, and I already redirected all outputs to the intermediate window but to no avail.

How do I enable seeing the program's output?

I don't think the problem lies with my code. I tried running a simple program that just outputs a string and readline "ala hello world" and I am still unable to see any output. The problem is either with me looking for the output in the wrong location or Visual Studio acting out.

The debug.write method also doesn't work.

Using debug.Write, it all works, though it didn't before. Either something bugged out with me before I restarted or I just need to take a break, either way it's all good now. Thanks all for the helpful comments =)


Source: (StackOverflow)

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 the projects during debugging.

Is there a way to run both at once?


Source: (StackOverflow)