dotnet ef --update-database "Microsoft.DotNet.Cli.Utils.dll" exception - entity-framework-core

I got this exception:
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.DotNet.Cli.Utils, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
at Microsoft.EntityFrameworkCore.Tools.Program.Main(String[] args)
after executing "dotnet ef --update-database"
dotnet --info :
.NET Command Line Tools (1.0.0-preview2-003121)
Product Information:
Version: 1.0.0-preview2-003121
Commit SHA-1 hash: 1e9d529bc5
Runtime Environment:
OS Name: Windows
OS Version: 10.0.10586
OS Platform: Windows
RID: win10-x64
Any idea? thank you.

You can find an ansfer to my question here:
https://github.com/aspnet/EntityFramework/issues/5934#issuecomment-229939582

Related

Visual Studio 2019 connection problem to NuGet

I reinstalled (clean) Visual Studio 2019 (Microsoft Visual Studio Community 2019 Version 16.8.5) and I get error when I try to clean solution, it complains about connection to https://api.nuget.org/v3/index.json.
When I copy paste the link to web browser I see all the packages but VS cannot reach any package.
When I rebuild I get all this error: 'obj\project.assets.json' not found. Run a NuGet package restore to generate this file.
Then I do from NuGet Console > dotnet restore and I get error:
PM> dotnet restore
Determining projects to restore...
C:\Program Files\dotnet\sdk\5.0.103\NuGet.targets(131,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [C:\Program Files (x86)\Microsoft V
isual Studio\2019\Community\MyProjects2019\source\repos\Bank\Bank.sln]
C:\Program Files\dotnet\sdk\5.0.103\NuGet.targets(131,5): error : The SSL connection could not be established, see inner exception. [C:\Program Files (x86)\Microsoft Visual Studio\
2019\Community\MyProjects2019\source\repos\Bank\Bank.sln]
C:\Program Files\dotnet\sdk\5.0.103\NuGet.targets(131,5): error : The remote certificate is invalid because of errors in the certificate chain: UntrustedRoot [C:\Program Files (x86
)\Microsoft Visual Studio\2019\Community\MyProjects2019\source\repos\Bank\Bank.sln]
PM>
I have been trying for 4 days to resolve this problem without success, any help, any tips.
Thanks

"dotnet-ef does not exist" in .net core heroku application

I am using jincod's Heroku .NET Core Buildpack to deploy my Core 3.1 MVC application to heroku.
Currently i am trying to apply EF migrations to postgre DB (using Npgsql) by executing command on publish:
<Target Name="PrePublishTarget" AfterTargets="Publish">
<Exec Command="dotnet tool install --global dotnet-ef" />
<Exec Command="dotnet ef database update" />
</Target>
Build fails with these messages:
You can invoke the tool using the following command: dotnet-ef
Tool 'dotnet-ef' (version '3.1.3') was successfully installed.
Could not execute because the specified command or file was not found.
Possible reasons for this include:
* You misspelled a built-in dotnet command.
* You intended to execute a .NET Core program, but dotnet-ef does not exist.
* You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
/tmp/build_35cf57c00fbf62634ac8d644c6e8f4f7/BugTracker.csproj(38,5): error MSB3073: The command "dotnet ef database update" exited with code 1.
! Push rejected, failed to compile ASP.NET Core app.
! Push failed
I explicitly install dotnet-ef, but for some reason it cannot find it?
You need to add "dotnet-tools.json". More info here https://github.com/jincod/dotnetcore-buildpack/pull/104

Build error on Appveyor with newest ASP.NET 5

I'm trying to build an ASP.NET 5 web api and build it on Appveyor. I get this error:
Build started
git clone -q --branch=master https://github.com/nikolaschou/TodolistService01.git C:\projects\todolistservice01
git checkout -qf 3c97bb95ecf54662069b6ae8fa25a60f598a564d
msbuild "TodolistService.sln" /verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
Microsoft (R) Build Engine version 14.0.24720.0
Copyright (C) Microsoft Corporation. All rights reserved.
Cannot find DNX runtime dnx-clr-win-x86.1.0.0-rc1-update1 in the folder: C:\Users\appveyor.dnx\runtimes
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DNX\Microsoft.DNX.targets(126,5): error : The Dnx Runtime package needs to be installed. See output window for more details. [C:\projects\todolistservice01\src\TodolistService\TodolistService.xproj]
Command exited with code 1
This project is based on .NET framework 4.6.1 and ASP.NET 5. The references are DNX 4.5.1 and DNX Core 5.0.
Feel free to reproduce the error by building this public repository:
https://github.com/nikolaschou/TodolistService01
Can anyone explain why it fails? Is Appveyor not yet ready for these new versions?
Basically, you have to do two things:
install .NET framework
restore packages
This is appveyor.yml to build your project:
os: Visual Studio 2015
install:
- dnvm upgrade -r clr
- dnu restore
build:
verbosity: minimal
Build results: https://ci.appveyor.com/project/FeodorFitsner/todolistservice01
Also, you may need to select right version in your global.json:
{
"sdk": {
"version": "1.0.0-rc1-final"
}
}

Having trouble installing bndTools with Gradle?

I have Gradlev2.9 installed. I also have bndTools downloaded from https://github.com/bndtools/bndtools. I am running on a closed network so no Interwebs. I deleted the Ivy repository since we dont have Ivy, its in the settings.gradle file under repository{}. I also commented out the attempted connection in gradle.properties file.
Also, I attempted to put the missing jar files directly into the root bndTools folder and gradle still didnt pick them up.
Am I missing something...?
C:\Program Files\bndTools\bndtools-master>gradle -v
Gradle 2.9
Build time: 2015-11-17 07:02:17 UTC
Build number: none
Revision: b463d7980c40d44c4657dc80025275b84a29e31f
Groovy: 2.4.4
Ant: Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM: 1.8.0_31 (Oracle Corporation 25.31-b07)
OS: Windows 8.1 6.3 amd64
C:\Program Files\bndTools\bndtools-master>
My Error:
FAILURE: Build failed with an exception.
Where:
Settings file 'C:\Program Files\bndTools\bndtools-master\settings.gradle' line: 28
What went wrong:
A problem occurred evaluating settings 'bndtools-master'.
Could not resolve all dependencies for configuration 'classpath'.
Cannot resolve external dependency biz.aQute.bnd:biz.aQute.bnd.gradle:latest because no repositories are defined.
Required by:
unspecified:unspecified:unspecified
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 1.482 secs
Thanks!

Stackoverflow exception during maven package

Need your help in fixing the maven compilation issue. I am not able to run any maven commands on my project. I am getting the following exception. Maven version used is
Maven home: C:\Program Files (x86)\maven\apache-maven-3.0.4\bin\..
Java version: 1.7.0_09, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.7.0_09\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
Maven Command Used
mvn -o package and mvn package
Exception Stacktrace :-
Exception in thread "main" java.lang.StackOverflowError
at org.sonatype.aether.util.graph.PathRecordingDependencyVisitor.visitEnter(PathRecordingDependencyVisitor.java:88)
at org.sonatype.aether.impl.internal.GraphEdge.accept(GraphEdge.java:198)
at org.sonatype.aether.impl.internal.GraphEdge.accept(GraphEdge.java:202)
at org.sonatype.aether.impl.internal.GraphEdge.accept(GraphEdge.java:202)
Please give some idea to fix this issue.
Looks like a bug of Maven 3.0.4.
Upgrade to Maven 3.2.1 resolved that for me.