You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you create a project in a directory with a solution, you would expect the project to be added to the solution, because 99% of the time you'll only have one solution and all projects should belong to the solution.
If there are multiple solution files, a warning should be emitted informing the user that they should manually add the project to the desired solutions using dotnet sln [solution file] add [project file].
Steps to reproduce
mkdir foo
cd foo
dotnet new sln --name MySolution
dotnet new console --name MyConsoleApp
dotnet restore
Expected behavior
Restoring packages for /home/dhasenan/Projects/foo/MyConsoleApp/MyConsoleApp.csproj...
Generating MSBuild file /home/dhasenan/Projects/foo/MyConsoleApp/obj/MyConsoleApp.csproj.nuget.g.props.
Generating MSBuild file /home/dhasenan/Projects/foo/MyConsoleApp/obj/MyConsoleApp.csproj.nuget.g.targets.
Writing lock file to disk. Path: /home/dhasenan/Projects/foo/MyConsoleApp/obj/project.assets.json
Restore completed in 362.23 ms for /home/dhasenan/Projects/foo/MyConsoleApp/MyConsoleApp.csproj.
NuGet Config files used:
/home/dhasenan/.nuget/NuGet/NuGet.Config
Feeds used:
https://api.nuget.org/v3/index.json
Actual behavior
/usr/share/dotnet/sdk/1.0.1/NuGet.targets(97,5): warning : Unable to find a project to restore! [/home/dhasenan/Projects/foo/MySolution.sln]
Environment data
dotnet --info output:
.NET Command Line Tools (1.0.1)
Product Information:
Version: 1.0.1
Commit SHA-1 hash: 005db40cd1
Runtime Environment:
OS Name: ubuntu
OS Version: 16.04
OS Platform: Linux
RID: ubuntu.16.04-x64
Base Path: /usr/share/dotnet/sdk/1.0.1
The text was updated successfully, but these errors were encountered:
@mlorbetske as this probably would have to happen in the template engine.
I am not sure this is the right thing to do by default. Maybe we add a flag that let's you say add to sln file. Or it also accepts a path to an sln file. But then, what happens when a sln file does not exist and you use the flag, should it fail? Warn?
Due to lack of recent activity, this issue has been labeled as 'stale'. It will be closed if no further activity occurs within 30 more days. Any new comment will remove the label.
When you create a project in a directory with a solution, you would expect the project to be added to the solution, because 99% of the time you'll only have one solution and all projects should belong to the solution.
If there are multiple solution files, a warning should be emitted informing the user that they should manually add the project to the desired solutions using
dotnet sln [solution file] add [project file]
.Steps to reproduce
Expected behavior
Actual behavior
Environment data
dotnet --info
output:The text was updated successfully, but these errors were encountered: