I attempted to create a new project using the yeoman generator, however when i then move into the folder to restore the dependencies I encounter an error.
I start in an empty directory then execute the following
yo aspnetcore-spa (select the Aurelia framework and .csproj project type)
dotnet restore
I get the following error
warn : The folder '<path>/projFolder' does not contain a project to restore.
.NET Core projects using csproj require at least .NET Core CLI Preview 3. Double check which version is being used by running dotnet --info
. If it is 1.0.0-preview2 or 1.0.0-preview2-1, it does not support csproj.
At the time of writing, the SDKs that support csproj are not listed on the main .NET Core download page. The latest is the RC3 release of .NET Core CLI.
https://github.com/dotnet/core/blob/master/release-notes/rc3-download.md
If you have installed the new SDK and dotnet --info
still shows an older version, check for a global.json file in the current directory or any parent directories and make sure the "sdk" setting has the right version. The aspnetcore-spa generated creates a global.json file with SDK 1.0.0-preview3-004056, which is not the latest SDK.
Just update your dotnet-core-framework-version.
I fixed this by doing:
apt-get remove dotnet-dev-1.0.0-preview2-1-003177
apt-get install dotnet-dev-1.0.0-rc4-004771
Then:
dotnet restore
worked.
Then, you must reinstall the framework 1.1.1:
apt-get install dotnet-sharedframework-microsoft.netcore.app-1.1.1
(currently [22.03.2017], Visual Studio 2017 will use .NET Core 1.1.1 when it does publish)
Also, when you run a published project, it's
dotnet yourdll.dll
and not
dotnet run yourdll.dll
Edit:
Just one day later, and you might want to
apt-get install dotnet-dev-1.0.1
instead of rc4. You can then skip sharedframework, as sharedframework 1.1.1 gets installed automatically with dotnet-dev-1.0.1.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With