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

What is the difference between Microsoft.Azure.Management.Resourcemanager.Fluent and Microsoft.Azure.Management.Fluent nuget packages?


NuGet do I need to install Microsoft.EntityFrameworkCore if all I need is its provider?

$
0
0

I'm relatively new to NuGet. I plan to make only use of a sqlite database in my project. Using the NuGet Packet Manager I saw that there are several packages related to Microsoft.EntityFrameworkCore.

If make use of only sqlite would the Microsoft.EntityFrameworkCore.Sqlite package suffice or is it also important to install Microsoft.EntityFrameworkCore package?

I feel a bit confused, when should I install Microsoft.EntityFrameworkCore instead of Microsoft.EntityFrameworkCore.Sqlite and vice versa?

How to force use of a specific package version using PackageReference

$
0
0

I seem to have a problem I can't solve.

I have a .NET Core 2.0 console app. This app requires a niche-nuget package that I only have available locally. Let's call it NicheNuget.

Both the console app and the NicheNuget package depends on a second package that we can call SecondNuget. This SecondNuget is also a package that I only have locally, and only have one version of.

My console app reference these packages:

<PackageReference Include="NicheNuget" Version="1.0.0.8" />
<PackageReference Include="SecondNuget" Version="0.0.0.45" />

Everything compiles, and all is splendid right until my console app tries to use SecondNuget:

system.IO.FileLoadException: Could not load file or assembly 'NicheNuget, Version=2.0.0.1, Culture=neutral, PublicKeyToken=null'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

I'm absolutely 200% sure that neither my console app or any project that I have attempts to get a version 2.0.0.1 of NicheNuget. And I can use the NicheNuget package just fine through my console app. SecondNuget however doesn't play nice. The second I call a class that makes use of SecondNuget, I will get the FileLoadException. This leads me to believe that it is SecondNuget that is trying to find NicheNuget with a version that I don't have.

SecondNuget should run just fine with the version I have of NicheNuget. I know they're compatible. What I'm entirely lost on is:

**How can I force the use of NicheNuget version 1.0.0.8 on SecondNuget, instead of the attempted use of 2.0.0.1 which I don't have?

Create NUGET package to support Both Asp.Net MVC and Asp.Net core MVC

$
0
0

I have created the library project with TragetFramework is .NetFramework 4.5

I released the library project as Nuget package. By using this Nuget package developer can able to Create Razor Html control in Asp.Net MVC project. This is working as we expected.

My problem is now I want to support Asp.Net core MVC project also. How can I create NUGET package to support Both Asp.Net MVC and Asp.Net core MVC.

Download all packages from private nuget feed

$
0
0

I want to download all packages in all version from my private nuget feed. Thats it. I have no problem in using powershell, bash, package manager what ever.

I can't use a placeholder project - that references all packages and copy my cache, because I need all versions.

Any idea?

I am working with a private nuget-feed. The feed is kind of broken, but its not in my hand to fix it. So I have to go this way...

How do you package native dependencies in a nuget package for AnyCpu for SDK-Style project users?

$
0
0

I'm currently working on an application using .Net Framework 4.5 using the new SDK-style Project Format. I want to create a nuget package for a third party dependency that consists of an AnyCpu Assembly and native dependencies with differing names for x86 and x64. I want just all native dependencies copied in the case of an AnyCpu-Build and only the respective libraries when compiling my program with x86/x64.

I tried creating a nuget with the following structure:

- lib
   - net452
       - Dependency.AnyCpu.Assembly.dll
- runtime
   - win7
       - native
           - Dependency.Native.x86.dll
           - Dependency.Native.x64.dll
   - win7-x86
       - native
           - Dependency.Native.x86.dll
   - win7-x64
       - native
           - Dependency.Native.x64.dll

Which works for the x86 and x64 case, but fails to copy anything in the AnyCpu case. Without the win7 folder there is no difference.

A .props-file with the following content:

<?xml version="1.0" encoding="utf-8" ?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup Condition="'$(Platform)' == 'AnyCPU'">
    <Content Include="$(MSBuildThisFileDirectory)..\..\runtimes\win7-x86\native\*">
      <Link>%(Filename)%(Extension)</Link>
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      <Visible>False</Visible>
    </Content>
    <Content Include="$(MSBuildThisFileDirectory)..\..\runtimes\win7-x64\native\*">
      <Link>%(Filename)%(Extension)</Link>
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      <Visible>False</Visible>
    </Content>
  </ItemGroup>
</Project>

copies all native dependencies no matter which architecture I set.

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?

why there's only one ICSharpCode.SharpZipLib's in vs 2017 nuget manager?

$
0
0

enter image description herein net 4.6 web project i need to update ICSharpCode.SharpZipLib.dll from 0.85.4 to 0.86 but in nuget there is only one version.

How do i update the dll?


How do I use OpenCover and ReportGenerator to view Unit Test Coverage Results?

$
0
0

I'm a noob to using both OpenCover and ReportGenerator and I'm struggling a bit in understanding how to get them working. I'm using VS.NET 2012 'Professional' which means I don't have access to the built in unit test coverage tooling. I also have ReSharper installed, but don't want to pay for another utility in 'dotCover'

It looks like OpenCover and ReportGenerator will do what I need and I see the documentation that was downloaded alongside, but am missing some understanding. 1st off, when I download the nuget packges for both, what should my target project be? I have a multi layer app, so I'm assuming my unit test project correct, or does it even matter? I see in the documentation, I'm just pointing at the /bin (I think) of a solution using command line commands, so maybe I didn't even need to add these downloads to any particular project (could have been a test harness). Can someone tell me if I have this correct?

Once I have them installed, I'm trying to get unit test coverage metrics, and the docs that came with the package are not as clear as I hoped. Are there any good blog posts or links that walk through using these tool together to get the metrics?

Extract NuGet packager in Azure DevOps

$
0
0

I am trying to extract Nuget Package in Azure DevOps as part of build. I don't have dedicated plugin in Azure DevOps to unpack Nuget package. I just use zip extractor.

I see some errors,

stderr: 2019-10-25T14:28:54.9806038Z ERROR: Can't allocate required memory!

I have attached pic as wellenter image description here

.NET Core 2.2 Include css and js in nuget package or external dll to hosting project

$
0
0

I am having a problem adding css/js files from my dll to other projects. Problem occurs in 2 situations:

  • Different solution includes this nuget package, I only got "shortcuts" of my files, cannot see them, they are not copied, they don't work on server.
  • Inside nuget package I have test project, when I include reference to this dll I still cannot use those at all.

How code structure is done:

  • project that runs have nothing inside, I have added app.UseMvc(routes => {});

  • Dll project (nuget) I am referencing has got all in area admin controller/view/css/js logic

I can enter the controller view without a problem, but I got 404 errors about my static files. Adding app.UseStaticFiles(); doesn't fix the problem.

Can someone tell me how to handle this?

How to define the successor package ID after a rename of the NuGet Package ID

$
0
0

I know, you should not change the Package ID of a NuGet Package. But I did, because of a big refactoring.

Now I want to know if there is a proper way to define a successor NuGet package.

Old ID in Nuspec: OldLibrary1
New ID in Nuspec/csproj file: Library1

If a user opens the NuGet Package Management window for a Visual Studio Solution and the old package (ID OldLibrary1-1.0.0) is installed, he should see an update/upgrade to package Library1-2.0.0.

Is there a possible way to define this in some way?

By the way I use ProGet as NuGet server.

Can't Install Package

$
0
0

I Was Trying to Install this package but this keeps getting error. I also Tried Changing The Target Framework to 4.7 and 4.7.2

Installing 'Anviz.SDK 2.0.4'.

Successfully installed 'Anviz.SDK 2.0.4'.

Adding 'Anviz.SDK 2.0.4' to Anviz.

Uninstalling 'Anviz.SDK 2.0.4'.

Successfully uninstalled 'Anviz.SDK 2.0.4'.

Install failed. Rolling back...

Could not install package 'Anviz.SDK 2.0.4'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5', 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.

Xamarin.Firebase.Auth wont work when install Xamarin.Firebase.Messages

$
0
0

I'm struggling to understand why when I install Xamarin.Firebase.Messaging the auth is null in the code below:

private void InitFirebaseAuth()
{
     app = FirebaseApp.Instance;

     auth = FirebaseAuth.GetInstance(app);

     using (var user = auth.CurrentUser)
     {
          if (user != null)
          {
               StartActivity(new Intent(this, typeof(MainActivity)));
               Finish();
          }
      }            
}

auth = FirebaseAuth.GetInstance(app) is null, when I uninstall Xamarin.FIrebase.Messaging everything works fine.

I think that there is something with NuGet packages but I can't resolve this problem.

The version of packages like the foto below:

enter image description here

Any help, please?

Versioning Nuget Package with GitVersion.yml in Azure Devops

$
0
0

I'm stucking with this for a whole week and I didn't reach where i wanted. I'm thinking about having two branches:

-master

-release(we are calling it vNext - the whole company knows it by this name)

Master branch will generate the packages without prerelease tag. Release will generate the pre release version like:

=>master is on 1.0.0

=>Create a vNext(release) branch like: vNext/1.1.0

=> Code things needed here and commit;

=> Automatically my pipeline is triggered, because I've set the trigger to branch master, vNext or vNext/*

=> I want this to create a package like (1.1.0-beta1)

=>Create a pullRequest to master

=> Automatically my pipeline is triggered,

=> I want this to create a package like (1.1.0)

This is my gitVersion.yml

next-version: 1.0
mode: Mainline
legacy-semver-padding: 0
build-metadata-padding: 0
commits-since-version-source-padding: 0
assembly-versioning-scheme: MajorMinorPatch
assembly-file-versioning-scheme: MajorMinorPatchTag
assembly-informational-format: '{LegacySemVer}'
branches:
  master:
    regex: master
    increment: Patch
    prevent-increment-of-merged-branch-version: true
    tag: ''
    track-merge-target: false
    tracks-release-branches: false
    is-release-branch: false
  release:
    regex: vNext?[/-]
    source-branches: ['master']
    increment: Patch
    prevent-increment-of-merged-branch-version: true
    tag: beta
    track-merge-target: false
    tracks-release-branches: false
    is-release-branch:  true


I can't get this working fine. To reach where I'm now, I've already googled a lot even here in stackoverflow, but couldn't found a solution that fits in the scenario I need.


Is compilation for a .NET Core version in "Maintenance" level (2.2 today) useful at all?

$
0
0

I am creating a multi-target nuget package that currently targets .NET 4.5, .NET Core 2.1 and .NET Core 3.0.

Microsoft seems to promote the change vom .NET Core 2.1 to 2.2.

Since .NET Core 2.2 is advertised as in "Maintenance" mode, and will have "End of Support" soon, I am wondering whether I should even bother to include .NET Core 2.2 as a target, especially since the "older" .NET Core 2.1 seems to be supported until around 2021.

Would my nuget package benefit from targetting .NET Core 2.2, or would any potential referencing project be happy to use the .NET Core 2.1 version anyway?

Note: My Dependencies for .NETCoreApp 2.1 are as follows

Microsoft.AspNetCore.Http.Abstractions (>= 2.1.1)
System.Data.SqlClient (>= 4.5.1)

uninstall nuget package that no longer exists

$
0
0

We had our nuget server die and the admin never made a backup. So now building on a new install won't work b/c there is nothing in the cache and it can't recreate the dependency list. I tried to force uninstall but it says that I have to restore the package before uninstalling it so it can build the dependency tree. Argh. I just want the package out of the solution so we can rebuild the site. I also tried removing it from packages.config but that didn't help.

Is there a way to manually force delete a nuget package without having access to it anymore? Otherwise I need to build a new solution from scratch and migrate the files over.

Here are the commands I tried:

uninstall-package packagename -RemoveDependencies -force

and

uninstall-package packagename -force

Here is the config file:

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="custom.serialization" version="2017.3.20.142224" targetFramework="net462" />
  <package id="custom.themes.flat-blue" version="2016.12.9105400" targetFramework="net452" />
  <package id="Microsoft.AspNet.Cors" version="5.2.3" targetFramework="net452" />
  <package id="Microsoft.AspNet.Mvc" version="5.2.3" targetFramework="net452" />
  <package id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net452" />
  <package id="Microsoft.AspNet.WebApi" version="5.2.3" targetFramework="net452" />
  <package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net452" />
  <package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net452" />
  <package id="Microsoft.AspNet.WebApi.Cors" version="5.2.3" targetFramework="net452" />
  <package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.3" targetFramework="net452" />
  <package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net452" />
  <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net452" />
  <package id="Newtonsoft.Json" version="10.0.2" targetFramework="net462" />
  <package id="NLog" version="4.4.5" targetFramework="net462" />
  <package id="NLog.Extended" version="4.0.0.1" targetFramework="net452" />
  <package id="NLog.Web" version="4.4.0" targetFramework="net452" />
</packages>

Thanks

Building NuGet packages from Visual Studio

$
0
0

I'm trying to share an internal company assembly via NuGet packages and a private source. This assembly targets .NET Framework 4.6.1. I want these NuGet packages to pack automatically from Visual Studio during the release build. I see I can add <GeneratePackageOnBuild>true</GeneratePackageOnBuild> to .csproj. I'm not sure if this is a .NET Standard-specific property but it seems to partially work. However, when I build, I get

error MSB4044: The "GetPackOutputItemsTask" task was not given a value for the required parameter "PackageOutputPath".

I've been trying to learn how to pass this parameter from within Visual Studio but I don't see a lot of documentation on parameters except when calling it from the command line manually. Is there an easy way to do this from within Visual Studio? Am I going about this wrong?

Edit: This is using a .NET Framework class library. I can run the pack command from the command line giving it the required parameters with /p:PackageOutputPath="path\here". It seems this might have been designed for .NET Core and Standard projects and Visual Studio might not handle packing .NET Framework projects.

TuesPechkin: IIS-hosted application

$
0
0

I'm having trouble trying to setup the PDF to HTML converter from the TuesPechkin Nuget package. I have it set up like mentioned here:

This is my code in my aspx.cs page:

private static IConverter converter = 
    new ThreadSafeConverter(
        new RemotingToolset<PdfToolset>(
            new Win64EmbeddedDeployment(
                new TempFolderDeployment())));

Everything goes fine except the Win64EmbeddedDeployment part says:

The type or namespace name 'Win64EmbeddedDeployment' could not be found (are you missing a using directive or an assembly reference?)

Anyone know how to do resolve this and if I'm going on the right track here?

Specify a Nuget package source in vs code

$
0
0

I want to specify the NuGet package source in vs code since I got follow error :

enter image description here

Those packages from a customized NuGet source which is causing this issue.

Is there have any way can help me resolve this case?

Viewing all 3154 articles
Browse latest View live


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