Why does TestInitialize get fired for every test in my Visual Studio unit tests?

TestInitialize and TestCleanup are ran before and after each test, this is to ensure that no tests are coupled. If you want to run methods before and after ALL tests, decorate relevant methods with the ClassInitialize and ClassCleanup attributes. Relevant information from the auto generated test-file in Visual Studio: You can use the following additional … Read more

Remove empty lines in text using Visual Studio or VS Code

Since Visual Studio 2012 changed its regex syntax, the original answers by Ala translate into the following in VS 2012: Remove single blank lines Old: ^:b*$\n New: ^(?([^\r\n])\s)*\r?$\r?\n Visual Studio 2013 (thanks to BozoJoe and Joe Johnston): ^\s*$\n Remove double blank lines Old: ^:b*\n:b*\n New: ^(?([^\r\n])\s)*\r?\n(?([^\r\n])\s)*\r?\n Rolls right off your tongue. Here is the conversion … Read more

Copy object values in Visual Studio debug mode

In the immediate window, type ?name_of_variable This will print out everything, and you can manually copy that anywhere you want, or use the immediate window’s logging features to automatically write it to a file. UPDATE: I assume you were asking how to copy/paste the nested structure of the values so that you could either search … Read more

How do I generate a constructor from class fields using Visual Studio (and/or ReSharper)?

In Visual Studio 2015 Update3 I have this feature. Just by highlighting properties and then press Ctrl + . and then press Generate Constructor. For example, if you’ve highlighted two properties it will suggest you to create a constructor with two parameters and if you’ve selected three it will suggest one with three parameters and so on. … Read more

IIS does not list a website that matches the launch url

I hate answering my questions: in my question i stated that i was running VS under the administrator account. This was not true!!! So the solution (for me) was to run VS2010 as administrator (Start->In Vista menu right click-> Run as administrator)…so simple. As a side effect: VS2010 let me also create Virtual Directories without … Read more

Should I add .vcxproj.filter files to source control?

We intentionally pulled the .filter. file information out of the .vcproj when we translated to the .vcxproj MSBuild format. One reason is exactly what you pointed out, that the filters are purely a logical view, and different team members may want different views. The other is that sometimes the build is set up to check … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)