The specified deps.json [] does not exist - visual-studio

I'm using Asp.net Core with EntityFramework.Core. I'm having troubleshot migrations and Scaffold after format my pc.
when I write these in Package Manager Console
Scaffold-DbContext "Data Source=.\SQL2017DEV;Initial Catalog=MyDataBase;Integrated Security=True" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Db
Add-Migration Initial
error is
"The specified deps.json [D:\TFS\Erdi\Erdi\AspCoreWeb.Site\AspCoreWeb.Site.deps.json] does not exist"
[MyProjectFolder]\AspCoreWeb.Site.deps.json
I think it try to find my debug folder.
This solutioun is working other computers
I'm repair my visual studio but it hasn't changed

In my case; was fixed by changing the Startup Project (via Solution Properties) to the project that has EF Context file.

There is an issue with migration in VS2019. I have been facing a similar issue and was getting below error:
The specified deps.json [YourProjectLocation]\ProjectName.deps.json doesn't exists.
When I used dotnet CLI for migrations and it worked and was able to generate migration and update the same using dotnet CLI.
dotnet ef migrations add InitialCreate
dotnet ef database update

this problem generally occurs because of path issues. You should change your "outputPath" in the "project.assets.json" file.
D:\TFS\Erdi\Erdi\AspCoreWeb.Site\AspCoreWeb.Site.deps.json] instead of this,
D:\TFS\Erdi\Erdi\AspCoreWeb.Site\obj\AspCoreWeb.Site.deps.json]
i think this will resolve your problem.

If you are using Package Manager Console to "Add-Migration" or "Update-Database", be sure that the project where you want the migration is selected as the Startup project in Visual Studio and this project is also the default in Package Manager Console.
Solution Explorer:
Package Manager Console:
If you are using the dotnet CLI, then you have to navigate to the right project folder and run the migration commands from there.

Make sure that the Startup Project is where the connection string is and select the project in the Default project of Package Manager Console where the db context is at.

Just Go to VS 2022
It Worked for me

go to bin folder and copy files in it include deps.json to the path that see in error.

Related

Why SSISDeploy overwrite the whole projects and not only what was modified?

I have the below structure in ssis server:
Assuming I worked on Integration service project in VS but only on one dtsx from the list above.
Now I ran the below SSISDeploy (documentation is here) command from CMD:
SSISDeploy.exe -s:"C:\git\test\Integration Services\bin\Development\Integration Services.ispac" -d:catalog;/SSISDB/TEST/TEST_INRG;"TEST03,1234" -at:win
and got this message:
Will deploy 'Integration Services.ispac' to TEST03,2890:/SSISDB/TEST/TEST_INTG.
The project 'TEST_INTG' already exists in the catalog folder 'TEST'. Will overwrite it.
So what actually happened, all the packages were delete and my dtsx package was overwritten the modified one. Is there a flag which can tell the command to change only what was modified? I was expecting to see only change in the actual dtsx package.
Got official answer in Microsoft forum:
https://learn.microsoft.com/answers/answers/441954/view.html

dotnet cli <> VS2017 nuget packages restore errors

I've used dotnet cli (2.0.0) to create 2 projects:
dotnet new webapi (name: webapiProject)
dotnet new xunit (name: testProject)
after that, on testProject project:
dotnet add reference webapiProject
test project is an integration test and it uses webapiProjects Startup.
when i do dotnet run on xunit one, all works fine. tests run, references work, all good.
But, when i load testProject.csproj in VS2017 (15.3.3), i get nuget NU1105 error:
Severity Code Description Project File Line Suppression State
Error NU1105 Unable to find project information for 'webapiProject'. The project file may be invalid or missing targets required for restore.
I am actually rather new to dotnet cli and i am not even sure i should be loading *.csproj in VS2017 but i did so because when i opened only my test class then i didn't have intellisense for it.
So, any advice would be highly appreciated about both:
the error
correct workflow

"No executable found matching command dotnet-ef" error with EF Core database-first

As you know, the newest version of Visual Studio 2017 abandons the 'project.json' and uses .csproj instead.
I'm using the RTM version and want to generate model from an exist database, following this guide. I got an error on the last step:
The Entity Framework Core commands for the Package Manager Console don't yet support csproj-based .NET Core projects. Use the .NET Command Line Tools (i.e. dotnet ef) instead. For more details, see https://go.microsoft.com/fwlink/?linkid=834381.
Following the error, I used the link it mentioned to switch to dotnet ef. Here is my package manager command:
PM> dotnet ef dbcontext scaffold "Server=.;Database=Jumpstart;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer
Then the error comes again:
dotnet : No executable found matching command "dotnet-ef"
I used the help command, I found that dotnet does not have a command called ef.
I just want to generate a model from an existing database.
Follow this tutorial
https://learn.microsoft.com/en-us/aspnet/core/data/ef-mvc/migrations
I had the same problem. Just edited the ItemGroup section in .csproj like this
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="1.0.0" />
</ItemGroup>
Accepted answer is the most probable cause of the error message. However, besides adding the proper reference within .csproj file also make sure that the current directory from Package Manager Console points to ASP.NET Core project, otherwise any dotnet ef command will fail with the error mentioned in the OP title.
My issue was solved by changing tools to:
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.1.0-preview4-final",
"Microsoft.EntityFrameworkCore.Tools.DotNet": "1.1.0-preview4-final"
},
Then execute these 2 commands:
dotnet restore - to restore packages
dotnet ef migrations
I solved the problem
in all answer mentioned adding Tools DotNet but not solved my problem because missed some command I mention below
The EF Core .NET Command Line Tools are installed by manually editing the *.csproj file.
Add Microsoft.EntityFrameworkCore.Tools.DotNet as a DotNetCliToolReference. See sample project below.
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="1.0.0" />
</ItemGroup>
for core version 2 changed the version
but after that should run 2 commands too
then importatn part in all answer missing (this command solved my problem in visuall studio 2017)
1 - Execute dotnet add package Microsoft.EntityFrameworkCore.Design
2 - Execute dotnet restore. If restore does not succeed, the tools may not have installed correctly.
more information
https://learn.microsoft.com/en-us/ef/core/miscellaneous/cli/dotnet
On NetCore 2.0 you just need to run Add-Migrations.
It will ask for a name and that's all. Just be sure you have a default connection string on appsettings.json

Cannot restore nuget packages on VSTS (Packages failed to install)

I'm using Visual Studio Team Services to build a .NET solution. I have a Nuget Installer task to restore the packages of the solution that is configured as follows:
Nuget.config file has 2 package sources - one is nuget.org (v2) and the other is a custom feed (Nuget Server v2.5.40416.9020). All packages from the nuget.org feed are restored but the ones from the custom feed are not, for each package from the custom feed there is an error message like this:
Unable to find version 'abc' of package 'xyz'
Error:
[error]Error:
C:\a_tasks\NuGetInstaller_333b11bd-d341-40d9-afcf-b32d5ce6f23b\0.2.22\node_modules\nuget-task-common\NuGet\3.3.0\NuGet.exe
failed with return code: 1 [error]Packages failed to install
This was working fine 1 or 2 days ago.
Locally everything seems to work fine. Also, I tried with the nuget version 3.5.0 and a custom version of nuget.exe, without success.
Any suggestions?
I just had this error today. I fixed this error by reviewing the changes in my solution file with our base code branch and found some old lines that weren't supposed to be there. I think they were a result of a bad merge and should have been removed during a conflict resolve.
To fix the issue I simply removed the references that were old and everything built just fine.
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Services", "Services", "{EAECFF2D-7339-4180-8E1E-6DF9EC9EB131}"
EndProject
{3C14F190-6B6A-4913-9681-AFD9B62850FA} = {EAECFF2D-7339-4180-8E1E-6DF9EC9EB131}
{687ECE00-A567-40F3-BFF9-C3B639328F27} = {EAECFF2D-7339-4180-8E1E-6DF9EC9EB131}
Thanks,
Fissh

Set TargetProfile for an Azure project

I'm getting the following error from a build I'm running through TeamCity on my development machine:
[ResolveServiceConfiguration] WATMessage
[16:02:05][WATMessage] C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Windows Azure Tools\1.7\Microsoft.WindowsAzure.targets(354, 5): No default service configuration "ServiceConfiguration.cscfg" could be found in the project.
[16:02:05][Xxx.Azure.Production\Xxx.Azure.Production.ccproj] Project Xxx.Azure.Production\Xxx.Azure.Production.ccproj failed.
The same solution builds okay in VS.NET.
I think what I need to do is set the TargetProfile for each of the Azure projects (there's more than one complaining) to override the default of Cloud but I can't find out where to do this.
So how do I set the Target Profile for an Azure project?
Have you tried setting the target profile at command line?
/p:TargetProfile=MyProfile
Given an Azure service configuration file named "ServiceConfiguration.Production.cscfg":
In your TeamCity project build configuration, go to Build Parameters (step 7)
Add a system property with the name "system.TargetProfile" and a value of "Production"
This pattern applies for any named configuration in the format ServiceConfiguration.[your profile].cscfg.
To work around this problem I have created ServiceConfiguration.Cloud.cscfg for each Azure project using the .cscfg that was being set in the definition.
In my case, I renamed the ServiceConfiguration.Cloud.csfg file, and since the build agent will first look for that file because the default TargetProfile is "Cloud", I had to re-create the ServiceConfiguration.Cloud.csfg file in the same location, then went into the .ccproj file and added this line under the <ItemGroup> node:
<ServiceConfiguration Include="ServiceConfiguration.Cloud.csfg" />
Then I rebuilt and the problem was solved.

Resources