Category Archives: VS 2017

Visual Studio 2017 update 15.9.0 – Package ‘Microsoft.Azure.Storage.Emulator.Msi, version=5.7.0’ failed to install.

Yesterday I had the pleasure to install latest update of VS 2017 15.9.0. Unfortunately at the end I was notified about minor problem I reported here :
https://developercommunity.visualstudio.com/content/problem/381783/packageidmicrosoftazurestorageemulatormsipackageac-13.html

The problem with solution is, that I had nothing more running on my machine (I installed after hours, at home, not to trash bandwidth at work) and that the solution was for a different package. MS guys closed the problem tagging it as duplicate and pointed me to older error report that is closed with result : its already fixed. Thank you MS, very helpful!

While looking at the error, you can see this path :

C:\ProgramData\Microsoft\VisualStudio\Packages\Microsoft.Azure.Storage.Emulator.Msi,version=5.7.0

I was looking for the package all over the internet, but I was not able to find standalone installer of Microsoft Azure Storage Emulator with version 5.7.0 (maybe just me and there is a common place to find all these packages).

But, if you peek in this folder (with version number at the end), you should be able to find installer there, yay!!!
You won, if you have the problematic installer and can install it by hand :)
Hope this helps.

How to run StyleCop as opt-in feature with msbuild from command line

The tool :

So everyone knows wonderful tool from Microsoft, named StyleCop. StyleCop is a tool that runs against C# code (not against IL assemblies – already build code) and based on rules saved either per machine, or per project (we will show us how to save them per project) gives you feedback , if you violated some of these rules. StyleCop started on codeplex (MS take on similar portal like github) and currently moved to GitHub – https://github.com/StyleCop. If you see closely, on GitHub we have two projects :

We will go down the free path and take a look at first option. There are two plugins I will speak about today :

(please note that in StyleCop repo there is a note about recommendation to use Roslyn based StyleCop from https://github.com/DotNetAnalyzers/StyleCopAnalyzers repo)

So, you can add NuGet StyleCop.MSBuild package and now running msbuild from command line will trigger analysis. Which is what we want on CI server, but not for builds from Visual Studio. You can try to run build from VS and see what happens.

How to turn off StyleCop.MSBuild for VS builds :

After some search on the interwebz I found out, that there is a property StyleCopEnabled in StyleCop.MSBuild.Targets that is set to true if nothing is specified, which we need to set to false as default. So you need to edit your .csproj (or any other .proj file) and insert

<br />
&lt;StyleCopEnabled&gt;false&lt;/StyleCopEnabled&gt;<br />

in some PropertyGroup.

This will enable you to do following thing :

  • run msbuild to trigger just plain old build
  • run msbuild  /p:StyleCopEnabled=true to pass parameter to msbuild that will do the analysis after the build.

If you guess that the first will be “used” when building from VS and second to get analysis on your CI server, you are right :)

And if you questioned yourself, “why not to pass  /p:StyleCopEnabled=false” from VS build, then AFAIK from VS also in 2017 we cant just pass parameters to msbuild. Shame, I know.