I am trying to install dotnet-ef globally on macos 10.15.6
dotnet tool install -g dotnet --version 3.1.6
I am getting nuget exception
"/var/folders/gt/9l4q1djd12d__wt0cxkqyrc80000gn/T/bw0oop0h.aau/restore.csproj" (Restore target) (1) ->
(Restore target) ->
/usr/local/share/dotnet/sdk/3.1.302/NuGet.targets(128,5): error : Object reference not set to an instance of an object. [/var/folders/gt/9l4q1djd12d__wt0cxkqyrc80000gn/T/bw0oop0h.aau/restore.csproj]
The exception is happening here:
System.NullReferenceException: Object reference not set to an instance of an object.
at NuGet.Protocol.ServiceIndexResourceV3Provider.GetServiceIndexResourceV3(SourceRepository source, DateTime utcNow, ILogger log, CancellationToken token)
and here is a screenshot for the entire stack
I spent 3 days with this. I would appreciate any kind of help
I solved the problem after intensive SDK/Runtime uninstalling process combining dotnet uninstall tool and manual chasing and removing for folders and install everything all over again. Uninstalling tool doesn't remove cache folders which is a huge problem considering that the problem by large affected by caching in my opinion.
I seached on mac on everything with
dotnet
nuget
entityframework
and removed it manually case the tool don't really remove everything. Depending on the uninstall tool alone didn't help me.
Related
This happened at home first, so I thought maybe it was an issue with my desktop PC at home. But now that I am back at work, I tried the upgrade and got the same thing.
Screenshot before upgrade
Screenshot after upgrading Visual Studio
The error I get is:
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.
Any ideas on why this happens? And how do I get back the dotnet ef command. I mean must have been in the $PATH previously, otherwise it wouldn't have worked before.
This is a breaking change in Entity Framework Core 3.0:
The EF Core command-line tool, dotnet ef, is no longer part of the .NET Core SDK.
...
Starting in 3.0, the .NET SDK does not include the dotnet ef tool, so before you can use it you have to explicitly install it as a local or global tool.
You need to install the Entity Framework Core Tools. To install it globally, run this on the command line:
dotnet tool install --global dotnet-ef
Intro
I am trying to create a project from the cloud using "UaaS.cmd".
I run it, fill the url and namespace and it start working. Then in the middle of the process I get the error:
Installing UmbracoCms.Core
The 'UmbracoCms.Core 7.6.5' package requires NuGet client version '3.4.4' or above, but the current NuGet version is '2.8.1.0'.
at NuGet.PackageWalker.CheckPackageMinClientVersion(IPackage package)
at NuGet.PackageWalker.Walk(IPackage package)
at NuGet.InstallWalker.ResolveOperations(IPackage package)
at NuGet.ProjectManager.Execute(IPackage package, IPackageOperationResolver resolver)
at Waasp.PackageInstaller.InstallPackage(String packageId, SemanticVersion version, String projectPath, String targetFolder)
But I have VS 2015 and VS 2017 installed. My Vs 2015 says that I have nuget version 3.5 installed and vs 2017 says that I have nuget v4.2.
What have I tried
I ran nuget in my cmd, but it was not a recognized so I've downloaded the latest version and have added it to my environment, so when I run cmd, go to the folder where I have my uaas.cmd file and type
nuget update -self
It tells me that I have nuget 4.2 and it is up to date. But when I try the uaas.cmd, the same error happens
I don't understand! where does it find 2.8.1.0?! why doesn't it take 4.2?
P.S: I also wrote on Umbraco forum, but I guess it is more related to the nuget client than umbraco
I wrote my question on our Umbraco too and it appeared to be their error :)
In case anyone ended up in the same situation as me:
This is the answer from Sebastiaan:
link to the topic
The problem is that UaaS.cmd does run nuget 2.8.1 in it (it's ILmerged into the waasp.exe it download).
I'm working on getting it updated but the v4 version of nuget.exe is missing some critical methods that we need to create the list of dependencies. So I'm looking into doing some trickery. Anyway, for now, just go into the .Core project and install Newtonsoft.Json and System.Threading.Tasks.Dataflow and then you should be fine!
VS 2013 fails to restore a package - the package contents are not materialized - although VS/nuget appears to think that it did restore the package successfully.
If I manually uninstall and re-install the same version of that package, it works as it should.
A bare-bones repro can be downloaded as a zip. This repro has a
single solution with a
single project with a
single file, "packages.config", specifying a
single package, "breeze.edmbuilder -version 1.0.4", containing a single file, edmbuilder.cs
single folder, "App_Start", contains nothing but
the .csproj says it should have "edmbuilder.cs" which is ok because
it WILL have "edmbuilder.cs" when the package is restored.
When I build, VS reports that "edmbuilder.cs" is missing ... and indeed it is missing.
However, the package was downloaded; I know this because the build produces a "packages" folder that contains "Breeze.EdmBuilder.1.0.4" wherein I see that "edmbuilder.cs" is present and in the right place.
When I issue the command install-package breeze.edmbuilder -version 1.0.4, nuget reports
'Breeze.EdmBuilder 1.0.4' already installed. NugetRestoreFail already has a reference to 'Breeze.EdmBuilder 1.0.4'.
There is nothing wrong with this package AFAIK. For when I uninstall-package breeze.edmbuilder and then reinstall with install-package breeze.edmbuilder -version 1.0.4, the install works and the missing edmbuilder.cs appears in the "App_Start" folder where it belongs.
The failure is repeatable in place.
close the solution
delete edmbuilder.cs from "App_Start"
delete the "packages" folder
optionally delete the .suo and bin and obj directories
re-open the solution and re-build
You'll get the same failing behavior ... and the same ability to manually uninstall and reinstall.
FWIW, removing the reference to edmbuilder.cs from the .csproj has no effect.
No matter what I do, I have to manually uninstall and re-install the package.
WTF!
p.s.: I am using VS 2013 Update 2 RC. I doubt that the "RC" matters as this problem came to my attention from a customer. You never know.
p.p.s: This is not about the build failing and I don't care that this solution would never run. What you see here is a stripped down version of a real app that would have worked. The only question is "why no restored file?"
Package Restore is NOT the same as installing a package. What you are seeing is by design. It simply downloads any missing packages in the packages folder. No more. No less.
Package Restore was added so you wouldn't need to commit the packages folder to source control.
It is expected that you would install a package then commit the changes made to your project files as well as any files that may have been added like your edmbuilder.cs, essentially anything inside your project folder. You would exclude the packages folder.
Now when you get the source from source control everything would be present except for the package files. Package Restore would download those and now your working copy is complete.
See NuGet's Restore Package insists on specific package versions
Is this stupid or what?
Thanks to #Kiliman for explaining that my horrible experience is "by design".
So how do you actually get the content you thought was being restored? Do you install each package one at a time. That's insane.
I was going to observe that there is no nuget equivalent of an npm install that would fetch all the packages you need ... when I discovered that there actually IS an almost-equivalent. It's just not obvious and I wonder how many people know it exists.
It's a two step process:
FIRST restore the missing packages ... THEN
Issue the command: Update-Package -Reinstall
This re-installs all packages in every project in your solution.
If you only want to re-install for a specific project, try:
Update-Package -ProjectName 'YourProjectName' -Reinstall
In both procedures, the -Reinstall switch strives to install the exact versions of the packages spelled out in your package.config ... and not newer "updated" packages which may or may not work for your project (but see the documentation for exceptions).
Read about update-package -reinstall in the official nuget documentation entitled, "Reinstalling Packages and its Pitfalls".
Do not miss the cautionary remarks. Clearly this technique is but an approximation of what you'd expect from other package managers.
Good luck, peoples.
I have an install.ps1 script in my NuGet package. This script runs both during a new install (after all the files have been copied) and during an upgrade.
I want to show a Getting Started page during a new install, but for an upgrade I want to show the Release Notes.
I found this great answer that tells how to open a URL and it works great. But I am stumped on trying to tell the difference between a new install and an upgrade.
The best solution I have come up with so far is to add a Release Notes link to the top of the Getting Started page, but that is something that could easily be missed by upgraders, and is an unwanted distraction for new installers.
I don't think it's possible to know if the current operation is install or upgrade. When NuGet upgrades a package, what NuGet does is basically uninstall the existing package and install the new package.
I suppose you could do something with install.ps1 that "dirties" the project in some way on the first install, which you will not clean up with uninstall.ps1. Maybe insert a dummy file into the project (outside of the normal NuGet handling, so the file won't get uninstalled automatically) or add some other dummy element to the project file. Then, when you see those "leftovers" from a previous install (which were purposely not cleanly uninstalled), you will know that you are installing an upgrade.
I have an InstallShield 12 installscript. I want to uninstall the old version before installing the new version. I will keep the name of the package unchanged. How can I do this?
Assuming this is not an MSI project and youve kept the same Project GUID, you could simply call ComponentUninstall() in the OnMaintUIBefore function.
If the Project GUID is not the same you can look at the uninstall string in the registry under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{PROJECT_GUID} and then do a LaunchApp with that.
Hope it helps.
With an MSI-based project, this would be accomplished by configuring a Major Upgrade for your project. Upgrades don't exist for InstallScript projects, but there are no Windows Installer restrictions to keep you from running multiple installations simultaneously. You should be able to simply run the uninstallation of the previous version manually in your InstallScript code (maybe in the OnFirstUIBefore function).