dotnet core user-secrets executable mysteriously missing, why? - .net-core

Installed the most recent (I think) .NET Core, created a .NET Core web project via Visual Studio 2015, and tried to start using user secrets. The CLI claims it is missing (after claiming to have installed it...), as below:
E:\Projects\CodeServer>dotnet --version
1.0.0-preview1-002702
E:\Projects\CodeServer>dotnet restore
<snip>
log : Restoring packages for tool 'Microsoft.Extensions.SecretManager.Tools' in E:\Projects\CodeServer\src\CodeServer\project.json...
<snip>
log : Restore completed in 2345ms.
NuGet Config files used:
C:\Users\Work User\AppData\Roaming\NuGet\NuGet.Config
C:\ProgramData\nuget\Config\Microsoft.VisualStudio.Offline.config
Feeds used:
https://api.nuget.org/v3/index.json
C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\
E:\Projects\CodeServer>dotnet user-secrets -h
No executable found matching command "dotnet-user-secrets"
E:\Projects\CodeServer>
Also adding the project.json file per request:
{
"userSecretsId": "<snip>",
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0-rc2-3002702",
"type": "platform"
},
"Microsoft.AspNetCore.Authentication.Cookies": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Diagnostics": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.0.0-preview1-final",
"type": "build"
},
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final",
"Microsoft.AspNetCore.StaticFiles": "1.0.0-rc2-final",
"Microsoft.EntityFrameworkCore.SqlServer": "1.0.0-rc2-final",
"Microsoft.EntityFrameworkCore.Tools": {
"version": "1.0.0-preview1-final",
"type": "build"
},
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc2-final",
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-final",
"Microsoft.Extensions.Configuration.UserSecrets": "1.0.0-rc2-final",
"Microsoft.Extensions.Logging": "1.0.0-rc2-final",
"Microsoft.Extensions.Logging.Console": "1.0.0-rc2-final",
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-final",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-rc2-final",
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
"version": "1.0.0-preview1-final",
"type": "build"
},
"Microsoft.VisualStudio.Web.CodeGenerators.Mvc": {
"version": "1.0.0-preview1-final",
"type": "build"
},
"Microsoft.AspNetCore.Authentication.Google": "1.0.0-rc2-final"
},
"tools": {
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.0.0-preview1-final",
"imports": "portable-net45+win8+dnxcore50"
},
"Microsoft.AspNetCore.Server.IISIntegration.Tools": {
"version": "1.0.0-preview1-final",
"imports": "portable-net45+win8+dnxcore50"
},
"Microsoft.EntityFrameworkCore.Tools": {
"version": "1.0.0-preview1-final",
"imports": [
"portable-net45+win8+dnxcore50",
"portable-net45+win8"
]
},
"Microsoft.Extensions.SecretManager.Tools": {
"version": "1.0.0-preview1-final",
"imports": "portable-net45+win8+dnxcore50"
},
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
"version": "1.0.0-preview1-final",
"imports": [
"portable-net45+win8+dnxcore50",
"portable-net45+win8"
]
}
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dotnet5.6",
"dnxcore50",
"portable-net45+win8"
]
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"gcServer": true
},
"publishOptions": {
"include": [
"wwwroot",
"Views",
"appsettings.json",
"web.config"
]
},
"scripts": {
"prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ],
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}

When using any of the tools packages defined in the tools section of your project.json file, you must use them from the same directory that contains the project.json file.
For example, your project.json file is in E:\Projects\CodeServer\src\CodeServer\project.json, but you are trying to execute the command from E:\Projects\CodeServer. If you change to the E:\Projects\CodeServer\src\CodeServer\ directory before attempting to use the tools, the commands will then work.

I have found that the package manager console is sometimes (or all the time for) is unable to use the correct directory (even if it is selected in the default project dropdown). If you first execute the command 'cd src\YourProjectName' and then e.g. 'dotnet user-secrets -h' (for help) you should be able to use the user-secrets tool.

The accepted answer to this question is correct but the project.JSON file doesn't exist anymore. (Visual Studios 2017 and .Net Core 2.1) It has been replaced by a "your-app-name".csproj file. Reference: there is no project.json, global.json ... etc on .NET Core Solution with Visual Studio 2017

Related

How to compile code on the fly in asp.net core?

I m create one application in asp.net core using visual studio 2015.(.net core version:1.0.1) when I do any change in cs file then save file and refresh browser my code changes is not reflected in the browser.So how can I get the reflection of code on the fly?
project.json
{
"compilationOptions": {
"emitEntryPoint": true
},
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.1",
"type": "platform"
},
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
"Microsoft.AspNetCore.Mvc": "1.0.1",
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.0.0-preview2-final",
"type": "build"
},
"Microsoft.AspNetCore.Routing": "1.0.1",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.1",
"Microsoft.AspNetCore.StaticFiles": "1.0.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Logging": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.Extensions.Logging.Debug": "1.0.0",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0",
//"Microsoft.VisualStudio.Web.CodeGenerators.Mvc": "1.0.0-preview2-final",
//"Microsoft.VisualStudio.Web.CodeGeneration.Tools": "1.0.0-preview2-final",
"Microsoft.VisualStudio.Web.CodeGenerators.Mvc": {
"version": "1.0.0-preview2-final",
"type": "build"
},
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
"version": "1.0.0-preview2-final",
"imports": [
"portable-net45+win8"
]
},
//Database Provider for EF Core
"Microsoft.EntityFrameworkCore.SqlServer": "1.0.1",
//EF Core Package Manager Console Tools
//"Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final",
//EF Core Funtionality for MSSQL Server
"Microsoft.EntityFrameworkCore.SqlServer.Design": "1.0.1",
"Microsoft.EntityFrameworkCore.Design": "1.0.0-preview2-final"
},
"tools": {
"BundlerMinifier.Core": "2.0.238",
"Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final",
"Microsoft.DotNet.Watcher.Tools": {
// "version": "1.0.0-preview2-final",
"version": "1.0.0-*",
"imports": "portable-net451+win8"
},
"Microsoft.EntityFrameworkCore.Tools": {
"version": "1.0.0-preview2-final",
"imports": [
"portable-net45+win8+dnxcore50",
"portable-net45+win8"
]
},
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
"version": "1.0.0-preview2-final",
"imports": [
"portable-net45+win8"
]
}
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dotnet5.6",
"portable-net45+win8"
]
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true,
"debugType": "portable"
},
"runtimes": {
"win10-x64": {},
"osx.10.10-x64": {},
"ubuntu.14.04-x64": {}
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},
"publishOptions": {
"include": [
"wwwroot",
"**/*.cshtml",
"appsettings.json",
"web.config"
]
},
"scripts": {
"prepublish": [ "bower install", "dotnet bundle" ],
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}
There is no such thing, really, as 'compile code on the fly'.
The only thing that microsoft offers is to recompile a whole project/assembly on change of a file. This can be done with dotnet watch run. This is a tool that watches the file-system for changes (done quite poorly so) and then shuts down the dotnet process and re-runs the dotnet start to startup the process again.
I have to say this is very sluggish and impossible to use in big projects.
My advice would be to implement your own watcher. and instead make it build to a different directory each time, so you can stop the current process only after a successful build of the project (and start this new successful build). You could do this with a simple node script or python script.
Simple script looks like this:
Watches a directory for changes on *.cs files
Watcher contains a callback that runs dotnet build -o /TempDir
After this process gave exit code 0 (means it was successful)
Kill the old process
run dotnet run /Tempdir/your.dll to start the new process

Using Entity Core with VS 2015 with .NET Core

I am using Visual Studio 2015. And I am develop app with Entity.Core.
But I am getting error while using Add-migration command.
I identified my models.
But getting error using the command "Add-migration TestDb" with Nuget Package Console.
Startup project 'src\WebApplication1' is an ASP.NET Core or .NET Core
project for Visual Studio 2015. This version of the Entity Framework
Core Package Manager Console Tools doesn't support these types of
projects.
How can I solve it.
And I don't want to Visual Studio 2017. Please do not recommend that.
The same operations I can do on my other computer.
I've update my question with project.json.
{
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.1",
"type": "platform"
},
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.1",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.EntityFrameworkCore.Tools": "1.1.0",
"Microsoft.EntityFrameworkCore": "1.1.1",
"Microsoft.EntityFrameworkCore.SqlServer": "1.1.1"
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dotnet5.6",
"portable-net45+win8"
]
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},
"publishOptions": {
"include": [
"wwwroot",
"web.config"
]
},
"scripts": {
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}
Docs for EF Core: https://learn.microsoft.com/en-us/ef/core/
Make sure you read the documentation.
So you are getting that error probably for 2 reasons:
1)In your project.json file make sure you have EntityFrameworkCore.Design/Tools added in you dependencies and EntityFrameworkCore.Tools in your tools.
"dependencies": {
"Microsoft.EntityFrameworkCore": "1.1.0",
"Microsoft.EntityFrameworkCore.SqlServer": "1.1.0",
"Microsoft.EntityFrameworkCore.Design": "1.0.0-preview2-final",
"Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final",
"Microsoft.NETCore.App": {
"version": "1.0.1",
"type": "platform"
}.
"tools": {
"Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final",
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
},
2) Once you sorted the above issue this will allow you to use the appropriate commands in your cli (PM Console) make sure you are in the project directory:
Create Migration: dotnet ef migrations add <name>
Update Database: dotnet ef database update
I've got the same error on PM> Update-Database. If you have the latest version of Microsoft.EntityFrameworkCore.Tools (1.1.1 is the latest stable version when I posted this answer) and you are using VS2015, try to downgrade to
Microsoft.EntityFrameworkCore.Tools 1.1.0-preview4-final
Install from package manager : Install-Package Microsoft.EntityFrameworkCore.Tools -Version 1.1.0-preview4-final -Pre
My package.json looks like this :
{
"dependencies": {
"Microsoft.AspNetCore.Diagnostics": "1.1.2",
"Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.1.2",
"Microsoft.AspNetCore.Mvc": "1.1.3",
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.2",
"Microsoft.AspNetCore.Server.Kestrel": "1.1.2",
"Microsoft.AspNetCore.StaticFiles": "1.1.2",
"Microsoft.EntityFrameworkCore.Design": "1.1.2",
"Microsoft.EntityFrameworkCore.SqlServer": "1.1.2",
"Microsoft.EntityFrameworkCore.Tools": "1.1.0-preview4-final",
"Microsoft.Extensions.Logging.Console": "1.1.2",
"Microsoft.NETCore.App": {
"version": "1.1.2",
"type": "platform"
}
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dotnet5.6",
"portable-net45+win8"
]
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},
"publishOptions": {
"include": [
"wwwroot",
"web.config"
]
},
"scripts": {
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}
Hope it helps anyone.

dotnet-ef commands not recognized in asp.net core 1.1

This is the project.json of my project. I have updated the dependencies to 1.1.
{
"dependencies": {
"BundlerMinifier.Core": "2.4.337",
"Microsoft.AspNetCore.Authentication.Cookies": "1.1.1",
"Microsoft.AspNetCore.Diagnostics": "1.1.1",
"Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.1.1",
"Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.1.1",
"Microsoft.AspNetCore.Mvc": "1.1.2",
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.1.0-preview4-final",
"type": "build"
},
"Microsoft.AspNetCore.Routing": "1.1.1",
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.1",
"Microsoft.AspNetCore.Server.Kestrel": "1.1.1",
"Microsoft.AspNetCore.StaticFiles": "1.1.1",
"Microsoft.EntityFrameworkCore.SqlServer": "1.1.1",
"Microsoft.EntityFrameworkCore.SqlServer.Design": {
"version": "1.1.1",
"type": "build"
},
"Microsoft.EntityFrameworkCore.Tools": {
"version": "1.1.0",
"type": "build"
},
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.1",
"Microsoft.Extensions.Configuration.Json": "1.1.1",
"Microsoft.Extensions.Configuration.UserSecrets": "1.1.1",
"Microsoft.Extensions.Logging": "1.1.1",
"Microsoft.Extensions.Logging.Console": "1.1.1",
"Microsoft.Extensions.Logging.Debug": "1.1.1",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.1.1",
"Microsoft.NETCore.App": {
"version": "1.1.1",
"type": "platform"
},
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.1.0",
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
"version": "1.1.0-preview4-final",
"type": "build"
},
"Microsoft.VisualStudio.Web.CodeGenerators.Mvc": {
"version": "1.1.0",
"type": "build"
}
},
"tools": {
"BundlerMinifier.Core": "2.4.337",
"Microsoft.AspNetCore.Razor.Tools": "1.1.0-preview4-final",
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.1.0-preview4-final",
"Microsoft.EntityFrameworkCore.Tools": "1.1.0",
"Microsoft.EntityFrameworkCore.Tools.DotNet": "1.0.0",
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
"version": "1.1.0-preview4-final",
"imports": [
"portable-net45+win8"
]
}
},
"frameworks": {
"netcoreapp1.1": {
"imports": [
"dnxcore50",
"dotnet5.6",
"portable-net45+win8"
]
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},
"publishOptions": {
"include": [
"wwwroot",
"**/*.cshtml",
"appsettings.json",
"web.config"
]
},
"scripts": {
"prepublish": [ "bower install", "dotnet bundle" ],
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}
The migrations were working fine before. I created Migrations and created the database in SQL Server. Now when I try to create a migration, I am getting this error.
dotnet-ef : The term 'dotnet-ef' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.
At line:1 char:1
+ dotnet-ef
+ ~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (dotnet-ef:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
I tried some solutions in the internet, but still getting the error. Am I missing any packages?
Run dotnet-ef via Powershell instead of Package Manager console. Or, change the current directory to the project directory (using cd) within Package Manager Console.
Also, ensure the Entity Framework Tools package is installed
see this page

Asp.net core on linux - dotnet ef database update fails with version error

Just followed the install instructions on https://www.microsoft.com/net/core#linuxubuntu and https://learn.microsoft.com/en-us/aspnet/core/getting-started
Everything is fine so far, except when creating a new user under http://localhost:5000/Account/Register it fails with
SQLite Error 'no such table: AspNetUsers'
Tried with dotnet ef database update to create the table structure but it fails with version errors.
Now I got lost with all the different versions in the project.json, when to use 1.1.0 and when 1.0.0, when should it be preview1-final preview2-final preview3-final or even better preview2-update1
project.json out of the box after dotnet new -t web
{
"userSecretsId": "aspnet-WebApplication-0799fe3e-6eaf-4c5f-b40e-7c6bfd5dfa9a",
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.1.0-preview1-001153-00",
"type": "platform"
},
"Microsoft.AspNetCore.Authentication.Cookies": "1.0.0",
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
"Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.0.0",
"Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0",
"Microsoft.AspNetCore.Mvc": "1.0.1",
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.0.0-preview2-final",
"type": "build"
},
"Microsoft.AspNetCore.Routing": "1.0.1",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.1",
"Microsoft.AspNetCore.StaticFiles": "1.0.0",
"Microsoft.EntityFrameworkCore.Sqlite": "1.0.1",
"Microsoft.EntityFrameworkCore.Tools": {
"version": "1.0.0-preview2-final",
"type": "build"
},
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Configuration.UserSecrets": "1.0.0",
"Microsoft.Extensions.Logging": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.Extensions.Logging.Debug": "1.0.0",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0",
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
"version": "1.0.0-preview2-update1",
"type": "build"
},
"Microsoft.VisualStudio.Web.CodeGenerators.Mvc": {
"version": "1.0.0-preview2-update1",
"type": "build"
}
},
"tools": {
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.0.0-preview2-final",
"imports": "portable-net45+win8+dnxcore50"
},
"Microsoft.AspNetCore.Server.IISIntegration.Tools": {
"version": "1.0.0-preview2-final",
"imports": "portable-net45+win8+dnxcore50"
},
"Microsoft.EntityFrameworkCore.Tools": {
"version": "1.0.0-preview2-final",
"imports": [
"portable-net45+win8+dnxcore50",
"portable-net45+win8"
]
},
"Microsoft.Extensions.SecretManager.Tools": {
"version": "1.0.0-preview2-final",
"imports": "portable-net45+win8+dnxcore50"
},
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
"version": "1.0.0-preview2-final",
"imports": [
"portable-net45+win8+dnxcore50",
"portable-net45+win8"
]
}
},
"frameworks": {
"netcoreapp1.1": {
"imports": [
"dotnet5.6",
"dnxcore50",
"portable-net45+win8"
]
}
},
"buildOptions": {
"debugType": "portable",
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},
"publishOptions": {
"include": [
"wwwroot",
"**/*.cshtml",
"appsettings.json",
"web.config"
]
},
"scripts": {
"prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ],
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
},
"tooling": {
"defaultNamespace": "WebApplication"
}
}
Asp.net core - no such table: AspNetUsers and seems similar but it is windows.
How to update project.json to get the initial ASP.net core template working with saving to SQlite? Or is anything else missing regarding SQlite on Ubuntu? libsqlite3-0:amd64 in version 3.14.1-1build1 is installed...
I had this same issue while I was developing on a MAC and deploying to Debian. I ended up copying the database file from my development machine to the production server. If you inspect the database file that was produced from the publish command it is empty. Hope this helps you!
With the latest bits (1.0.0-rc4-004777) from github and some help on github (EF Core Tools Bug Bash #7358) I got a solution
wget https://dotnetcli.blob.core.windows.net/dotnet/Sdk/rel-1.0.0/dotnet-dev-ubuntu.16.04-x64.latest.tar.gz
sudo mkdir /opt/dotnet
sudo tar zxvf dotnet-dev-ubuntu.16.04-x64.latest.tar.gz -C /opt/dotnet
sudo ln -s /opt/dotnet/dotnet /usr/local/bin
mkdir testweb
cd testweb
dotnet new mvc --auth Individual
dotnet restore
Edit the .csproj and add
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet"
Version="1.0.0-msbuild3-final" />
</ItemGroup>
After saving the .csproj you will be able to create the database and the template will run fine.
dotnet restore
dotnet ef database update
dotnet run
With all the above it is possible now running the template under Linux and create users and log in http://localhost:5000/Account/Register and the EntityFrameworkCore stores to sqlite.

.Net Core 1.1.0 Visual Studio Tooling

I've just migrated a asp.net core project from 1.0.1 to 1.1.0 and when running dotnet run or dotnet restore I get the following message
C:\Users\you\Desktop\API\src\API\API.xproj(7,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\1.0.0-preview4-004110\Extensions\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
I've installed all the SDK and runtimes, but still can't neither create .Net Core 1.1.0 projects in visual studio nor restore in console my packages.
The project.json is as follows, supposedly the migration is right, but still can't figure it out.
{
"version": "1.0.0-*",
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.1.0",
"type": "platform"
},
"Microsoft.ApplicationInsights.AspNetCore": "1.0.0",
"Microsoft.AspNetCore.Mvc": "1.0.1",
"Microsoft.AspNetCore.Routing": "1.0.1",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.1",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
"Microsoft.Extensions.Configuration.FileExtensions": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Logging": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.Extensions.Logging.Debug": "1.0.0",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
"Business.Handlers": "1.0.0-*",
"Business.Connectors": "1.0.0-*",
"Common": "1.0.0-*",
"DataAccessLayer": "1.0.0-*"
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
},
"frameworks": {
"netcoreapp1.1": {
"imports": [
"dotnet5.6",
"portable-net45+win8"
]
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},
"publishOptions": {
"include": [
"wwwroot",
"Views",
"Areas/**/Views",
"appsettings.json",
"web.config"
]
},
"scripts": {
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}
The problem was in the global.json of my solution the version property, I had it changed to 1.0.0-preview2-1-003177 and it worked.
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-preview2-1-003177" //Previously 1.0.0-preview2-003131
}
}
You need to download .NET Core 1.1 SDK - Installer from Microsoft website. If you can download only runtime as well. Below is the url for the same.
https://www.microsoft.com/net/download/core
Please see image below for more details.
.net core 1.1.0
Regards,
Sachin Pawar

Resources