Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

New templated project fails build in console

$
0
0

Hi.

I just created a new project using Visual Studio 2017, on the template 'ASP.NET Core MVC application' + Individual User Account Authentication.

The project builds perfectly in Visual Studio, but in the console I can't build. I want to build in console so I can run migrations and get used to working with the CLI instead of VS.

dotnet restore works fine:

C:\Users\dat\Source\Repos\WarInText\WarInText>dotnet restore
  Restore completed in 81,34 ms for C:\Users\dat\Source\Repos\WarInText\WarInTex
t\WarInText.csproj.
  Restore completed in 84,27 ms for C:\Users\dat\Source\Repos\WarInText\WarInTex
t\WarInText.csproj.
  Restore completed in 87,41 ms for C:\Users\dat\Source\Repos\WarInText\WarInTex
t\WarInText.csproj.
  Restore completed in 67,17 ms for C:\Users\dat\Source\Repos\WarInText\WarInTex
t\WarInText.csproj.

dotbet build fails:

C:\Users\dat\Source\Repos\WarInText\WarInText>dotnet build

Microsoft (R) Build Engine version 15.3.388.41745 for .NET Core Copyright (C) Microsoft Corporation. All rights reserved.

CSC : error CS2001: Source file 'C:\Windows\System32\Models\ManageViewModels\ChangePasswordViewModel.cs' could not be found. [C:\Users\dat\Source\Repos\WarInTex t\WarInText\WarInText.csproj] CSC : error CS2001: Source file 'C:\Windows\System32\Program.cs' could not be fo und. [C:\Users\dat\Source\Repos\WarInText\WarInText\WarInText.csproj] CSC : error CS2001: Source file 'C:\Windows\System32\Controllers\HomeController. cs' could not be found. [C:\Users\dat\Source\Repos\WarInText\WarInText\WarInText .csproj] CSC : error CS2001: Source file 'C:\Windows\System32\Controllers\AccountControll er.cs' could not be found. [C:\Users\dat\Source\Repos\WarInText\WarInText\WarInT ext.csproj] CSC : error CS2001: Source file 'C:\Windows\System32\Models\AccountViewModels\Fo rgotPasswordViewModel.cs' could not be found. [C:\Users\dat\Source\Repos\WarInTe xt\WarInText\WarInText.csproj] CSC : error CS2001: Source file 'C:\Windows\System32\Models\ManageViewModels\Con figureTwoFactorViewModel.cs' could not be found. [C:\Users\dat\Source\Repos\WarI nText\WarInText\WarInText.csproj] CSC : error CS2001: Source file 'C:\Windows\System32\Services\IEmailSender.cs' c ould not be found. [C:\Users\dat\Source\Repos\WarInText\WarInText\WarInText.cspr oj]

...... and so on for several files.

It appears it looks for the files in C:\Windows\System32, instead of the local folder I run the command in. It doens't matter whether I open the Developer Command Prompt internally in Visual Studio or externally. I get the same error using an ordinary CMD.exe opened with admin rights. 

I cannot find any system variable that points dotnet core CLI to System32, and that would be slightly bizarre behaviour even if I could.

Is there a way I can work around this and force dotnet to look for files in the local folder? I've had other dotnet core projects build fine from console, so things should be setup correctly on my computer.


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>