Unit testing: how to access a text file?

You have to add the DeploymentItem attribute to your test class. With this attribute you specify the files which are copied into the out directory for the test run. For example: [TestMethod] [DeploymentItem(@”myfile.txt”, “optionalOutFolder”)] public void MyTest() { … } See also: http://msdn.microsoft.com/en-us/library/ms182475.aspx.

How do I disable all Roslyn Code Analyzers?

You can disable analyzers on a per-project basis. To do it, right click on Project>References>Analyzers in the Solution Explorer and hit Open Active Rule Set You can disable individual analyzers or entire bundles of analyzers. This creates a <ProjectName>.ruleset file and modifies the <ProjectName>.csproj, which means that you will share this configuration with your team … Read more

Can’t Update or Uninstall NuGet Package Manager in VS2012

Source: http://www.paraesthesia.com/archive/2013/07/30/upgrading-nuget-the-process-cannot-access-the-file-because-it.aspx This is what helped me: Close all instances of Visual Studio. Go to your global Visual Studio extensions folder. NuGet doesn’t install in your per-user folder; instead, you’ll see it in Program Files. Something like: C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions Look in that folder. You will see a lot of randomly named … Read more

Visual Studio – Automatically refresh class view when changing class

After reading kingmaxxx’s reply, I went to Tools->Options->Environment->Keyboard and bound Ctrl+Shift+C to View.SynchronizeClassView in Text Editor view. This seems to supplant and supplement the original behavior (View.ClassView), as it will display ClassView if it wasn’t visible and focus on the current class. (Visual Studio 2008)

IIS Express is automatically disabling anonymous authentication for my project, why?

It was because for some reason, this was in my csproj file: <IISExpressAnonymousAuthentication>disabled</IISExpressAnonymousAuthentication> Setting it to enabled fixes the issue (it can also be done from Visual Studio, select project, F4, set Anonymous Authentication in the properties grid to Enabled).

How to generate an .apk file from Xamarin.Forms Project using Visual Studio?

When using Visual Studio 2015 Update 3 with the latest Xamarin tools (which is v4.2.2.6 when writing this answer), right click your Android project and select “Archive…” as described here: https://developer.xamarin.com/guides/android/deployment,_testing,_and_metrics/publishing_an_application/part_1_-_preparing_an_application_for_release/#Compile This will open the Archive Manager and begins the process of archiving the App bundle. When the archiving is finished, you can click on … Read more

Copy target file to another location in a post build step in CMake

Rather than using the obsolete LOCATION property, prefer using generator expressions: add_custom_command(TARGET mylibrary POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:mylibrary> ${targetfile} ) You could also just generate the exe in the target directory directly by setting the target property RUNTIME_OUTPUT_DIRECTORY instead of copying it. This has per-configuration options (e.g. RUNTIME_OUTPUT_DIRECTORY_DEBUG). set_target_properties(mylibrary PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG <debug path> RUNTIME_OUTPUT_DIRECTORY_RELEASE … Read more