Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all 3186 articles
Browse latest View live

NuGet Packages Version conflics

$
0
0

I'm coming to ask a question, maybe stupid, but I can't find a good explanation about it..

For this example, I'll take for example a Xamarin Forms - Portable Project and look at the Project.Droid part. Also, I'm gonna take the following packages:


and


As you can see, the Xamarin.Forms.Map package is version 2.3.1.114 and the others, 23.3.0. However, an update is available, but when I make it, the package of 23.3.0 version update to 23.4.0.1 while Xamarin.Forms.Map is downgrading to 1.5.1.6471 ...

Why does it work like it? why everything doesn't up to the last update? What are the differents effects of this update/downgrade? Also, what's the best choice? Does it's better to update the Xamarin.Android.Support.xxx packages and downgrade the Xamarin.Forms.Map one or do the reverse?

Thank in advance for your answer/explanation :)


NuGet Package Dependencies - Upgrading to .NET Framework 4.8

$
0
0

I'm upgrading the .NET framework from 4.7.2 to 4.8. While upgrading the package, I'm facing the below error :

One or more unresolved package dependency constraints detected in the existing packages.config file. All dependency constraints must be resolved to add or update packages. If these packages are being updated this message may be ignored, if not the following error(s) may be blocking the current package operation: 'Microsoft.IdentityModel.Clients.ActiveDirectory 5.2.6 constraint: (>= 4.3.4)', 'Microsoft.SqlServer.XE.Core 140.1000.62 constraint: xe (= 140.1000.62)', 'Microsoft.SqlServer.XEvent.Linq 140.1000.34 constraint: Microsoft.SqlServer.XE.Core (= 140.1000.34)

I'm using VS 2019.In the package Manager console I've tried to upgrade the package using the below commands :

update-package -projectname packageName

Can anyone mention the steps to resolve this.

Thanks in advance !

Nuget package not installing in .Net Framework

$
0
0

I have created .net standard library project and I have created nuget package for this library, Now I need to install this package in both application .Net Core and .Net Framework4.5. Working fine in .Net Core but while installing .Net framework project it was showing below exception.

Blockquote 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 references or content files that are compatible with that framework. For more information, contact the package author. Blockquote

Please let me know the right approach to resolve this.

How to discard error NETSDK1004 , and automate nuget restore on F5

$
0
0

I created vsix. It creates a .net core 3.1 project as output project. Now on F5, it is suppose to build, restore nuget packages and open the browser with output, But I get below error on F5,

Error NETSDK1004 Assets file 'C:\Users\v-dekot\source\repos\Template\Template1\Bot\obj\project.assets.json' not found. Run a NuGet package restore to generate this file.C:\Program Files\dotnet\sdk\3.1.300\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets

Note : It works fine when I open the project next time when I open the solution. Why is it not working first time? I need to manually do "dotnet restore" to make it work for the first time as said here Assets file project.assets.json not found. Run a NuGet package restore. Can I automate it?

The similar issue is addressed here but no solution provided,https://developercommunity.visualstudio.com/content/problem/557306/nuget-restore-doesnt-work-the-first-time-but-the-s.html

Im making a node js script to acquire information about Nuget packages, is there a way to get licensing information?

$
0
0

Is there any commands i could perform or npm packages that would allow me to find the licensing information of nuget packages used on the project?

How can I make my managed NuGet package support C++/CLI projects?

$
0
0

I have made a NuGet package that works well when I use it from a C# project. It contains a DLL in the lib/net40 directory, and the DLL gets added as a reference.

Now that NuGet supports C++, how do I actually modify my package so that the DLL can be added as a managed reference in a C++/CLI project? I can't find any tutorials explaining this. If I try to just add the package as is, I get the following error:

You are trying to install this package into a project that targets 'Native,Version=v0.0', but the package does not contain any assembly references or content files that are compatible with that framework.

One would think that the solution is to put the files under lib/native, but according to http://docs.nuget.org/docs/reference/support-for-native-projects, that is not supported. Also, simply putting the DLL directly under lib doesn't seem to do anything.

Apparently, I am supposed to do this with a .props or .targets file under build/native, but what do I need to put into those files to make this work ?

How to debug code in a nuget package created by me

$
0
0

I have a nuget package I created and installed in another solution but now I need to debug de code of the package when called from my new solution.

I tried referencing the solution of the package but is not working.

I am using Visual Studio 2013.

Error while updating the package castle core package to 4.4.1.0

$
0
0

After updating the castle core package i am facing the following exception .i am using moq 4.13 .assembly binding i mentioned as following. please help in resolving this issue.

bindingRedirect oldVersion="0.0.0.0-4.4.1.0" newVersion="4.0.0.0"

Project C:\mypath on node 1 (DemoBuild target(s)).RESTOREPACKAGES:" C:\mypath .nuget\NuGet.exe" update -self Checking for updates from https://api.nuget.org/v3/index.json. C:\mypath \build\build-git.config(118,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. C:\mypath \build\build-git.config(118,5): error : An error occurred while sending the request. C:\mypath \build\build-git.config(118,5): error : Unable to connect to the remote server C:\mypath \build\build-git.config(118,5): error : No connection could be made because the target machine actively refused it C:\mypath \build\build-git.config(118,5): error MSB3073: The command "" C:\mypath .nuget\NuGet.exe" update -self" exited with code 1.Done Building Project " C:\mypath \build\build-git.config" (DemoBuild target(s)) -- FAILED.

Build FAILED.


uninstall / Install Nuget Package across multiple solutions and projects

$
0
0
  • How do I uninstall a package by id and version for all solutionsand projects under a folder?
  • How do I install a package by id andversion for all solutions and projects under a directory?

There is a package manager approach with somewhat Similar Post that shows how to do that for all projects under A solution.You can use Package Manager Console from solution and use this for one solution. But how to do the same across multiple solutions and projects under them?

Validate point in time restore point in azure sql

$
0
0

Does anybody knows if there is an way to validate the point in time time for restoring an azure database in the Microsoft.Azure.Management.Sql nuget or some place else

ADOMD nuget package for asp.net core

$
0
0

I am looking at ADOMD nuget package. It seems it does not support ASP.NET Core framework. How can I Get this nuget package for ASP.NET core. If not this package, do we have any other alternative to connect to cube ?

How to make ExcelDna functions from Nuget.org package visible in the package user's Excel session

$
0
0

I have created a Nuget.org package, with the following (abridged) code:

namespace MyNugetPackageNS    module MyNugetModule =         open ExcelDna.Integration        // this function is NOT seen in the package user's Excel session        [<ExcelFunction(Category="Test", Description="Add 1.")>]        let plusOne ([<ExcelArgument(Description= "Value.")>] value: double) : obj =             value + 1.0 |> box

I was hoping that if a user installs the package and adds it into his own library, all the Excel functions defined in the package (e.g. plusOne) would automatically be visible within Excel, but it isn't the case. It seems that the user has to "wrap" the package Excel functions in order to make them visible in Excel, e.g. :

namespace UserNS    module UserModule =         // need to install the nuget package from Nuget.org        open MyNugetPackageNS.MyNugetModule        open ExcelDna.Integration        // this function is seen in the package user's Excel session        [<ExcelFunction(Category="Test", Description="Add 1.")>]        let plusOne2 ([<ExcelArgument(Description= "Value.")>] value: double) : obj =             MyNugetModule.plusOne value

My question : Is there a way to make the package's Excel functions automatically "visible" in the package user's Excel session, without wrapping each function before hand?

'Class.function' doesn't exist in current context while using a self made NuGet Package

$
0
0

I have created a NuGet package on .NetCore class library and accessing it from another .net core class library. I can't call my public and static method from a public and static class even tho the class name is detected.
One point to make is that the Package works on a Console App properly. To create a package I went to property->Package->Create Package on build and also nuget.exe method. Both lead to the same thing

Can someone please help me out

This is the Nuget package code

This is the class library I'm calling the above package in

How to install the default module provider for Powershell 7?

$
0
0

I was trying to install a powershell module, but realized that for some reason on a default installation of Powershell 7 on this laptop there is no default module provider. I would like to install the powershell gallery module provider as default.

How do i go about doing that?

Thanks

>Get-PackageProvider -ListAvailable>Install-PackageProvider -Name NuGetInstall-PackageProvider: Unable to find repository with SourceLocation ''. Use Get-PSRepository to see all available repositories.>Get-PSRepositoryGet-PackageSource: C:\Users\someuser\Documents\PowerShell\Modules\PowerShellGet\2.2.4.1\PSModule.psm1:9537Line |9537 |  … ckageSources = PackageManagement\Get-PackageSource @PSBoundParameters     |                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     | Unable to find module providers (PowerShellGet).

Check if package is compatible with .net core

$
0
0

I started programming with .NET Core and ASP.NET Core and after reading many Docs/Tutorials i still am not sure of how to realize if a Nuget-(Meta-)Package is comptabile/usable within my .NET-Core-App.

  1. How to check if a NuGet-Package is compatible with .NET Core.E.g. the often recited Newtonsoft JSON. Is it compatible/usable - and how to see this?
  2. Is there a list of all the available .NET Core packages?

(Like here it lists a few

key NuGet packages for .NET Core

). But since they say those are "key" packages i would assume there are more. But which?


Creating and installing a nuget package with referenced project

$
0
0

I want to publish a dotnetcore2.1 nuget package using dotnet pack and dotnet nuget push.

The package is a project in a solution that has a reference to another project in that solution.

I can't install the package because it can't resolve the referenced project.

I tried doing this, and it includes the referenced package .dll to the .nupkg file, but it's still not possible to install it.

I can't really figure out what is the 'expected' way to do this. I definitely don't intend to publish the referenced project to the nuget feed.

Is this a massive oversight by microsoft or am I not getting something?

NuGet Package manager stuck on "Retrieving information..." on VS 2013

$
0
0

Using VS 2013 with NuGet Package Manager installed, I can view all Installed packages, but when I pick Updates or Online, I get an endless busy indicator showing "Retrieving information..."

I've verified I have a good connection. I uninstalled/reinstalled NuGet Package Manager.

Any other suggestions?

Thanks

Could not load file or assembly Visual Studio 2019 (Community)

$
0
0

This is going to be one of those questions for which there are hundreds of answers, so please bare with me as I have tried most of them!

I have been breaking up a very large project into smaller components with the view to slowly migrate it all to .NET Core.

Some Projects in my solution are now .NETstandard class libraries, and there are also some .Net Framework (4.7.8) projects.

I was getting on quite well today when suddenly I started getting this:

Could not load file or assembly 'ServiceStack.Text, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

The version installed in my projects is (was - read on...) 5.8.0.0

Now, I am not new to this error, I've found it before and it usually relates to either a project reference file, web.config or packages.config referencing a .DLL with a different version than that of the file in the /bin directory.

So I have been through all (34) project folders and deleted servicestack.text.dll in every project.

I have uninstalled it via NuGet in every project and reinstalled it.

I have checked every project's packages.config file and where they are .NETStandard projects, the project files and made sure that there are not references to ServiceStack.Text v 5.0.0.0

I have rebuilt, cleaned and restarted the solution, visual studio and my computer many times!

Then I noticed something...

In my .Net Framework projects, under References, if I click on the ServiceStack.Text file and view the Reference Properties, it shows Version: 5.0.0.0, but the Path is directing it at 5.8.0.0.

In the .NETStandard projects, it shows the correct version.

So then I thought maybe 5.9 can't work in the Framework projects, so I uninstalled it from every project and installed v 5.0.0.0 in every project. This then wouldn't build because Visual Studio threw errors in the .NETStandard projects saying "downgrade detected, please restore the updated version"

SO then I installed 5.9 (which is now the latest version) into all the .NETStandard projects, leaving 5.0.0.0 in the .NET Framework ones.

Now it will build, but the FileNotFound exception throws again when I try to run it.

So I have tried;

  • Everything using ServiceStack.Text 5.9
  • Everything using ServiceStack.Text 5.0
  • .NET Framework projects using 5.0 and .NETStandard (2.0) projects using 5.9
  • Uninstalling and reinstalling multiple times
  • Deleting all obj directories, cleaning and rebuilding
  • Checking all project and packages files

Wasted most of the day on this, so turned to SO... I do hope someone can help!

How do I understand changes across different versions of framework (System.*) NuGet packages?

$
0
0

I've got a .NET Framework 4.7.2 application, and am using the .NET CLI tooling and SDK-style projects, and have been happily building my application for some time.

After doing the appropriate performance measuring, I want to bring in System.Text.Json to replace a few uses of Newtonsoft.Json in one my netstandard2.0 assemblies. So I go to NuGet.org and look at the versions available, and I see 4.6.0, 4.7.0, 4.7.1, and 4.7.2.

Just "getting the latest" (4.7.2) warns me about upgrading a slew of other packages:

  • System.Buffers.4.4.0 -> System.Buffers.4.5.1
  • System.Memory.4.5.3 -> System.Memory 4.5.4
  • System.Numerics.Vectors.4.4.0 -> System.Numerics.Vectors.4.5.0
  • System.Runtime.CompilerServices.Unsafe.4.5.2 -> System.Runtime.CompilerServices.Unsafe.4.7.1
  • System.Threading.Tasks.Extensions.4.3.0 -> System.Threading.Tasks.Extensions.4.5.4

Even the older 4.6.0 warns me about upgrading some of those packages, with (understandably) different target versions:

  • System.Buffers.4.4.0 -> System.Buffers.4.5.0
  • System.Numerics.Vectors.4.4.0 -> System.Numerics.Vectors.4.5.0
  • System.Runtime.CompilerServices.Unsafe.4.5.2 -> System.Runtime.CompilerServices.Unsafe.4.6.0
  • System.Threading.Tasks.Extensions.4.3.0 -> System.Threading.Tasks.Extensions.4.5.2

Where is documentation on the scope of these changes including dependent packages to help me choose which version to bring into my application?

I've looked in the GitHub repository for commits that say anything about these package versions (e.g.System.Text.Json.4.7.1), but haven't found any. I can surmise from the release dates that they're connected to SDK/Runtime releases. For example, 4.7.0 was published on 3-Dec-2019, the release date for .NET Core 3.1; but what about 4.7.1 and 4.7.2? They look likely to be connected with servicing releases, but I'm struggling to find documentation of that.

I'm not targeting .NET Core 3.1 - I'm not targeting.NET Core at all - so "just use the latest and stay up-to-date" isn't a satisfactory answer; I want to understand runtime and API compatibility and be aware of breaking changes, even down the dependency tree. How can I find this information? Is it even available without closely tracking development in the GitHub repository?

Google Pagespeed Insights V2 API on Nuget package why updated, if the API closed many years?

$
0
0

I realized the Google shutted down the PageSpeed Insights V2 and maybe V4 API too (years ago).

You can look at on this link:https://developers.google.com/speed/docs/insights/release_notes#version-2

If you look at the endpoints, you will see the same result:

What i want to ask, then why on NUGET package manager the Google.Apis.PagespeedInsights.v2 updated many times (the last 3 month ago)??:https://www.nuget.org/packages/Google.Apis.Pagespeedonline.v2/enter image description here

Viewing all 3186 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>