The dark side Visual Studio 2017

3 minutes

While choosing Visual Studio 2017 I didn’t expect that I would be disappointed that fast. Unfortunately, this version doesn’t cooperate with Resharper when it comes to cover code and using unit tests console. Resharper supports only Asp.Net Core with project.json in VS 2017 is *.project, in that case, I create the solution from the beginning. In GitHub, this issue is in branch vs2015. Below I will present step by step what to do (eg. application Asp.Net Core) when we want to create it.

    1. You must install Visual Studio 2015 (all versions) with service pack 3 (if you don’t have it).
    2. Choose a new project with menu File -> New – >Project.
    3. Create web application (Asp.Net Core Web application).
    4. Chose Web application (you must create project MVC ), if you want to see it you must only press CTRL+F5.
    5. Visual studio run web application in IIS Express.
    6. Now we have a working application in Asp.Net Core 1.0.
    7. Open page www and download the current version of SDK and dotnet-dev-win-x64.1.0.0-preview2-1-003177 and install them.
    8. Old versions are in  www.
    9. Next, we install tools like (Preview 2) for .NET Core 1.1 for Visual Studio 2015 (www DotNetCore.1.0.1-VS2015Tools.Preview2.0.3.exe) if we have it, a window appears (shown below, notice that we have version 1.0.1; it is mistake of course).
    10. After installation, we go to folder C:\Program Files\dotnet\sdk (unless we have installed it in another path) and we see we have the newest version   (of course it is version 1.0 but it is truly version 1.1 we can recognize it by number 1-003177).
    11. In solution, we edit global.json file.
    12. We change file version „1.0.0-preview2-003131” into „0.0-preview2-1-003177”.
    13. File project.json should look like this:
{
  "userSecretsId": "aspnet-TooExe.Owl.Mvc-2743213b-e009-4e1d-9c97-4189aa6ccb9a",

  "dependencies": {
    "Microsoft.NETCore.App": {
      "version": "1.1.1",
      "type": "platform"
    },
    "Microsoft.ApplicationInsights.AspNetCore": "2.0.0",
    "Microsoft.AspNetCore.Authentication.Cookies": "1.0.0",
    "Microsoft.AspNetCore.Diagnostics": "1.0.0",
    "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.0.0",
    "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0",
    "Microsoft.AspNetCore.Mvc": "1.0.1",
    "Microsoft.AspNetCore.Razor.Tools": {
      "version": "1.0.0-preview2-final",
      "type": "build"
    },
    "Microsoft.AspNetCore.Routing": "1.0.1",
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.1",
    "Microsoft.AspNetCore.StaticFiles": "1.0.0",
    "Microsoft.EntityFrameworkCore.SqlServer": "1.0.1",
    "Microsoft.EntityFrameworkCore.SqlServer.Design": {
      "version": "1.0.1",
      "type": "build"
    },
    "Microsoft.EntityFrameworkCore.Tools": {
      "version": "1.0.0-preview2-final",
      "type": "build"
    },
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
    "Microsoft.Extensions.Configuration.Json": "1.0.0",
    "Microsoft.Extensions.Configuration.UserSecrets": "1.0.0",
    "Microsoft.Extensions.Logging": "1.0.0",
    "Microsoft.Extensions.Logging.Console": "1.0.0",
    "Microsoft.Extensions.Logging.Debug": "1.0.0",
    "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
    "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0",
    "Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
      "version": "1.0.0-preview2-final",
      "type": "build"
    },
    "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": {
      "version": "1.0.0-preview2-final",
      "type": "build"
    },
    "TooExe.Owl.Library": "1.0.0-*"
  },

  "tools": {
    "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final",
    "Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final",
    "Microsoft.Extensions.SecretManager.Tools": "1.0.0-preview2-final",
    "Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
      "version": "1.0.0-preview2-final",
      "imports": [
        "portable-net45+win8"
      ]
    }
  },

  "frameworks": {
    "netcoreapp1.1": {
      "imports": [
        "dotnet5.6",
        "portable-net45+win8"
      ]
    }
  },

  "buildOptions": {
    "emitEntryPoint": true,
    "preserveCompilationContext": true
  },

  "runtimeOptions": {
    "configProperties": {
      "System.GC.Server": true
    }
  },

  "publishOptions": {
    "include": [
      "wwwroot",
      "**/*.cshtml",
      "appsettings.json",
      "web.config"
    ]
  },

  "scripts": {
    "prepublish": [ "bower install", "dotnet bundle" ],
    "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
  }
}

After compilation, we have version 1.1.

For all other projects make only steps 11 and 12. File project.json should look like this:

{
  "version": "1.0.0-*",
  "dependencies": {
    "Microsoft.DotNet.Files": "1.0.0-preview2-1-003177",
    "NETStandard.Library": "1.6.1"
  },

  "frameworks": {
    "netcoreapp1.1": {
      "dependencies": {
        "Microsoft.NETCore.App": {
          "type": "platform",
          "version": "1.1.1"
        }
      }
    },
    "netstandard1.6": {
      "imports": "dnxcore50"
    }
  }
}

After all these procedures we have a solution in version 1.1. My next post will begin from programming library TooExe.Owl.Library in accordance with TDD.