Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Could not locate .NET Core project. Assets were not generated." #1425

Closed
Jonathan34 opened this issue Apr 25, 2017 · 7 comments

Comments

@Jonathan34
Copy link

commented Apr 25, 2017

Environment data

dotnet --info output:

dotnet --info
.NET Command Line Tools (1.0.1)

Product Information:
 Version:            1.0.1
 Commit SHA-1 hash:  005db40cd1

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.12
 OS Platform: Darwin
 RID:         osx.10.12-x64
 Base Path:   /usr/local/share/dotnet/sdk/1.0.1

VS Code version:
C# Extension version:

Version 1.12.0-insider (1.12.0-insider)
2017-04-25T06:53:33.728Z

C# 1.9.0

Steps to reproduce

  • have various .net core csproj and a main sln
  • one .net standard 1.6 project
  • cmd shift p > .net restore or .net build
    sometimes .net restore only finds the .net standard project (depending the active tab i guess?)

Expected behavior

.net restore acts the same as dotnet restore when ran in main folder (reads the sln)

Actual behavior

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

@DustinCampbell

This comment has been minimized.

Copy link
Collaborator

commented Apr 25, 2017

@Jonathan34: C# for VS Code doesn't provide .net restore or .net build commands. It does provide a .NET: Restore Packages command, but that lets you pick the project you want to restore. Could you clarify what command your picking? Do you have other extensions installed that might be providing these commands?

@DustinCampbell

This comment has been minimized.

Copy link
Collaborator

commented Apr 25, 2017

Also, the "Could not locate .NET Core project. Assets were not generated." is produced by C# for VS Code, but it doesn't have anything to do with dotnet restore. It's about generating tasks.json and launch.json files for your project.

It might be helpful if you could provide a project with precise steps that reproduce the issue. Thanks!

@Jonathan34

This comment has been minimized.

Copy link
Author

commented Apr 25, 2017

Thanks for the answer.

I am talking about these two commands:
image

It is ok if the .Net restore only restores for one project although a bit annoying. I was assuming it would behave like a dotnet restore. In my case, it only listed the .net standard project but after a restart of vscode it now lists the other (not sure what happened). so i guess this one is good.

As for the .Net generate assets... i do not have the message anymore after the restart, but it does not seem to run anything anymore. so i assume it tries to find a specific task in the tasks.json (i have a task named 'build')

@DustinCampbell

This comment has been minimized.

Copy link
Collaborator

commented Apr 25, 2017

Yes, it is a bit annoying that it makes you pick projects. It in fact does just do a dotnet restore, picking a project just tells it what folder to run into in. The experience needs revisiting to include .sln files. To get the experience you're looking for (for now), you can just open the Integrated Terminal in VS Code (Control+</kbd>) and type dotnet restore`.

"Generate Assets for Build and Debug" simply generates a build task in a tasks.json file (if one doesn't already exist) and debug configurations in a launch.json file (if one doesn't already exist). If these are already there, you won't get a prompt and the command won't do anything. The point of the command is to generate the assets if you've clicked "Don't Ask Again" on the prompt for this project.

@Jonathan34

This comment has been minimized.

Copy link
Author

commented Apr 25, 2017

yes i use dotnet restore right now from terminal.
ok i misunderstood the "Generate Assets for Build and Debug" command, i thought it would run dotnet build :).

we can close this ticket except if we want to improve the experience on restore with .sln.

@DustinCampbell

This comment has been minimized.

Copy link
Collaborator

commented Apr 25, 2017

How about I just repurpose this to track improving the experience?

@DustinCampbell

This comment has been minimized.

Copy link
Collaborator

commented Apr 25, 2017

Actually, nevermind. I had forgotten that I already have an issue tracking this: #240.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.