Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow

ModuleInitializeException on Azure Deployment: Missing Dependencies for Microsoft.Identity.Web.Certificate Version 1.25.3

$
0
0

I'm using PackageReference Include="Microsoft.Identity.Web.Certificate" Version="1.25.3" in my project. The application runs successfully on my local machine. However, when deployed to any environment in Azure, I encounter a ModuleInitializeException error. This error message states that "Azure.Identity" cannot be loaded for the module C:\home\site\platform\app_data\modules\TestModule.Web.dll.

PackageReferenceApplication Event Logs -\> Error

Upon investigation, I found that the following libraries are missing in the Azure environment, causing the issue:

  • Azure.Security.KeyVault.Secrets.dll
  • Microsoft.Identity.Client.Extensions.Msal.dll
  • Azure.Identity.dll

These libraries appear to be related to the Microsoft.Identity.Web.Certificate package. I have tried upgrading and downgrading the package version, but the issue persists. Any suggestions for resolving this error?

Missing Libraries

NuGet Update failure in Visual Studio 2019

$
0
0

I am having an issue with NuGet in Visual Studio 2019 (v.16.9.0).

My Solutions are all ASP.NET MVC Web Apps. I run on a local LAN. In the NuGet Package Manager 'Allow NuGet to download packages' and 'Automatically check for missing packages during build are both selected. I am using Packages.Config for management and the source is https://api.nuget.org/v3/index.json. VS is able to communicate via the Windows Defender Firewall. The target framework is .NET 4.7.2

The first issue is that, when I do a package restore after deleting the packages in the folder, it shows this error:

The requested operation cannot be performed on a file with a user-mapped section open.

After I do the build, the files are being created correctly, including the new/existing DLLs. These replenished/refreshed DLLs work perfectly and the program runs. The strange part, however, is that the relevant NUPKG file has zero content (which is obviously triggering the error). The message eventually disappears after completion of the DLL downloads I assume. All good so far but with zero content in the NUPKG file.

When I now try to update a package things go awry, the Error List shows:

An error occurred while trying to restore packages. The file is not a valid nupkg. File path...

Then after a full restart of VS, I get this:

An error occurred while retrieving package metadata for 'ABC.3.5.0.2' from source 'I:....\packages'.

'ABC' being the first file in the package list. It therefore appears to be failing because the relevant NUPKG has no content.

I am able to paste any file freely to the packages folder and its sub-folders, indicating that there is no lock on the files. Also VS is able to write the rest of the package structure to the folder without issue.

I think this must mean that something is specifically locking/blocking the NUPKG files (or deleting their content during creation perhaps). A search reveals nothing that I can see.

I even tried creating a brand new solution. During creation, the identical error message above popped up a warning. I also tried a few other of my existing solutions and got the same result. I updated VS and then I even did a full VS reinstall to the latest version, all to no avail.

I first noticed the issue after defining dependencies during an Azure Web App deployment (the Azure deployment tool optionally allows for updates to NuGet packages). After the NuGet update failed I set the option to blank and deployed anyway, the idea being to manually update the packages later. I cannot be certain, but I think this is when I discovered the issue. Could this process have changed a VS config setting somewhere perhaps?

Before the reinstall I opened the devenv.exe.config from inside VS and changed the IPV6 setting to false. No luck, so I have changed it back. I also did a test on one of the packages, downloading the package from the NuGet site directly and replacing the VS downloaded version, but I get the same errors.

Install failed. Rolling back... Package 'System.Buffers 4.5.1' does not exist in project 'ClickAuth_Graph' Package 'System.Buffers 4.4.0' already exists in folder 'I:\My Drive\Backups\ClickAuth_Graph (01_03_21)\packages' Added package 'System.Buffers 4.4.0' to 'packages.config' Removing package 'System.Buffers 4.5.1' from folder 'I:\My Drive\Backups\ClickAuth_Graph (01_03_21)\packages' This file is not a valid nupkg. File path...\packages\System.Buffers.4.5.1.nupkg Central Directory Corrupt An attempt was made to move the file pointer before the beginning of the file. At line:1 char 1•   Update-Package System.Buffers +CategoryInfo NotSpecified: (:) [Update-Package], Exception o   FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.UpdatePackageCommand

For the record, I have one stale NuGet package in the portfolio. I don't use GitHub, but a repository was set upfront. I have not recently committed anything to GitHub.

How can I exclude .NET 9 updates in Visual Studio Package Manager

$
0
0

The Package Manager in Visual Studio 2022 tries to force me to update System/Microsoft packages to .NET9 versions. But I don't want to use .NET9, instead, stay on the latest .NET8 patch versions.

Is there any way to limit versions in Package Manager to major version 8?

For example:

Microsoft.EntityFrameworkCore 8.0.8=> Microsoft.EntityFrameworkCore 8.0.11But not to: Microsoft.EntityFrameworkCore 9.0.0

So, the annoying thing is, that the Updates view always shows me tons of updates, which I don't want, and I have to look up every individual package to check if a patch version within the .net8.0 framework is available.

Visual Studio package manager view, showing all NET 9 updates

I get the same issue when checking for updates in Powershell via dotnet command:

dotnet list "Utility.sln" package --source "nuget.org" --framework "net8.0" --outdated

The --framework "net8.0" option doesn't limit new versions to .NET 8 packages.

I am using Central Package Management (CPM), with Directory.Packages.props file for versions.

Temporary workaround

With the dotnet command, the options --highest-minor and --highest-patch exist, but for checking only.

dotnet list "Utility.sln" package --source "nuget.org" --outdated --highest-patch

An alternative for updates is the Package Manager console in Visual Studio itself, or another, similar use of NuGet commands:

Update-Package "Microsoft.EntityFrameworkCore" -ToHighestPatch

or all packages (filter by source, e.g. nuget.org, is also possible).

Update-Package -ToHighestPatch 

How do I manage local nuget packages safely?

$
0
0

Our team has just started working with NuGet packages, for now locally on a local server directory. The problem starts when several developers are working on the same project and both accidentally up their patch build to the same version and upon publishing it they override each other.

How can I work with local nuGet packages safely?

System.Runtime.CompilerServices.Unsafe.dll 6.1 has two different assembly versions

$
0
0

I have been upgrading all our projects to target .NET framework 4.6.2 and I'm running into a maddening problem. When I run the application it runs fine. However, when I run the unit tests I get an assembly load failure:

=== Pre-bind state information ===LOG: DisplayName = System.Runtime.CompilerServices.Unsafe, Version=6.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a (Fully-specified)LOG: Appbase = file:///C:/Source/FeatureBranch/Kernel/CDSCore.Tests/bin/DebugLOG: Initial PrivatePath = NULLLOG: Dynamic Base = NULLLOG: Cache Base = NULLLOG: AppName = NULLCalling assembly : Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.===LOG: This bind starts in default load context.LOG: Using application configuration file: C:\Source\FeatureBranch\Kernel\CDSCore.Tests\bin\Debug\CDSCore.Tests.dll.configLOG: Using host configuration file: LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.LOG: GAC Lookup was unsuccessful.LOG: Attempting download of new URL file:///C:/Source/FeatureBranch/Kernel/CDSCore.Tests/bin/Debug/System.Runtime.CompilerServices.Unsafe.DLL.LOG: Assembly download was successful. Attempting setup of file: C:\Source\FeatureBranch\Kernel\CDSCore.Tests\bin\Debug\System.Runtime.CompilerServices.Unsafe.dllLOG: Entering run-from-source setup phase.LOG: Assembly Name is: System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3aWRN: Comparing the assembly name resulted in the mismatch: Build NumberERR: The assembly reference did not match the assembly definition found.ERR: Run-from-source setup phase failed with hr = 0x80131040.ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

So if I compare the two dlls (One in the CDSCore.Tests folder and another in a system dll dir CDSCore) See this:

Properties of two dlls

They are the exact same file. However, if I open them in ildasm you see this which shows different assembly versions. How on earth is this the case?

idasm view of two files

Visual Studio NuGet says I have 3 vulnerable packages, then shows me 0

$
0
0

So NuGet says I have 3 vulnerable packages. But when I then ask for a listing of the vulnerable packages, I get 0. What is going on here?

Update: And it gets weirder. I updated Visual Studio and now:

  1. Looking at NuGet for the solution it says I have 1 vulnerable package, but shows 0.
  2. Looking at NuGet for my main web project it says I have 5 vulnerable packages - and shows all 5.

So clearly there's some bugs around this in the latest Visual Studio pre-release.

enter image description here

How to correctly specify version range for dependency..?

$
0
0

I'm creating an SDK and utilize Newtonsoft.Json. I want to allow any version of 11 and any version of 12, so I set my package ref like this:

<PackageReference Include="Newtonsoft.Json" Version="[11,13)" />

However, when I attempt to install my SDK into another existing solution, installation fails with the following error:

NU1603: MySampleSdk 0.0.1 depends on Newtonsoft.Json (>= 11.0.0 && < 13.0.0) but Newtonsoft.Json 11.0.0 was not found. An approximate best match of Newtonsoft.Json 11.0.1 was resolved.

Isn't 11.0.1 within >= 11.0.0 && < 13.0.0?

What am I missing here?

Xamarin.Google.Android.Play.App.Update package issue

$
0
0

I have implemented in-app updates for android in .NET MAUI using this package

<ItemGroup><PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" /><PackageReference Include="Newtonsoft.Json" Version="13.0.3" /><PackageReference Include="CommunityToolkit.Maui" Version="9.0.2" /><PackageReference Include="Microsoft.AppCenter" Version="5.0.3" /><PackageReference Include="Microsoft.AppCenter.Crashes" Version="5.0.3" /><PackageReference Include="Microsoft.AppCenter.Analytics" Version="5.0.3" /><PackageReference Include="Microsoft.Identity.Client" Version="4.61.0" /><PackageReference Include="Microsoft.Maui.Controls" Version="8.0.70" /><PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.70" /></ItemGroup><ItemGroup Condition="'$(TargetFramework)' == 'net8.0-android'"><PackageReference Include="Xamarin.Firebase.Messaging" Version="123.0.8" /><PackageReference Include="Xamarin.Google.Android.Play.App.Update" Version="2.1.0.10" /></ItemGroup>

But when building the project this error is coming

Error JAVA0000: Error in /.nuget/packages/xamarin.androidx.collection.jvm/1.4.0.5/buildTransitive/net8.0-android34.0/../../jar/androidx.collection.collection-jvm.jar:androidx/collection/ArrayMapKt.class:Type androidx.collection.ArrayMapKt is defined multiple times: /.nuget/packages/xamarin.androidx.collection.jvm/1.4.0.5/buildTransitive/net8.0-android34.0/../../jar/androidx.collection.collection-jvm.jar:androidx/collection/ArrayMapKt.class, /.nuget/packages/xamarin.androidx.collection.ktx/1.2.0.9/buildTransitive/net6.0-android31.0/../../jar/androidx.collection.collection-ktx.jar:androidx/collection/ArrayMapKt.classCompilation failedjava.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: /.nuget/packages/xamarin.androidx.collection.jvm/1.4.0.5/buildTransitive/net8.0-android34.0/../../jar/androidx.collection.collection-jvm.jarandroidx/collection/ArrayMapKt.classat com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:135)at com.android.tools.r8.D8.main(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:5)Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: /.nuget/packages/xamarin.androidx.collection.jvm/1.4.0.5/buildTransitive/net8.0-android34.0/../../jar/androidx.collection.collection-jvm.jar:androidx/collection/ArrayMapKt.classat Version.fakeStackEntry(Version_8.2.33.java:0)at com.android.tools.r8.T.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:5)at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:82)at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:32)at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:31)at com.android.tools.r8.utils.S0.b(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:2)at com.android.tools.r8.D8.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:42)at com.android.tools.r8.D8.b(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:13)at com.android.tools.r8.D8.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:40)at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:122)... 1 moreCaused by: com.android.tools.r8.utils.b: Type androidx.collection.ArrayMapKt is defined multiple times: /.nuget/packages/xamarin.androidx.collection.jvm/1.4.0.5/buildTransitive/net8.0-android34.0/../../jar/androidx.collection.collection-jvm.jar:androidx/collection/ArrayMapKt.class, /.nuget/packages/xamarin.androidx.collection.ktx/1.2.0.9/buildTransitive/net6.0-android31.0/../../jar/androidx.collection.collection-ktx.jar:androidx/collection/ArrayMapKt.classat com.android.tools.r8.utils.Q2.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:21)at com.android.tools.r8.utils.D2.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:54)at com.android.tools.r8.utils.D2.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:10)at java.base/java.util.concurrent.ConcurrentHashMap.merge(ConcurrentHashMap.java:2048)at com.android.tools.r8.utils.D2.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:6)at com.android.tools.r8.graph.m4$a.d(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:6)at com.android.tools.r8.dex.c.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:61)at com.android.tools.r8.dex.c.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:12)at com.android.tools.r8.dex.c.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:9)at com.android.tools.r8.D8.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:45)at com.android.tools.r8.D8.d(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:17)at com.android.tools.r8.D8.c(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:69)at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:28)... 6 more(JAVA0000)

Can someone tell me, what exactly is the issue and a fix for that?This issue came when I installed

<PackageReference Include="Xamarin.Google.Android.Play.App.Update" Version="2.1.0.10" />```**NOTE: For lower versions of the Xamarin.Google.Android.Play.App.Update package, I'm not getting this error, but not able to use IInstallStateUpdatedListener (for lower versions)**

Difference in NuGet processing via `dotnet add package ..` vs nugets adding via visual studio UI

$
0
0

I need to use native C libraries in my library (that supports several Core TFs and .NET Framework) which is published via NuGet. I configured it via a .csproj file and a runtimes folder, but I noticed that when I consume my NuGet via dotnet add package ... in some cases, the native libraries are not copied into the expected folder after consuming, however when I use the Visual Studio NuGet Package Manager and select "Manage NuGet Packages for Solution", all files are placed into correct places.

So, I assume that NuGet package manager makes more steps than just calling dotnet add package ..., but it's unclear what exactly happens.

Getting error when using GitHub Actions to push the nupkg to my GitHub packages [duplicate]

$
0
0

I'm getting a "Specified source 'github' is invalid" error when trying to build and push a NuGet package to GitHub NuGet Packages.

Does anyone know why, or what the source should be? I can't see anything in the GitHub documentation about this value, or even the end URL that will host my packages (I'm hoping it will just show in the packages tab when one is created).

I have just seen that GitHub has Actions now, so you can get your code to build/test when changes are merged. I have also seen that you can now also publish a NuGet package and host it within GitHub too. Looking at the screenshot below, it seems it should be quite easy to do:

enter image description here

It took me a while to realize I needed to create an Action to put this code into, so here is my action code (YAML):

enter image description here

This action runs when I commit, and it all passes until the last line for pushing to GitHub. I get an error on the last line:

The specified source 'github' is invalid. Please provide a valid source

Which AspNetCore package version should 3rd party NuGet package developers target?

$
0
0

Which AspNetCore package version should 3rd party NuGet package developers target?

I'm working on a set of Blazor Components. It has many projects each packaged and published as NuGet packages. But of course all projects depends on some AspNetCore NuGet packages. Currently using .NET 5 Version="5.0.0" packages. But recently Microsoft released Version="5.0.3".

<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="5.0.0" /><PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="5.0.0" />

So the question is what is the recommended way to develop and distribute my (3rd) party Blazor Nuget packages?

A. Keep the dependent MS framework packages version as low as possible? So it works with projects which targets lower versions and might work/or not work with projects which using the latest official MS AspNetCore packages

B. Or always update to the latest AspNetCore packages to get all bug and security fixes? But in this case who wants to use my packages probably need to update their projects to the latest version as well? Which they might don't want to do.

I think the question can be relevant not just in case of Blazor Nuget packages. But all 3rd party Nuget package which uses other Microsoft Nuget packages

Could not load file/assembly 'office, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'. The system cannot find the file specified

$
0
0

I am using VS 2022 to develop windows application. In which I want to write some data into Excel. I have installed NuGet package Microsoft.Office.Interop.Excel Version 15.0.4795.1001 and I have Microsoft Excel 2019. And I am using dot net Framework 6.0.

My project is working fine until the excel part comes. I can see the assembly file in bin folder of my project for version 15.0.4795.1001, but the error occurring is for version 15.0.0.0.

Please help me to solve this issue.

I have tried to give COM reference Microsoft Office 16.0 Object Library but the Excel is conflicting between COM reference and NuGet package.

I have tried installing Microsoft Excel 2010 but still same error is occurring.

I have tried to update Microsoft.Office.Interop.Excel Version 14.0.0.1, same error is continued.

Xamarin PCL Refit 3.0.1 , Doesn't look like a Refit interface

$
0
0

I recently started working on a Xamarin Android/iOS project with a PCL class where I want to put all the logic in. Like my Refit interfaces, ReactiveUI ViewModels et cetera, but every time when trying to execute my code I get a error saying that my interface is not a Refit interface. Currently my interface looks like this.

public interface IMyApi{    [Post("/authenticate")]    IObservable<Models.ApiResponses.AuthenticationResponse> SigninRaw([Body] JObject credentials);    [Get("/service")]    IObservable<Models.ApiResponses.MyListResponse> GetServiceListRaw();    [Get("/service/{id}/idstatus")]    IObservable<Models.ApiResponses.IdResponse> GetIdStatusRaw(string Id);}

As far as I know this looks good and this also works when I'm trying to load this from a specific platform like iOS project. But when trying to do it from a PCL if fails! I have installed the Refit package in both of my platform specific project Android & iOS and I referenced a dll in the PCL, what did I miss?

If there is need for more information or you have any question, please do not hesitate to ask.Well without further ado, thank you for reading and hopefully someone can assist me with this, because I starting to loose my mind the past couple of days.

Edit: added calling method.Here I calling it from a ViewModel

var client = new HttpClient(NetCache.UserInitiated){    BaseAddress = new Uri("https://api.address.com")};var api = RestService.For<IMyApi>(client); <= here it crashesvar response = api.SigninRaw(token);

nuget package manager now want to install transitive package by default?

$
0
0

example of the issue

I want to update a few nuget package and I notice that it now want to install the transitive package by default, show a simple example above

This is new to me, is there a way to return to the old way of just installing the package where the nuget is used?

I dont want to update dozen of csproj with dependency for no reason.

Where is the change log for this behavior?

Removed NuGet package and can't reinstall it in UE5 C++ project

$
0
0

I encountered an issue with updating NuGet packages in my Unreal Engine 5 (C++) project using Visual Studio 2022. While trying to solve it, I removed the Blake3 NuGet package. After managing to update the other packages, I ran into a new problem: compilation errors related to the missing Blake3.

Now I am getting the following errors:

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

I tried to install the Blake3 package using Manage NuGet Packages for Solution, but I ended up getting errors indicating that the installation failed.

Can I remove all NuGet packages and reinstall them? If so, how can I do this? Or is there a way to restore only Blake3? All the packages were previously installed automatically.

I am a beginner, so I am not sure what steps to take. I have attached a screenshot from the Error List for reference. If you need any additional details, please let me know. Any help would be greatly appreciated!

enter image description here


After installing Bootstrap by Manage NuGet Packages, the Bootstrap files do not show for referencing

$
0
0

I installed Bootstrap 4.x via Manage NuGet Packages in Visual Studio for this solution, but the Bootstrap files does not show for referencing.

Here is a screenshot of my NuGet output:

What is it wrong? How can I fix it?

This is in Visual Studio 2017.

Best way to resolve NU190X issues reported in VS

$
0
0

I have a large project which is using 3rd party libraries. Recently i have been seeing errors advising some of the packages have vulnerabilities.

Most of these are transitive packages that need some attention. What would be the most feasible way to update these? I can do this through NuGet but then im adding this package to my project?

What would happen if the 3rd party upgrades the vulnerable package themselves and ive already installed another version?

Ive checked out this and the blogs https://learn.microsoft.com/en-us/nuget/reference/errors-and-warnings/nu1901-nu1904 but they dont seem to offer much insight to these questions

Referencing a .NET Standard library from an ASP.NET web application

$
0
0

The title really says it all already. I have a website running on .NET 4.8.1. And a whole bunch of libraries that are currently also targetting .NET 4.8.1.

I want to use a lot of these libraries in a new .NET Core application.Because one of these libraries contained a lot of references to membership which is no longer included in .NET Standard/.NET Core, I changed the membership to Identity. I put a few of these files in a new project that targets .NET Standard 2.0, so that I can also use identity in a new Blazor web application in the future.

However when I reference this project from my ASP.NET web application, Visual Studio does not show any build errors, but when I try to run the web application, I get the following error:

Could not load file or assembly 'netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.

How can I make sure this works?

I tried updating my ASP.NET web application to package reference, but then Visual Studio throws an error saying my project is not applicable for updating to package reference.

Is there a way to make this work? Tried installing netstandard.library through nuget but also this did not work.

Thanks

.NET 8 Upgrade and Microsoft.AspNet.WebApi.Core 5.3.0

$
0
0

Problem: We have an app on .NET 6 and with the upcoming 11/4 deadline, we want to move onto .NET 8. When I upgraded the solution's projects, I only had one Nuget package that was flagged as ...not fully compatible with the projectand it was reverted to a legacy version. It was Microsoft.AspNet.WebApi.Core 5.3.0

Q: Is there an alternative for Microsoft.AspNet.WebApi.Core 5.3.0that people are using for .NET 8, or is everyone just waiting for Microsoft to make it compatible with .NET 8?

ScreenShot

enter image description hereThanks for any insight you guys can offer. Take care!

Managing NuGet package dependency updates in a local NuGet repository

$
0
0

Let's suppose there is a .NET Core project that has a reference to a NuGet package, say nugetD. That NuGet package in turn has references to 3 other NuGet packages, say nugetA, nugetB and nugetC.

The NuGet packages are managed locally in a local NuGet repository.

When the NuGet package nugetD is modified and a new version is pushed into the NuGet repository, then Visual Studio will alert us in the "Manage NuGet Packages for this Solution" window, saying there are updates for that nugetD.

Is there a way to have it generate an alert if any of the underlying dependent packages (for nugetD): nugetA, nugetB, and nugetC were modified, and new versions were pushed to the local NuGet repository?

In other words, how can the parent NuGet package track whether any dependent child NuGet references were modified and that it needs to update to the latest dependent packages?

Unable to load DLL 'Microsoft.CognitiveServices.Speech.core.dll' or one of its dependencies: The specified module could not be found. (0x8007007E)

$
0
0

I have a Web application that I made in Visual Studio 2022, using .NET Core 8.0 and Angular 8, and the Azure Cognitive Services Speech (version 1.41.1) installed through NuGet. The application works fine in the local environment, but when I publish it in the development computer, or a target computer, the following error message appears:

An unhandled exception occurred while processing the request.DllNotFoundException: Unable to load DLL 'Microsoft.CognitiveServices.Speech.core.dll' or one of its dependencies: The specified module could not be found. (0x8007007E)Microsoft.CognitiveServices.Speech.Internal.SpeechConfig.speech_config_from_subscription(out IntPtr config, string subscriptionKey, string region)

Stack Query Cookies Headers Routing

DllNotFoundException: Unable to load DLL 'Microsoft.CognitiveServices.Speech.core.dll' or one of its dependencies: The specified module could not be found. (0x8007007E)Microsoft.CognitiveServices.Speech.Internal.SpeechConfig.speech_config_from_subscription(out IntPtr config, string subscriptionKey, string region)Microsoft.CognitiveServices.Speech.SpeechConfig.FromSubscription(string subscriptionKey, string region)CognitiveServicesService.SpeechToTextAsync() in CognitiveServicesService.csapi.Controllers.CognitiveServicesController.GetSpeechToText() in CognitiveServicesController.cs

Both the development computer and target computer (Windows 10) are using the same CPU architecture (64-bit). The target architecture is set to 'Any CPU'. My Target Computer has Microsoft Visual C++ 2017 Redistributable (x64) and as well as (x86) version 14.14.26405.

I am not sure what I am missing, here.

Thanks in advance.

How can new NuGet packages in an upstream view be pushed to my feed automatically?

$
0
0

I’m using Azure DevOps and have created a NuGet feed within the portal UI. I’ve set a single upstream source that’s an Azure Artifacts feed. The location is a NuGet feed view.

Right now, when a NuGet package is published to the upstream view’s feed, I need to manually install the package once for it to appear in my feed.

Is there a way for new or updated packages in the upstream view to automatically be pushed to my feed?


Nuget prompting credentials

$
0
0

I am using Visual Studio 2019. While building a solution its asking for credentials and build is getting failed. api.nuget.org asking username and password. Note: I am using public default nuget package

enter image description here

Visual Studio : NuGet Package Source requires credentials

$
0
0
Visual Studio 2012 > Tools > Options > Package Manager > Package Sources

I add a new Package Source pointing to a myget.org url :

http://www.myget.org/F/myfeed/

VS > Tools > Library Package Manager > Manage NuGet Packages for Solution...

I am now prompted for myget credentials. Obviously, it will be inconvenient for developers to have to manually enter credentials every time they work with myget packages.

This blog explains how to store credentials in the machine-level NuGet.config :

https://gist.github.com/xavierdecoster/3205826

but after I follow the steps, VS still prompts me for credentials.

Microsoft.Bot.Builder.Azure doesn't contain type or namespace 'AzureTableStorage'

$
0
0

Earlier, the NuGet package 'Microsoft.Bot.Builder.Azure' had AzureTableStorage, AzureBlobStorage, and CosmosDbStorage in it. Now, the latest version has only AzureBlobStorage and CosmosDbStorage.

What if I need to used the TableStorage? Also the IStorage of Microsoft.Bot.Builder.IStorage doesn't allow table storage but only blob and cosmos dB storage.

Is table storage not supported for IStorage or am I missing something?

I have also tried upgrading all NuGet packages and used target framework .NET Core 2.2

How to use nuget.targets file to save two DLLs with same name but different target architecture into output respective folders in output directory

$
0
0

I have a problem with the SQLite.Interop.dll library. I am required to use the x64 and x86 distributions of it. I also need both of them to be copied into an output directory in the

x64/SQLite.Interop.dll

and

x86/SQLite.Interop.dll

folders respectively.

I created a NuGet package with the following .nuspec file:

<?xml version="1.0"?><package ><metadata minClientVersion="2.5"><id>SQLite.Interop</id><version>1.1.18</version><authors>SQLite</authors><owners>That's me</owners><requireLicenseAcceptance>false</requireLicenseAcceptance><description>That's for me.</description><copyright>Copyright 2018</copyright><tags>SQLite Interop ofcMe</tags><dependencies></dependencies></metadata><files><file src="content\x86\SQLite.Interop.dll" target="content\x86\SQLite.Interop.dll" /><file src="content\x64\SQLite.Interop.dll" target="content\x64\SQLite.Interop.dll" /><file src="bin\Debug\x64\SQLite.Interop.dll" target="Build\x64\" /><file src="bin\Debug\x86\SQLite.Interop.dll" target="Build\x86\" /><file src="SQLite.Interop.targets" target="Build\" /></files></package>

And the following SQLite.Interop.targets file:

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"><ItemGroup><None Include="@(MSBuildThisFileDirectory)x64\SQLite.Interop.dll"><Link>SQLite.Interop.dll</Link><CopyToOutputDirectory>Always</CopyToOutputDirectory></None><None Include="@(MSBuildThisFileDirectory)x86\SQLite.Interop.dll"><Link>SQLite.Interop.dll</Link><CopyToOutputDirectory>Always</CopyToOutputDirectory></None></ItemGroup></Project>

How do I archive this after the application builds?

How to prevent an unlisted package from being downloaded when Update-Package is being used

$
0
0

I have created a package on Nuget.org. However, when doing one of the first releases, I set an incorrect assembly version format, which is used as the package version.

Let's say that the version was 1.0.180305.0 (build date). However, I do not want to use this format, I want a simpler thing with Major.Minor.BuildNumber format, i.e. 1.0.10, 1.0.11, 1.0.12, etc., where I increment Major and Minor manually and the Build number increments automatically.

I have unlisted the 1.0.180305.0 version, so that it does not appear anywhere.

This works OK, however when using Update-Package [PackageName] in the Package Manager Console, it automatically gets the 1.0.180305.0 version, even though its unlisted, because the version number is 'larger'.

How do I prevent this?

How to move a folder of images to another location on build/install within a NuGet package

$
0
0

I have created a NuGet package in which I install other referenced packages. I also have a folder of up to 100 images. If I put these in the content folder they get copied over to the root of the project on which I install the NuGet package.

Here is my problem. When placing them in Content > Images > List-of-files, it takes up to 30 minutes per project to copy the files to the root folder. Furthermore I need them in the bin/debug and bin/release folders, not the root of the project.

Is there a way to just add the images into the lib folder so that they are in the package > lib > Images folder and then copy them to the bin/debug and bin/release folders of the project to which it was installed?

Could not load file or assembly ‘Microsoft.IdentityModel.Abstractions, Version=6.35.0.0. Nuget version mismatch Microsoft.IdentityModel.Abstractions

$
0
0

I am developing a C# dll based on .NET framework 4.8.2 which will use Microsoft Graph API to send email through outlook.For this I have added the latest Nuget packages for “Microsoft.Graph” v5.67.0 and "Microsoft.Identity.Client" v4.66.2 . This is my csproj -

<ItemGroup><PackageReference Include="Microsoft.Graph"><Version>5.67.0</Version></PackageReference><PackageReference Include="Microsoft.Identity.Client"><Version>4.66.2</Version></PackageReference><PackageReference Include="Microsoft.Windows.Compatibility"><Version>9.0.0</Version></PackageReference><PackageReference Include="Newtonsoft.Json"><Version>13.0.1</Version></PackageReference><PackageReference Include="Std.UriTemplate" Version="2.0.1.0" /><PackageReference Include="Microsoft.CSharp"><Version>4.7.0</Version></PackageReference></ItemGroup>

The build is successfull but I am getting this runtime error -

System.IO.FileLoadException: Could not load file or assembly ‘Microsoft.IdentityModel.Abstractions, Version=6.35.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)File name: ‘Microsoft.IdentityModel.Abstractions, Version=6.35.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’

Now, “Microsoft.Graph” v5.67.0 is dependent upon latest 'Microsoft.IdentityModel.Abstractions, Version=8.2.0.0 but I am not able to figure out which module is dependent upon 6.35.0.0.

**Upon further looking, it is found out that, in obj/project.asset.json file there is a mismatch between 'Microsoft.IdentityModel components. “Microsoft.Graph.Core/3.2.1” is referring to “Microsoft.IdentityModel.Validators”: “8.2.0” but "Microsoft.Identity.Client/4.66.2"is referring to old 6.35.0 version.**Here is the obj/project.asset.json file -

"Microsoft.Graph/5.67.0": {"type": "package","dependencies": {"Microsoft.Graph.Core": "3.2.1"        },"Microsoft.Graph.Core/3.2.1": {"type": "package","dependencies": {"Microsoft.IdentityModel.Protocols.OpenIdConnect": "8.2.0","Microsoft.IdentityModel.Validators": "8.2.0","Microsoft.Kiota.Abstractions": "1.15.2","Microsoft.Kiota.Authentication.Azure": "1.15.2","Microsoft.Kiota.Http.HttpClientLibrary": "1.15.2","Microsoft.Kiota.Serialization.Form": "1.14.0","Microsoft.Kiota.Serialization.Json": "1.15.2","Microsoft.Kiota.Serialization.Multipart": "1.14.0","Microsoft.Kiota.Serialization.Text": "1.14.0","System.Net.Http.WinHttpHandler": "6.0.0"        },"Microsoft.Identity.Client/4.66.2": {"type": "package","dependencies": {"Microsoft.IdentityModel.Abstractions": "6.35.0","System.Diagnostics.DiagnosticSource": "6.0.1"        },

In Microsoft.Identity.Client/4.66.2 release note it is mentioned that it will work with “Microsoft.IdentityModel.Abstractions”>= 6.35.0 but in reality it is not.Please advise me how to fix this error

In Microsoft.Identity.Client/4.66.2 release note it is mentioned that it will work with “Microsoft.IdentityModel.Abstractions”>= 6.35.0 but in reality it is not.Please advise me how to fix this error


Nuget resource change from https to http

$
0
0

I try to upload a NuGet package but a receive this error:

An error was encountered when fetching 'PUT http://nuget_domain/api/v2/package/'. The request will now be retried.

But in the https://nuget_domain/v3/index.json is 'https://nuget_domain/api/v2/package'

Y want to know why it tries with http with it is configurated with https and how to fixed.

Regards



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