then add-migration
The specified deps.json [m\Dispatcher\m:\build\Dispatcher\Debug\netcoreapp1.0\Dispatcher.deps.json] does not exist
Process finished with non-zero exit code
Started after update to 1.1.0.
There was same issue when project name (path?) contains spaces. Deliberately copied project to root and have same issue.
Found. Happens when
specified to an exact folder.
setting
How did you solve it ?
Setting OutputPath to default, yes. But I rather have an option to change OutputPath
OutputPath in *.xproj file ?
"
Correct.
I usually build to RamDrive
Hmm interesting i have it as default value.
It is a default value and it is working fine.
<OutputPath Condition="'$(OutputPath)'=='' ">m:\somefolder</OutputPath>
not
I don't understand what meaning, whether can you tell about the steps?
What steps? How to change build output folder?
The specified deps.json [F:\Asp.NetCoreSourceCode\JiaJuProject\src\JiaJuApp\F:\Asp.NetCoreSourceCode\JiaJuProject\src\JiaJuApp\bin\Debug\netcoreapp1.0\JiaJuApp.deps.json] does not exist
I set up, but problems still exist
I did a new Dll and carefully added Nugets and it's okay, after i had the same issue. Something with packages maybe
I am not able to reproduce this issue.
I set output folder using absolute path in different drive. It works as expected by copying over bin etc to that folder & generating migrations.
[m\Dispatcher\m:\build\Dispatcher\Debug\netcoreapp1.0\Dispatcher.deps.json]
[F:\Asp.NetCoreSourceCode\JiaJuProject\src\JiaJuApp\F:\Asp.NetCoreSourceCode\JiaJuProject\src\JiaJuApp\bin\Debug\netcoreapp1.0\JiaJuApp.deps.json]
Above paths are incorrect. Can you share more details about project?
I had this issue twice. I have configure the *dll with Identity Server 4 with ASP.NET identity, added IdentityDbContext. After i did Add-Migration -> deps.json error.
Later i created a new asp.net core lib with Ef, doing everything from stretch and okay, migration has been done successfully.
I did also many experiments with Nuget Microsoft.EntityFramework.Tool.DotNet.
It don't want to install normally, I have added hard-coded in MSBuild and okay.
I can reproduce same issue (it happens during attempt to create models on existing db). And I can share a project if you need to reproduce it.
First I had an issue described in the http://stackoverflow.com/questions/37590604/can-not-find-runtime-target-for-framework-netcoreapp-v1-compatible-with-one-of
after suggested fix I've a problem described here. The issue I think is caused by the fact that *.deps.json is in win10-x64 folder inside output. And not directly in output.
@cspwizard - Please share the repro project.
@smitpatel here is the source code https://bitbucket.org/cspwizard/performancetestreporting/src
@cspwizard - I cloned that code and following powershell terminal. I am still not able to repro it.
D:\performancetestreporting [develop ≡]> dotnet restore
log : Restoring packages for D:\performancetestreporting\project.json...
log : Installing System.Collections.Specialized 4.3.0.
log : Installing Dapper 1.50.2.
log : Restoring packages for tool 'Microsoft.EntityFrameworkCore.Tools.DotNet' in D:\performancetestreporting\project.json...
log : Writing lock file to disk. Path: D:\performancetestreporting\project.lock.json
log : D:\performancetestreporting\project.json
log : Restore completed in 6682ms.
D:\performancetestreporting [develop ≡ +0 ~1 -0 !]> dotnet run
Project performancetestreporting (.NETCoreApp,Version=v1.0) will be compiled because expected outputs are missing
Compiling performancetestreporting for .NETCoreApp,Version=v1.0
Compilation succeeded.
0 Warning(s)
0 Error(s)
Time elapsed 00:00:02.3027595
Hosting environment: Production
Content root path: D:\performancetestreporting
Now listening on: http://localhost:5000
Application started. Press Ctrl+C to shut down.
Application is shutting down...
D:\performancetestreporting [develop ≡ +0 ~1 -0 !]> dotnet ef
Project performancetestreporting (.NETCoreApp,Version=v1.0) was previously compiled. Skipping compilation.
_/\__
---==/ \\
___ ___ |. \|\
| __|| __| | ) \\\
| _| | _| \_/ | //|\\
|___||_| / \\\/\\
Entity Framework Core Console Commands 1.1.0-preview4-22752
Usage: ef.dll [options] [command]
Options:
-h|--help Show help information
--version Show version information
--verbose Show verbose output
--no-color Do not use color in console output
--assembly <assembly> The assembly file to load.
--startup-assembly <assembly> The assembly file containing the startup class.
--data-dir <dir> The folder used as the data directory (defaults to current working directory).
--project-dir <dir> The folder used as the project directory (defaults to current working directory).
--content-root-path <dir> The folder used as the content root path for the application (defaults to application base directory).
--root-namespace <namespace> The root namespace of the target project (defaults to the project assembly name).
-e|--environment <environment> The environment to use. If omitted, "Development" is used.
Commands:
database Commands to manage your database
dbcontext Commands to manage your DbContext types
migrations Commands to manage your migrations
Use "ef.dll [command] --help" for more information about a command.
D:\performancetestreporting [develop ≡ +0 ~1 -0 !]> dotnet ef migrations add test
Project performancetestreporting (.NETCoreApp,Version=v1.0) was previously compiled. Skipping compilation.
No DbContext was found in assembly 'performancetestreporting'. Ensure that you're using the correct assembly and that the type is neither abstract nor generic.
@smitpatel I'm using VS 2015 Package manager console and get this error:
Scaffold-DbContext "Server=sql;Database=LoadTest2010;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models
The specified deps.json [C:\Work\WA\WildApricot.PerformanceTestReport\bin\Debug\netcoreapp1.0\WildApricot.PerformanceTestReport.deps.json] does not exist
Process finished with non-zero exit code
I'll try to do this via powershell, maybe there would be a difference.
@cspwizard - I hit the same exception. Thanks for repro code.
@bricelam - There is something going on inside GetOutputPath. We are not adding runtimes if specified if it is not .NET Framework.
If this is helpful, when my app builds, I end up with 2 copies of Website.[dll,pdb], one in bin\Debug\netcoreapp1.0 and one in bin\Debug\netcoreapp1.0\win10-x64. The former folder only contains those 2 files and the win10-x64 subfolder. The latter contains other stuff, including Website.deps.json.
The Update-Database command is looking in the former path but not the latter, error:
The specified deps.json [<full parent path>\bin\Debug\netcoreapp1.0\Website.deps.json] does not exist
Question: why are output dll and pdb file ending up in two places and is that causing the .deps lookup to fail?
Thought maybe .net core 1.0 / 1.1 inconsistency was the issue, so updated project.json file to 1.1, still same error (with 1.1 in the paths). Here's the relevant bit of my project.json:
"dependencies": {
"Microsoft.NETCore.App": "1.1.0",
"Microsoft.AspNetCore.Mvc": "1.1.0",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.1.0",
"Microsoft.VisualStudio.Web.CodeGenerators.Mvc": "1.1.0-preview4-final",
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": "1.1.0-preview4-final",
"Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.1.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
"Microsoft.Extensions.Logging.Console": "1.1.0",
"Microsoft.AspNetCore.Diagnostics": "1.1.0",
"Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.1.0",
"Microsoft.AspNetCore.StaticFiles": "1.1.0",
"Microsoft.Extensions.Configuration.FileExtensions": "1.1.0",
"Microsoft.Extensions.Configuration.Json": "1.1.0",
"Microsoft.Extensions.Configuration.UserSecrets": "1.1.0",
"Microsoft.Extensions.Logging.Debug": "1.1.0",
"Microsoft.EntityFrameworkCore": "1.1.0",
"Microsoft.EntityFrameworkCore.Design": "1.1.0",
"Microsoft.EntityFrameworkCore.SqlServer": "1.1.0",
"Microsoft.EntityFrameworkCore.Tools": "1.1.0-preview4-final"
},
"tools": {
"Microsoft.EntityFrameworkCore.Tools": "1.1.0-preview4-final"
},
"frameworks": {
"netcoreapp1.1": {
"imports": [
"dotnet5.6",
"portable-net45+win8"
]
}
},
"runtimes": {
"win10-x64": {}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"gcServer": true
},
Also having the same issue after upgrading to .NET CORE 1.1 Not sure where do I specify deps file build folder location?
Necessary files are in
Debug\netcoreapp1.1win10-x64
not
Debug\netcoreapp1.1
folder
moving the *.deps.json file from the
Debug\netcoreapp1.1win10-x64
to
Debug\netcoreapp1.1
will fix the Add-Migration command.
Using the Update-Database command with Sqlite will generate a database in the Debug\netcoreapp1.1 directory instead of the Debug\netcoreapp1.1win10-x64 directory.
I suspect all of this is due to using a standalone app. They're not well supported in the current releases of the tools, and, last I heard, standalone vs. portable is being redesigned in the MSBuild world (to become purely a publish/deploy-time decision).
Try using a portable app by updating your dependency to the following and removing your runtimes section.
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.1.0"
}
@bricelam can you clarify that advice a bit more? I am starting with this:
"frameworks": {
"netcoreapp1.1": {
"imports": [
"dotnet5.6",
"portable-net45+win8"
]
}
},
"runtimes": {
"win10-x64": { }
},
Which is producing the error (when trying to run add-migration) about ProjectName.deps.json not being found in bin\debug\netcoreapp1.1 (it is instead found in bin\debug\netcoreapp1.1win10-x64). I tried removing the runtime section and adding what you wrote:
"frameworks": {
"netcoreapp1.1": {
"imports": [
"dotnet5.6",
"portable-net45+win8"
]
}
},
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.1.0"
},
But that is giving me the following error which is what I hit months ago and led me to adding the runtimes section in the first place...
The project does not list one of 'win10-x64, win81-x64, win8-x64, win7-x64' in the 'runtimes' section. ProjectName C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets 262
I verified that solution suggested by @bricelam works.
@cspwizard - Above changes make Scaffold-DbContext work successfully on the project you provided.
@jeffbromberger - You removed runtimes section correctly but you need to specify Microsoft.NETCore.App part under dependencies node in project.json.
@smitpatel thank you, that worked!
EF Team Triage: We are not planning to fix this issue because the pre-release project.json/xproj project system is being replaced by an MSBuild based system for .NET Core projects. Our approach with project.json/xproj issues is to find workarounds, rather than spending time fixing issues for a tooling system that will never reach RTM. This allows us to focus our efforts on stabilizing for MSBuild based tooling.
BTW this is a canned response and may have info or details that do not directly apply to this particular issue. While we'd like to spend the time to uniquely address every incoming issue, we get a lot traffic on the EF projects and that is not practical. To ensure we maximize the time we have to work on fixing bugs, implementing new features, etc. we use canned responses for common triage decisions.
I had this issue with Visual Studio 2017, I copied all the files including the dll's from the bin\Debug\netcoreapp1.0 to the bin\MCD\Debug\netcoreapp1.0
The scaffolding wasn't working correctly until I copied the files in the bin folder. I am not sure what the MCD folder does but for some reason the scaffolding process looks in this folder.
After migrating to VS2017 check csproj xml file. It should have this settings migrated. I just delete it because now is obsolete.
I did have the same problem under VS2017. My solution was to delete the variable Platform in Environment Variables. Also your must reboot your VS2017.
Not sure why but restarting visual studio worked for me.
For me it occured in VS2019, when created a controller to the solution(https://www.c-sharpcorner.com/article/microservice-using-asp-net-core/ >> Step 4) . It went away when I solved the build errors prior to create the controller.
Seeing as EF / Visual Studio has not resolved this issue, I'll post this for whoever else encounters this issue in the future:
I have painfully scoured the net for a solution to this problem (with Visual Studio Community 2019) to no avail.
Ultimately, I resorted to installing Visual Studio Community 2017 and using that for my project instead. This required me to use a .NET Core 2.2.1 SDK (2.2.2 will not work with VS 2017 or a 3.x.x SDK) for the project.
Upon doing this, my project successfully ran the Add-Migration command in the Package Manager Console without further issue. It resolved the problem entirely. Whatever the cause of this issue is, it seems to not exist in Visual Studio 2017.
To clarify what solutions I attempted before resorting to Visual Studio 2017:
None of the above worked, but switching to Visual Studio 2017 with a 2.2.1 .NET Core SDK did.
Most helpful comment
I had this issue with Visual Studio 2017, I copied all the files including the dll's from the bin\Debug\netcoreapp1.0 to the bin\MCD\Debug\netcoreapp1.0
The scaffolding wasn't working correctly until I copied the files in the bin folder. I am not sure what the MCD folder does but for some reason the scaffolding process looks in this folder.