3

I created an .NET Core Web Application Project with the latest Visual Studio Professional 2017 Version 15.9.2. The .NET Framework is 4.6.01586. I have installed the ASP.NET and web development modul on Visual Studio and I can select a .NET Core Application when creating a new project. Visual Studio creates an empty Solution:

empty solution.

It doesn't matter which type of ASP .NET Core Web Application I select the project is always empty.

Creating an ASP .NET Web Application works fine.

I use Visual Studio Professional 2017 in a Oracle VM VirtualBox. On my local machine everything works fine.

Can anyone help me?

Peter B
  • 22,460
  • 5
  • 32
  • 69
Arinba
  • 31
  • 1
  • 4

7 Answers7

1

have you tried creating an application from the cmd?

navigate to the folder you want the app in than type the following

dotnet new mvc

for example and see what it will give you. It should create a asp.net core app with mvc in mind. If it still gives you problems after that it might be you are missing some installed component by chance.

markorial
  • 425
  • 2
  • 12
  • The project was successfully created, but the .sln file is missing. – Arinba Dec 03 '18 at 09:10
  • I also ran this command on my local machine and I get exactly the same folders and files. When I try to open the project in my Visual Studio, I get the error: Project file is incompatible. Expected imports are missing. – Arinba Dec 03 '18 at 09:22
  • I have installed .NET Desktop development, ASP.NET and web development with .NET Core 2.0 development Tools, .NET Core cross-platform development. – Arinba Dec 03 '18 at 09:32
  • when you create a project from dotnet cli there is no solution file with it there is just the .csproj file. for the issue there is already a question with answers her https://stackoverflow.com/questions/49432666/project-file-is-incomplete-expected-imports-are-missing hope some of them will help – markorial Dec 03 '18 at 10:15
  • also try to build from cli once before trying to open in vs2017 it might solve it the build command is dotnet build from the folder where the .csproj file is – markorial Dec 03 '18 at 10:16
  • The build from cli was successful. – Arinba Dec 03 '18 at 10:31
  • I have just one path variable: C\Program Files\dotnet\. I have uninstalled and installed the sdk. I also tried to repair it. – Arinba Dec 03 '18 at 10:54
  • the only thing remaining would be sdk mismatch however strange it may seem. check dotnet --version to the version in your .csprojfile and global.json file in the project – markorial Dec 03 '18 at 11:06
  • In my .csprojfile the AspNetCore.Razor.Design Version is 2.1.2 and in my cli the version info is 2.1.5. The TargetFramework Version is coreapp 2.1. The global.json file does not exist in my project. On my local Installation it's the same and it works. – Arinba Dec 03 '18 at 11:27
0

You have to install dotnet core sdk

https://learn.microsoft.com/en-us/aspnet/core/tutorials/first-web-api?view=aspnetcore-2.1

Here is how you can create the project from CLI

Mihir Dave
  • 3,954
  • 1
  • 12
  • 28
0

The path variable was corrupt. I figured out with Rapid Environment Editor that one of my environment variables contained a character which could not be interpreted. The corrupt environment variable was listed before the dotnet variable.

Arinba
  • 31
  • 1
  • 4
0

I have been experienced the same issue.

  • visual studio 2017
  • .NET Core SDK 2.2.401

=> new .net web app ends up in empty solution

FIX: Install .NET Core SDK 2.2.1n

Vojta
  • 1,060
  • 13
  • 11
0

I faced the same issue, updating visual studio 2017 from vs version 15.8 to 15.9 solve my problem I hope this could help others

remonsam
  • 19
  • 2
0

I was using using Visual studio 2017 enterprise(15.7.x) after updating it to latest version(15.9.16) it worked for me.

Rakeshkumar Das
  • 135
  • 1
  • 5
0

This issue has been resolved by the following step.

  1. Uninstalled all the versions of .dotnet sdk and runtime installations from pgms and features
  2. Also run the following power shell script to double check the instillation process. https://www.hanselman.com/blog/ScriptsToRemoveOldNETCoreSDKs.aspx

    $app = Get-WmiObject -Class Win32_Product | Where-Object { $.Name -match "Microsoft .NET Core SDK" } Write-Host $app.Name Write-Host $app.IdentifyingNumber pushd $env:SYSTEMROOT\System32 $app.identifyingnumber |% { Start-Process msiexec -wait -ArgumentList "/x $" } popd

  3. Delete dotnet folder from C:\Program Files

  4. Restart the machine.Verify in ctrlpanel>progmsnfeatures there is no .dotnet core [runtime/sdk]installations

  5. From ctrlpanel>progmsnfeatures >open visual studio 2017 for modification ,uncheck the .net core and click Modify and then again check it and click Modify.Restart machine.

  6. Open a new .net core project. Now you will be able see the projects under the solution.

EduardoUstarez
  • 603
  • 11
  • 22