The build failed. Please fix the build errors and run again.
See original GitHub issueHi, @dotnet
It does work with dotnet run
in my VM/Debian 9. But It can be running with docker run -v /example/mysource/:/source etc... microsoft/aspnetcore-build:1.0-2.0 ...
with the docker image microsoft/aspnetcore-build:1.0-2.0
.
The command dotnet build -f netcoreapp2.0
works well without any output. However the command dotnet run -f netcoreapp2.0
run with an error message The build failed. Please fix the build errors and run again.
. It was confuse to me, What’s the problem?
error
$ dotnet build -f netcoreapp2.0
$ dotnet run -f netcoreapp2.0
The build failed. Please fix the build errors and run again.
$
environment
$ dotnet --info
.NET Command Line Tools (2.0.2)
Product Information:
Version: 2.0.2
Commit SHA-1 hash: a04b4bf512
Runtime Environment:
OS Name: debian
OS Version: 9
OS Platform: Linux
RID: linux-x64
Base Path: /usr/share/dotnet/sdk/2.0.2/
Microsoft .NET Core Shared Framework Host
Version : 2.0.0
Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d
$ uname -a
Linux far-seer-01 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u5 (2017-09-19) x86_64 GNU/Linux
P.S The dotnet run
works well with a simple console application.
$ dotnet new console -o hwapp
Getting ready...
The template "Console Application" was created successfully.
Processing post-creation actions...
Running 'dotnet restore' on hwapp/hwapp.csproj...
Restoring packages for /tmp/hwapp/hwapp.csproj...
Generating MSBuild file /tmp/hwapp/obj/hwapp.csproj.nuget.g.props.
Generating MSBuild file /tmp/hwapp/obj/hwapp.csproj.nuget.g.targets.
Restore completed in 162.78 ms for /tmp/hwapp/hwapp.csproj.
Restore succeeded.
$ cd hwapp/
$ dotnet run
Hello World!
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:10 (1 by maintainers)
Top Results From Across the Web
when i run my code this error show up pls help: The build ...
i marked it now i have this error you know how to fix it:Type 'Program' already defines a member called 'Main' with the...
Read more >Dotnet Build Error
New install of Radzen on Server 2008 R2 machine. I can run the Sample CRUD App. I cannot run an app having a...
Read more >Build Errors while running CSharp Code (C#.Net - Session 12)
In this session, I have explained about Build Errors while running CSharp Code in Visual Studio IDE and the possible options to choose...
Read more >Fix program errors and improve code - Visual Studio ...
Rebuild your project by either pressing F7 again (to recompile only the files with errors) or Ctrl+Alt+F7 (for a clean and complete rebuild)....
Read more >Remove "There were build errors. Would you like to ...
In Visual Studio 2019 Update 16.5 or later you can go to Tools > Options > Projects and Solutions > Build and Run...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I closed down VS Code, and then reopened my program folder. It worked. I think my the program was stuck in a loop. ;/
@KelechiDivine I don’t know why I am getting an email about your comment 6 months late, but the only other suggestion I would have for this issue is to update VS Code, and restart. For the past 18 months I have been working with Java 8, Spring, Struts 2, and using IntelliJ IDE. Good luck for anyone that experiences this issue in the future!