push_back vs emplace_back

In addition to what visitor said : The function void emplace_back(Type&& _Val) provided by MSCV10 is non conforming and redundant, because as you noted it is strictly equivalent to push_back(Type&& _Val). But the real C++0x form of emplace_back is really useful: void emplace_back(Args&&…); Instead of taking a value_type it takes a variadic list of arguments, so that means that you can now perfectly … Read more

How to fix “namespace x already contains a definition for x” error? Happened after converting to VS2010

I had this happen to me about a year ago and I don’t remember exactly what the root cause was, but there are two things you might try: If it’s an auto-generated file (as ‘Resources.Designer.cs’ tend to be), try deleting it and letting VS re-generate it. Either separately or in conjunction with #1, select Show All … Read more

Attach (open) mdf file database with SQL Server Management Studio

I had the same problem. system configuration:-single system with window 7 sp1 server and client both are installed on same system I was trying to access the window desktop. As some the answer say that your Sqlserver service don’t have full access to the directory. This is totally right. I solved this problem by doing … Read more

An error occurred while signing: SignTool.exe not found

ClickOnce Publishing Tools are not installed as part of the Typical Installation Options. So you have to install it in advanced mode.  This dialog can be found in Windows 7 by going to Control Panel > Uninstall a program, right-clicking on Microsoft Visual Studio Professional 2015 and selecting Change. A Visual Studio dialog will open up. Select Modify from the set … Read more

What is and how to fix System.TypeInitializationException error?

Whenever a TypeInitializationException is thrown, check all initialization logic of the type you are referring to for the first time in the statement where the exception is thrown – in your case: Logger. Initialization logic includes: the type’s static constructor (which – if I didn’t miss it – you do not have for Logger) and field initialization. Field initialization is pretty … Read more

Why am I getting a “Could not find a part of the path” exception?

You might also be experiencing what I am: that the directory name contains some unusual characters. In my case, That copyright sign is the issue. So using concepts drawn from Obtaining the short 8.3 filename from a long filename, I convert my paths to short form first, then use that to get my list of files. … Read more

Visual Studio debugger error: Unable to start program Specified file cannot be found

Guessing from the information I have, you’re not actually compiling the program, but trying to run it. That is, ALL_BUILD is set as your startup project. (It should be in a bold font, unlike the other projects in your solution) If you then try to run/debug, you will get the error you describe, because there … Read more