问题
I'm developing an ASP.NET 5 MVC 6 solution.
Unfortunately I can't remember what happened but I'm getting a strange issue where the IDE doesn't build solution.
When I hit Ctrl+Shift+B the following line appears in the output console:
1>------ Build started: Project: <My project name>, Configuration: Debug Any CPU ------
but nothing actually happens, and I can't close solution until I'd press Ctrl+Break to cancel build.
I'm however noticing a few strange things.
- The References section of the project is followed by (Errors - see Error List), but no errors appear in the Error List.
- In the Package Manager Console, no projects are present in the Default Project dropdown, and the Package Manager does complain about it.
- The Debug menu contains no options but Start and Browse With, and when I hit Start, I get an error message saying:
The debugger cannot continue running the process. Unable to start debugging.
- Running 'Restore Packages' (Ctrl+Shift+K+R) doesn't do anything either.
- When trying
update-package -reinstall
command in the PM console, I get the following error:No package updates are available from the current package source for project 'Ackount'.
Unfortunately I can't remember precisely what I changed before it happened so I can't reproduce the issue.
回答1:
I had a similar problem with asp.net 5 beta 8. I removed the DNX Core target, because i am only interested in dnx451 for this particular project, but after doing that it wouldn't build anymore. It just froze. I tried dnu restore, but it didn't seem to do anything.
In my case, i just removed the project from the solution then did a rebuild. I then added the project back to the solution, did another rebuild, and then for no obvious logical reason it started to build properly again - weird :)
回答2:
Here's what I've done and help me solve the issue, based on the comments of Victor Hurdugaci.
- I've updated to the latest ASP.NET and Web Tools beta6.
- In a new command line, cding to my solution folder I've ran the command
dnu restore
.
Now it works and build like a charm.
来源:https://stackoverflow.com/questions/32131768/asp-net-5-on-vs-2015-cant-build-or-debug-solution