Posts about Visual Studio

Fine Code Coverage runs tests on its own

In the sample project for my previous blog post, I noticed that every time I ran my test, its code was executed twice. At first, I thought that I had a bug in my code, but quickly dismissed this option. After further investigation, I finally attributed the strange behavior to the Fine Code Coverage Visual Studio extension.

Minimum MSTest versions for VS 17.6

After I updated my copy of Visual Studio 2022 to the latest version 17.6, I couldn't run the tests from the Test Explorer anymore that worked just fine in version 17.5. I had similar experience in the past, so I immediately suspected that the problems were related to the versions of test-related NuGet packages in my project.

Showing keyboard shortcuts in IDE

I recently attended an online presentation on how to effectively use Visual Studio Code. The presenter did a great job of explaining the keyboard shortcuts he used. It would have been even easier for him if he had turned on screencast mode to show the keyboard shortcuts and the actions triggered in the editor. He was very excited when I told him about it after the presentation. I decided to do some research on similar features in other editors I use regularly.

Versions of source generator dependencies

October 14th 2022 Roslyn Visual Studio

When referencing NuGet packages of third-party libraries, you usually want to use the latest stable version available. But you probably should not do that with Microsoft.CodeAnalysis.CSharp if you are developing your own source generator. Otherwise, you unnecessarily limit the versions of Visual Studio in which your source generator will work.

Resetting publishing profile password

September 30th 2022 Visual Studio Azure

When you create a publish profile in Visual Studio, the password for accessing the target Azure service is also stored. However, if this password changes in Azure or if you retrieve the publish profile from source control so that there is no valid password stored in your copy of Visual Studio, you must enter the password during publishing. Where can you find the valid password and how can you store it again in Visual Studio?

Fix broken .NET MAUI templates

September 9th 2022 .NET MAUI Visual Studio

When I started working with .NET MAUI, I immediately noticed that the code files generated by the project template use tabs instead of spaces for indentation (unlike all other .NET project templates). This bothered me, but fortunately it can be easily fixed.

Dangers of setting SSH path in Git config

March 18th 2022 Git Windows SSH Visual Studio

Using SSH with Git on Windows mostly works out of the box. The .gitignore file allows a lot of additional configuration. The sshCommand in the core section allows you to specify the path and arguments for the ssh.exe command. However, specifying a path there is mostly asking for trouble.

Build flags in Visual Studio

March 11th 2022 Visual Studio .NET

The project properties window has been redesigned in Visual Studio 2022. But not only the appearance has changed. For at least some options, the effect of the changes in the project properties window has also changed. Let us take a look at how the behavior of the Allow unsafe code build option has changed.

Part 2 of My Visual Studio Course Available

At the end of November the second part of my Visual Studio video course was published. With that, all of the materials which I was recording during summer and early autumn are finally available for everyone to watch.

My Visual Studio Video Course Published

I've been pretty busy since early summer, spending most of my spare time recording a video course about features for debugging and testing in Visual Studio 2017. Since Monday, the first part of this video course is finally available to everyone.

Slides from Global Azure Bootcamp

April 28th 2017 Azure Visual Studio Speaking

On Saturday the fifth annual Global Azure Bootcamp event was taking place all around the globe. In Slovenia the event was organized in Ljubljana at the premises of the local Microsoft subsidiary. I showcased the Visual Studio integrations for Azure Storage, Application Insights and publishing of ASP.NET Core web applications to App Service on Windows and Linux.

Slides from Visual Studio 2017 Launch Event

March 10th 2017 Visual Studio Docker Speaking

Tuesday was the Visual Studio 2017 release day. To celebrate this occasion, Microsoft organized an official 2-day launch event. It was accompanied by a large number of local events all across the world. One of them was organized in Ljubljana as well. I had a short session there, presenting the most important new features and improvements in Visual Studio 2017.

Enabling Font Ligatures in Code Editors

Many operators and other symbols in programming languages consist of multiple characters, but still represent a single token. Although as programmers we learned to view these symbols as single logical units, ligatures allow joining of multiple neighboring letters into a single glyph. With correct fonts and editor support these can be used to improve the rendering of source code on screen.

Injecting Bower Dependencies into HTML Pages

October 13th 2016 Cordova Gulp Visual Studio

I selected Bower as the package manager for client-side JavaScript libraries in my Cordova project. I already took care of copying the required JavaScript files to a folder that will be packaged into the application. However, to use the scripts, they also need to be referenced from the HTML page(s). I don't want to do it manually if I can automate the process.

Package Management for TypeScript Cordova Apps in Visual Studio

Visual Studio Tools for Apache Cordova is a Visual Studio extension for developing Cordova apps inside Visual Studio. Although it comes with a TypeScript based project template, it is not fully preconfigured for package managers that can simplify the use of JavaScript libraries and TypeScript definitions. This post describes how I configured a project I recently started working on.

Deploying ASP.NET Core RC1 Application to IIS

February 14th 2016 ASP.NET Core IIS Visual Studio

If you're used to the old ASP.NET, it's not all that obvious how to deploy an ASP.NET Core application to IIS. Although, there is documentation available for the process, I still struggled a bit, before I got everything working. This post contains the steps I had to take, so that I can simply follow them the next time. At least, until something changes again with one of the future releases.

Continuous Testing in Visual Studio

Ever since I have tried out NCrunch, I never looked back. Continuous running of tests as implemented in NCrunch significantly changed how I look at tests. Since then continuous testing has become much more mainstream and today both ReSharper and stock Visual Studio offer support for it. It was about time I took another look at the other tools and see how they compare to NCrunch today.

Be Careful When Copying Visual Studio Projects

December 5th 2015 Visual Studio .NET Framework

You might not be aware of it, but Visual Studio projects have additional identity beyond their project file name and path. Each one of them contains a GUID value which should by definition be unique in normal circumstances. The troubles begin, when you create a copy of a project by copying its folder and renaming the files.

Running NDepend Analysis in TeamCity

The new version of NDepend brought many new features; among them also integration with TeamCity build server. This convinced me to give it another closer look; evaluating how taking advantage of this can contribute to increasing code quality in larger development teams.

Resources From My Sessions at Cancel Conference

This week the first Cancel conference was taking place in Nova Gorica. I had the last two sessions in one of the development tracks: Diagnostic analyzers in Visual Studio 2015 and Debugging in Visual Studio 2015. Slides and demos are available for download.

Using NuGet in Visual Studio Tools for Unity

May 23rd 2015 NuGet Unity Visual Studio

Visual Studio Tools for Unity enable the convenience of developing Unity scripts inside Visual Studio. A naive attempt to install a random NuGet package into the UnityVS project will still most likely fail. To make it work, the NuGet package will need to comply with special requirements. Even then, there will still be some manual work left.

Presenter Mode Alternative in Visual Studio 2015 RC

May 17th 2015 Visual Studio

Productivity Power Tools for Visual Studio 2013 introduced a great feature called Presenter Mode, temporarily increasing the fonts both in the text editor and Visual Studio itself, without having to change the settings and thus affecting your working environment. Since the extension is not (yet) available for Visual Studio 2015, we need to make do with one of the alternatives.

Using Web.config Transformations When Debugging Web Applications in Visual Studio

SlowCheetah is a very useful Visual Studio extension which builds upon Visual Studio's built-in support for Web.config transformations. It adds similar XDT transformation file support to non-web projects which can be used even during debugging, while built-in solution for web projects only works for web deployment. There is already a feature request for SlowCheetah for it, but until it's implemented, you'll need to find a different solution.

Debugger Doesn't Trigger Static Type Initialization

September 1st 2014 Debugging Visual Studio C#

According to the C# language specification, the static field initializer should execute before it is accessed for the first time. As it seems, looking up the field value in debugger doesn't trigger the initializer.

ASP.NET MVC Project Build Failure When Switching Between Configurations

After I set up multiple different configurations for my ASP.NET project with different .config file transformations for different environments, a build error started showing up every time I changed to a different configuration. The issue could be resolved by manually deleting a file from obj folder, but I soon got tired of this and decided to investigate further.

Configuring Common NuGet Repository for Multiple Solutions

December 23rd 2013 NuGet Visual Studio

When using NuGet, you typically don't need to worry about its repository location. In simple every day scenarios it just works without even paying attention to it. Once you have more than a single solution file for your product, this default approach starts to break down. To be more precise; the problems occur when a single project file is included in multiple solutions files, which are not placed in the same folder.

Data-Driven or Parameterized Tests in Windows Store apps

Since I usually write my unit tests in NUnit, I got into the habit of using parameterized tests when testing methods for which I need to check the result for many different input values. Unfortunately using NUnit is not an option with Windows Store apps. Only MSTest is supported, providing data-driven unit tests for such cases.

Using Git in Session Demos

July 8th 2013 Git Visual Studio

I often find myself speaking at technical conferences and user group meetings and due to the nature of my sessions, there are usually demos involved. A particular kind of demos I often struggled with to make them work well within a session, are the ones in multiple steps, i.e. they show the same project or solution in different stages of development.

Book Review: Visual Studio 2012 and .NET 4.5 Expert Development Cookbook

The book addresses a lot of advanced topics throughout the chapters, as expected based on the target audience of experienced .NET developers. Still, most of the chapters include some basic topics as well, which slow down the pace.

Package Restore Fails for Projects Importing a .targets File from a Missing NuGet Package

June 3rd 2013 NuGet Visual Studio

When moving a Windows Phone project referencing Microsoft.Bcl.Async package to a new computer I was unpleasantly surprised. Although I had NuGet package restore enabled on the solution, it not only failed to build, it even failed to load. After some investigation I found out that this was a known limitation in NuGet.

NuGet Package Restore for Projects in Multiple Solutions

May 27th 2013 NuGet Visual Studio

If you've only been using NuGet in typical scenarios with a single solution containing a couple of projects, it probably worked great for you. As soon as the project structure is a bit more complex, things start falling apart. There are two main reasons why it doesn't work as expected when individual projects are included in multiple solution files residing in different folders.

Visual Studio 11 Beta Regional Settings Issues in Windows 8

March 21st 2012 Visual Studio Windows

It seems that Visual Studio 11 Beta works better and more reliable in Windows 7 than it does in Windows 8 Consumer Preview. In Windows 7 I've been running it without problems, using Slovenian regional settings. In Windows 8 Consumer Preview on the other hand it doesn't even start properly when regional settings are set to Slovenian.

Creating NuGet Packages and Setting Up an Internal Feed

January 14th 2012 NAnt NuGet Visual Studio

NuGet is a valuable tool for managing references to external libraries in your projects. If you're not using it yet, you owe it to yourself to try it out and see what you're missing. Though, that's not what this post is about. Not only are NuGet packages a great way to distribute publicly available libraries, they can be used just as well for custom internal libraries with their own release management which are used in multiple projects.

Transformation of Configuration Files in Build Process

January 8th 2012 ASP.NET Visual Studio SlowCheetah

Web.config transformations are a great but often overlooked feature introduced with ASP.NET 4.0. They provide a simple way to define a different configuration for Debug and Release builds of your project by only specifying the differences (typically only connection strings and similar settings) in a separate transformation file while keeping the core of the configuration file common and consequentially making it easier to manage.

Unit Testing with NUnit in Visual C# 2010 Express

My favorite environment for running NUnitunit tests during the development process is definitely Unit Test Runner in CodeRush. When I just recently had to get a usable development environment up and running with Visual C# 2010 Express, I had to find a different solution since extensions are not supported in the Express SKUs of Visual Studio.

Too Many Projects in a Solution Slows Down Visual Studio 2005

August 5th 2006 Visual Studio

Once the number of projects in a solution comes up to thirty or more, most of the project related operations become really slow. It is something to have in mind when deciding how to group projects in solutions.

C++ Project Build from Network Share Fails in VS2005

May 14th 2006 C/C++ Visual Studio

Trying to build a C++ project opened from a network share in Visual Studio 2005 might fail with a strange error. The problem only appears when the share host can't authenticate the user reading from and writing to the share.