ASP.NET Nuget version error when deploying to Heroku - asp.net

When I deploy to Heroku, I get an error stating that my Nuget version is not up to date. When I checked my Nuget version from the command line, it was 6.2.1.2, and I don't have Microsoft.ClearScript.V8 7.2.1 installed locally. Therefore, I think the issue is that Heroku doesn't have the right Nuget version for the buildpack, but I'm not sure how to remedy this. Other buildpacks throw errors earlier on.
Full error output:
-----> Building on the Heroku-18 stack
-----> Using buildpack: https://github.com/jincod/dotnetcore-buildpack#v2.1.300
-----> ASP.NET Core app detected
Installing dotnet
publish /tmp/build_ed54e936/RoundTheCode.GoogleAuthentication/RoundTheCode.GoogleAuthentication.csproj
Microsoft (R) Build Engine version 15.7.179.6572 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Restoring packages for /tmp/build_ed54e936/RoundTheCode.GoogleAuthentication/RoundTheCode.GoogleAuthentication.csproj...
/tmp/build_ed54e936/.heroku/dotnet/sdk/2.1.300/NuGet.targets(114,5): error NU1401: The 'Microsoft.ClearScript.V8 7.2.1' package requires NuGet client version '4.9.0' or above, but the current NuGet version is '4.7.0'. To upgrade NuGet, please go to http://docs.nuget.org/consume/installing-nuget [/tmp/build_ed54e936/RoundTheCode.GoogleAuthentication/RoundTheCode.GoogleAuthentication.csproj]
! Push rejected, failed to compile ASP.NET Core app.
! Push failed

Related

Rider unable to restore dotnet core packages on mac

I get the following error when I try to restore a dotnetcore project on my mac in Rider.
The sad thing is this error only comes in Jetbrains Rider. I can run my project from the command line and Visual Studio. Any ideas?
[NU1202] Package Serilog.Extensions.Hosting 4.0.0-dev-00051 is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1). Package Serilog.Extensions.Hosting 4.0.0-dev-00051 supports: netstandard2.1 (.NETStandard,Version=v2.1)
I was running an older version of Rider. After upgrading to the newest version, it worked fine.

Detected package downgrade for Boilerplate Application(.NET Core 3.1)

I'm trying to open my Boilerplate Application(.NET Core 3.1)in VSCode in Linux but below exception, keep appeared for me. Is there any difference between .NET Core for Linux and for Windows or What is the problem?
Detected package downgrade: Abp.ZeroCore from 5.7.0 to 5.1.0. Reference the package directly from the project to select a different version.
No this is not related to the OS that you run your application.
As stated in the error message there a downgrade in one of your nuget packages.
Go to your Boilerplate.csproj and try to manually set the version of Abp.ZeroCore nuget package from 5.1.0 that it is currently to 5.7.0.

Unable to restore nuget/nexus packages for .netcore and .netframework in same solutions from Jenkins

In my solution, I have .NET Core and .NET Framework projects. I am facing the below error (which is a .NET Core project) while compiling the solution through Jenkins:
error NETSDK1064: Package IBM.Data.DB2.Core, version 1.3.0.100 was not
found. It might have been deleted since NuGet restore. Otherwise,
NuGet restore might have only partially completed, which might have
been due to maximum path length restrictions.
The Error Message is pretty self-explanatory. Try to restore the package by either right clicking on the solution and selecting "Restore Nuget Packages" in your IDE, or run the below command in the package manager console.
nuget restore YourSolution.sln
Alternatively, you can also install the package using the below command
Install-Package IBM.Data.DB2.Core -Version 1.3.0.100
Check for any error messages while restoring or installing packages, in case there are any file path issues.

Unit tests work in Resharper but not MSTests

We recently moved to .NET Core 3.1, and then back to 2.2 until we could update some dependencies that did not work under 3.1. After this, tests in MS Test would not run due to the reason below.
[1/2/2020 1:32:44.790 PM] ---------- Discovery started ----------
Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException: Testhost process exited with error: It was not possible to find any compatible framework version
The framework 'Microsoft.NETCore.App', version '2.2.0' was not found.
- The following frameworks were found:
3.0.1 at [C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
3.1.0 at [C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
You can resolve the problem by installing the specified framework and/or SDK.
The specified framework can be found at:
- https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=2.2.0&arch=x86&rid=win10-x86
. Please check the diagnostic logs for more information.
The tests run in Resharper.
I reinstalled .NET Core 2.2.8 SDK from here but that did not help. After installation I noticed that C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App did not have a folder for 2.2.8.
How do I get the tests to run in MS Test and/or get that folder populated (and why wasn't it populated after installing that version for that matter)?

Unable to install packages for .NETFramework versions that should work

I'm running into an issue where I cannot install NuGet packages, or update packages, even though I have been able to install those packages in the past.
With a clean solution, I can create an ASP.NET MVC project using .NETFramework 4.5.2 (I've also tried with 4.6.1).
Since I take the default authentication options (Individual User Accounts), the Microsoft Owin packages are all scaffolded in, including the core Owin package (which is a dependency of the Microsoft Owin packages).
If I add another project (I started with a basic Class Library, but for testing purposes also tried a MVC project without authentication), I cannot add any Owin-related packages, as the Owin 1.0.0 package fails:
PM> Install-Package Owin
Attempting to gather dependencies information for package 'Owin.1.0.0' with respect to project 'Core', targeting '.NETFramework,Version=v4.5.2'
Attempting to resolve dependencies for package 'Owin.1.0.0' with DependencyBehavior 'Lowest'
Resolving actions to install package 'Owin.1.0.0'
Resolved actions to install package 'Owin.1.0.0'
Install failed. Rolling back...
Package 'Owin.1.0.0 : ' does not exist in project 'Core'
Install-Package : Could not install package 'Owin 1.0.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5.2', but the package does not contain any assembly referen ces or content files that are compatible with that framework. For more information, contact the package author.
At line:1 char:16
+ Install-Package <<<< Owin
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand PM>
The scaffolded project is using .NetFramework 4.5.2, and already has Owin version 1.0.0 working without a problem.
Similarly, Respond is included by default. The default version is 1.2.0.
I can use NuGet Package Manager to upgrade to version 1.4.1 without a problem. But if I try to upgrade to the latest stable, 1.4.2., I get the exact same errors as I do for the Owin install.
A coworker has a copy of the same project via source control, and he is also running VS2015. He can update to Respond 1.4.2. without a problem.
Another coworker duplicated every test I tried without running into any issues.
Even odder, I was able to add Owin and its dependencies to a .NET Class Library project this morning (but I couldn't upgrade to the newest Respond release). But after deleting the solution, and starting a new one, I started encountering my problems with a variety of packages.
I believe I found the solution.
I tried flushing my user cache and even uninstalling and reinstalling Visual Studio (deleting any AppData files that seemed related), but the problem persisted.
However, clearing the data in C:\Users\<<UserName>>\.nuget\packages has resolved the issue.

Resources