If you encounter any issues with VS 2017 not already listed below, you can report them using the Report a Problem tool on our Developer Community site, where you can track the status and see issues reported by others as well.
If you encounter a problem with Visual Studio, we want to know about it so that we can diagnose and fix it. By using the Report a Problem tool, you can collect detailed information about the problem, and send it to Microsoft with just a few button clicks. See Visual Studio’s Talk to Us page for more details. The GitHub Issue Tracker for the aspnet/Tooling repo is now deprecated in favor of the Report a Problem tool.
For known issues with .NET Core, use the following links to see the issues in the .NET Core GitHub repo the team is tracking including comments and status.
Publishing a project with a reference can sometimes result in the referenced project getting published with the wrong configuration
For a .NET Core Console project with a project reference to a Core / NET Standard Class Lib, if we publish the console app in release configuration, the class lib assembly will be published with Debug configuration instead. The console assembly will be in Release configuration as expected.
If the TargetFramework is set to net45x and RuntimeIdentifiers is set to win7-x64, the published output produces an executable with the wrong bitness.
If the RuntimeIdentifier element is set in the project file, the "Target Runtime" dropdown in the window that appears when the "Settings" link under "Summary" will not pick up that RuntimeIdentifier and will instead show "Portable".
Set the "RuntimeIdentifiers" element in the project file so the dropdown can pick up the Runtime Identifiers.
Core Console/Class lib Publish Profile Settings Dialog shows only Portable RID when the user wants to add a RID by adding a RuntimeIdentifier element in the project file
Only add one runtime identifier to the project, by changig the RuntimeIdentifier element, to a RuntimeIdentifiers element, for example:
<RuntimeIdentifiers>win7-x86</RuntimeIdentifiers>
When trying to publish to Azure, unable to create App Service for a project with _ in the project name
When trying to publish a project with _ in the project name to Azure, the App Name text box of the Create App Service dialog can give a validation error: "Could not verify name availability, please try again"
Remove _ from the App Name text box
When running an MVC4 project in Visual Studio, database access by the application may fail if it is using SQL Server Express LocalDB 2012. This is caused because MVC4 projects by default depend on SQL Server Express LocalDB 2012 which is not installed with Visual Studio 2017.
Upgrade the project to use SQL Server Express LocalDB 2016, or manually download and install SQL Server Express LocalDB 2012 on the machine.
Remote profiling to Azure App Service from Cloud Explorer or Server Explorer displays the error "Cannot access a disposed error".
Use Visual Studio 2015 to profile, Azure App Services does not yet support profiling from Visual Studio 2017.
To create ASP.NET Core 1.0 / 1.1 projects install Visual Studio's ".NET Core 1.0 - 1.1 developer tools for Web" component
Creating a new ASP.NET Core Web Application based on ASP.NET Core 1.0 or 1.1 is blocked (the OK button is disabled) and displays the message "To create ASP.NET Core 1.0/1.1 projects you need to install Visual Studio's '.NET Core 1.0 - 1.1 developer tools for Web' compomnent."
Use Visual Studio Installer to install the missing Visual Studio component ".NET Core 1.0 - 1.1 developer tools for Web".
Re-targeting ASP.NET Core 1.0 or 1.1 application to ASP.NET Core 2.0 will require additional steps by the user
After you change target of an existing ASP.NET Core 1.0 or 1.1 application to 2.0, you might get incompatibility errors. Here are some symptoms of issues you might see:
Build warning:
Package 'Microsoft.Composition 1.0.27' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.0'. This package may not be fully compatible with your project.
Error when you run the project:
An unhandled exception occurred while processing the request.
InvalidOperationException: Can not find compilation library location for package 'Microsoft.NETCore.App'
Microsoft.Extensions.DependencyModel.CompilationLibrary.ResolveReferencePaths()
Build Errors
error NU1605: Detected package downgrade: System.Diagnostics.Tools from 4.3.0 to 4.0.1. Reference the package directly from the project to select a different version.
error NU1605: WebApplication1 (>= 1.0.0) -> Microsoft.VisualStudio.Web.BrowserLink (>= 1.1.2) -> Microsoft.AspNetCore.Hosting.Abstractions (>= 1.1.2) -> NETStandard.Library (>= 1.6.1) -> System.Diagnostics.Tools (>= 4.3.0)
You will need to do additional steps to fully migrate your project to 2.0. See following documentation for additional details:
Migrating from ASP.NET Core 1.x to ASP.NET Core 2.0
Migrating Authentication and Identity to ASP.NET Core 2.0
PackageManagerConsole EF Core commands like Add-Migration commands fail when a restore is in progress
When a package restore is in progress, if you try to run one of the EntityFrameworkCore commands like Add-Migration and Update-Database using the Package Manager Console, it may fail with the following error
Update-Database : The term 'Update-Database' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
included, verify that the path is correct and try again.
Wait until package restore completes and try again
When debugging a Razor view and / or hitting an exception in a Razor view the edit/continue dialog pops up in VisualStudio. If you click edit => f5, you will get the same prompt again.
Hit edit => close the Razor editor => f5.
When running dotnet aspnet-codegenerator from a command prompt, you run into an unhandled InvalidOperationException
When you try to invoke dotnet aspnet-codegenerator after creating a new ASP.NET Core application using the command-line, you get an unhandled InvalidOperationException that mentions that Microsoft.VisualStudio.Web.CodeGeneration.Design package needs to be added as a NuGet package reference
Example:
dotnet new mvc
dotnet aspnet-codegenerator
Add the missing package reference in your csproj file, and then run 'dotnet restore'
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.0.0" />
Publish settings dialog for ASP.NET core web applications on .NET framework sometimes shows the EF migration section as empty when IIS express is running. This is because the files are locked and EF is not able to detect the dbcontexts for the project.
Exit the Publish dialog, do a VS build and re-open the publish settings dialog.
When creating a ASP.NET Core Web Application on .NET Framework without an internet connection, project creation may fail with the following package restore error due to missing ManagedEsent package
Connect to the internet and run Restore Packages on the solution
After installing update to Visual Studio and publishing a ASP.NET Core 1.1 application, you get a HTTP Error 502.5 on the published application
Visual Studio 2017 (version 15.2) installs the .NET Core 1.1.2 runtime. When you build and publish ASP.NET Core 1.1 application using this version of Visual Studio, the application is built against the 1.1.2 runtime. If the web server does not have the 1.1.2 runtime, then you get HTTP Error 502.5
Install the 1.1.2 runtime on the web server
Razor Tag Helpers do not get colorization or special IntelliSense at design time. They work normally at runtime.
Update VS 2017 to version 15.3
Pressing Ctrl+. on unresolved references to extension methods does not provide a lightbulb with helpful shortcuts to install the required package
Manually find and install the package using Manage NuGet packages UI
If your application is targeting ASP.NET Core 1.0 or 1.1 and you try to add NuGet packages using Manage NuGet Packages dialog or the Package Manager Console tool window, it defaults to installing the 2.0 version of the packages causing undesirable behavior in some cases.
Update the version of the packages to 1.0.x / 1.1.x
Visual Studio becomes unresponsive when working on .NET Core projects that contain node_modules.
Do npm restore while the project or VS is closed, and then reopen the solution/project.
Publishing a project with Entity Framework migrations fails if the DB context is not in the project that is getting published.
Add the following to the pubxml or csproj & fill in the DBContextName, ConnectionString, and PathToCsProjContainingDBContext
<Target Name="PrePublishScript" BeforeTargets="PrepareForPublish">
<PropertyGroup>
<IsGenerateEFSQLScriptsDisabled>true</IsGenerateEFSQLScriptsDisabled>
<SqlFilePath>$(PublishIntermediateTempPath)\GeneratedSqlFile.sql</SqlFilePath>
<DBContextName></DBContextName>
<ConnectionString></ConnectionString>
<PathToCsProjContainingDBContext></PathToCsProjContainingDBContext>
</PropertyGroup>
<Exec Command="dotnet ef migrations script --idempotent --output "$(SqlFilePath)" --context $(DBContextName) --project $(PathToCsProjContainingDBContext)” />
<ItemGroup>
<_EFSQLScripts Include="$(SqlFilePath)">
<DBContext>$(DBContextName)</DBContext>
<ConnectionString>$(ConnectionString)</ConnectionString>
<EscapedPath>^$([System.Text.RegularExpressions.Regex]::Escape($(SqlFilePath)))$</EscapedPath>
</_EFSQLScripts>
</ItemGroup>
</Target>
Publish settings dialog for non-portable ASP.NET Core web apps does not show the RuntimeIdentifier dropdown.
To work around this, set the RuntimeIdentifier property in the csproj.
<PropertyGroup>
<RuntimeIdentifier></RuntimeIdentifier>
</PropertyGroup
On an empty ASP.NET Core project, MVC Dependency scaffolder sometimes fails with error 'Package restore failed.'
To work around this, click OK on the error dialog and retry scaffolding.�
In ASP.NET Core projects, 'Delete', 'Details', and 'List' views cannot be scaffolded without a valid DbContext type.
Specify a valid DbContext type.
If the project has a globbing pattern for <Compile>
item group with a exclude pattern, and the files generated by scaffolding match the pattern, they are not included in the project. For example: If a project has <Compile Include = "**/*.cs" Exclude="ExcludedDir/*.cs" />
and scaffolding generates a file in 'DefaultController.cs' ExcludedDir, it will not be included in the project for compilation.
Manually adjust the globbing pattern to include the 'ExcludedDir/DefaultController'
If the DataContext class has a member (property, method, variable) defined with the same name as the Model class being used for scaffolding fails with an error as below:
Add a DbSet<> property to the DataContext class for the model which will be used for scaffolding manually and then retry scaffolding
public DbSet<ClassName> MemberName { get; set; }
When creating a Docker project and running the project in the "IIS Express" configuration, the website cannot be opened and the status is always loading.
To work around this, add .UseIISIntegration() to Program.cs:
var host = new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup<Startup>()
.UseApplicationInsights()
.Build();
When creating an ASP.NET Core project, if you check the "Enable Container (Docker) Support" checkbox but do not have "Docker for Windows" installed, the created project will fail to build with the following error:
Microsoft.DotNet.Docker.CommandLineClientException: 'docker-compose' was not found. Please verify that it is available on %PATH%, or for troubleshooting, follow instructions from http://aka.ms/DockerToolsTroubleshooting
Install Docker for Windows to resolve the issue
TypeScript files are not automatically compiled on save in .NET Core projects
Add a tsconfig.json file to the root of the project, containing at least {}.
In Core projects, item templates such as "npm Configuration File", "Bower Configuration File", "Grunt/Gulp Configuration File", etc., which work only with specific names, are created with an extra "1" inserted before the end of the file name.
Edit the supplied file name before or after creating the file.