Could not locate .NET Core project. Assets were not generated

别等时光非礼了梦想. 提交于 2021-02-10 13:16:29

问题


I just started learning C# a couple hours ago, but have since run into this error.

Ctrl + Shift + P

.NET:Generate Assets for Build and Debug

But when I click it, an error pops up bottom right of the window:

Could not locate .NET Core project. Assets were not generated.


回答1:


Restarting VS Code solved the problem in my case.




回答2:


This issue could be because the launch.json, which ideally should have been populated with the necessary details isn't generated in case. This issue seems to be linked to Omnisharp. If you go through the issue, you understand the root cause more clearly. You may need to perform the steps mentioned in this comment to get around the issue. These steps involve re-configuring the C# extension inside of your VS Code instance.

Alternately, ensure that all the folders which the extensions uses have appropriate access.

If the issue is also involving task.json, take a look at this answer




回答3:


In my way helped to change the folder name to a name without spaces.




回答4:


What I recommend doing is pressing "Run" then start debugging, which should open up a launch.json. If you open it, it will have about 17 warnings and then you can delete the warnings. Then, you press f5, which will give you an option to open a tasks.json. Do that and configure all of the tasks for running your project and it should work.



来源:https://stackoverflow.com/questions/63362319/could-not-locate-net-core-project-assets-were-not-generated

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!