I have a problem with resolving dependency to Enyim.Caching.dll while using Couchbase client. I have downloaded the dlls via NuGet and referenced them in the project. The solution compiles fine with the downloaded assembly Enyim.Caching, Version=2.12.0.0, Culture=neutral, PublicKeyToken=05e9c6b5a9ec94c2. But in the runtime Couchbase throws an exception because it is looking for Enyim.Caching, Version=2.12.0.0, Culture=neutral, PublicKeyToken=cec98615db04012e.
I can't undestand why it requires another dll of the same version, but with another PublicKey.
I also tried the solution described in Cant get the couchbase .net memcache client to run, complains it's strong name validation failed to remove strongname requirements via using ns.exe. But it didn't workout.
Can anoyone help me?
In the end I managed to solve this problem using description in the file Readme.mdown of couchbase-net-client project. They say that there are 2 ways to solve the problem: either remove the strong name checking via sn.exe or via removing assembly signing at all.
I have chosen the second way, since I don't that need assembly signing. I rebuilt the source from the scratch, removed every entry NuGet has created for me and manually added references to all assemblies. And it worked like a charm :)
you can delete node with "public_key.snk" in file "build/CommonProperties.targets"
<!-- delay sign the assembly if the PrivateKeyPath property is not specified -->
<!--<PropertyGroup Condition=" '$(PrivateKeyPath)' == '' And '$(PrivateKeyName)' == ''">
<AssemblyOriginatorKeyFile>..\public_key.snk</AssemblyOriginatorKeyFile>
<DelaySign>true</DelaySign>
</PropertyGroup> -->
Related
I'm using these pacakges:
PackageReference Include="Polly" Version="7.2.2"
PackageReference Include="Polly.Caching.Memory" Version="3.0.2"
I have a testproject that uses these packages and the code works.
When I try to integrate my code in an existing application with lots of other nuget packages, suddenly I get a TypeLoadException.
The method TryGet in the type Polly.Caching.Memory.MemoryCacheProvider from the assembly Polly.Caching.Memory, Version=3.0.0.0, Culture=neutral, PublicKeyToken=c8a3ffc3f8f825cc doesn't have an implementation.
I have been checking everything, but I can't find the cause of this.
The versions of Polly and Polly.Caching.Memory are aligned across all projects involved.
In the bin folder the correct version appears.
I looked at the code of the assembly and the code has an implementation for TryGet
Any suggestion on what I can do to further investigate this?
The packages were all correctly configured.
I got on the right track when I saw that the method was returning a tuple.
I figured that perhaps this second application was not using the correct versions of the same packages.
I changed :
<HintPath>..\Solutions\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
To
<HintPath>..\Solutions\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath>
Bingo!
I created a .net core 2.2 project using the AWS Lambda function template. Added a MySQL EntityFramework nuget package. My project targets .NET Core 2.2. I have code which uses DbContext and EF stuff. When I run the app using their lambda test tool, I get this error: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.EntityFrameworkCore, Version=2.2.0.0, .....
Using Process Monitor, I can see the app is trying to load Microsoft.EntityFrameworkCore.dll from ...\bin\Debug\netcoreapp2.2\Microsoft.EntityFrameworkCore.dll which doesn't exist.
My question is why aren't any of the supporting assemblies in that folder? The only assembly (.dll file) in the folder is my app's.
Following step help you to solve this problem:
Delete all bin and obj folders.
Clean Solution. [Build>Clean Solution].
Rebuild Solution
Try to use some type of Microsoft.EntityFrameworkCore namespace explicitly somewhere in your code. For example:
var _ = new Microsoft.EntityFrameworkCore.DbContextOptionsBuilder();
It sould force the build to copy the assembly to result directory.
I have some ideas.
Firstly check, if the folder that you want to refer allows the Visual to have access.
If it do not work, try reinstaling packages through nugget (If I remember correctly I had this same error.). If it shows that its not installed in nugget manager, just install it, even a few times.
Here is the anwser for your question at the end:
Where does NuGet put the dll?
I had a similar problem, in my case removing the line from the .csproj file helped
<PublishReadyToRun>true</PublishReadyToRun>
Specific Exception received: “Could not load file or assembly ‘System.Runtime.InteropServices.RuntimeInformation, Version=0.0.0.0, Culture=neutral’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference.”
I have two projects, one is a sort of “Proof of concept” and the exact same code works perfectly there, while the other is a large solution in which I’m adding code to one of the existing projects.
I am getting an exception in the second (failing) project when running the following line of code:
LibGit2Sharp.Repository.Clone(baseGitHubURL + ourOrg + “/“ + ourRepo.Name, ourRepoPath + #“\” + ourRepo.Name, co);
Ahead of this code, I’ve got it printing the arguments being passed, which are as follows in the output from BOTH projects (again - identical code in each):
GitHub path: https://github.company.com/TESTING/CA4F
Filesystem path: C:\Users\User\CA4F
The creation of CloneOptions is identical in both projects with static values being used (it uses a personal access token as a username).
I am suspecting there is something wrong with how LibGit2Sharp was added to the failing project. Note that the PROCESS was the same for both:
From NuGet console: “Install-Package LibGit2Sharp”
Both have the same version (latest, version 0.25.0).
Despite these facts, the working project has a “Dependencies” section under the project listing LibGit2Sharp, while the non functioning project does not have this section. LibGit2Sharp WAS added as a reference to my actual project when I went to Nuget Package Manager and told it to install to ALL projects in the solution.
Another piece of information - the working project does NOT have a NuGet package for “LibGit2Sharp.NativeBinaries”, while the failing project does. On a whim, I tried deleting it from the failing project, but Nuget says “Unable to uninstall ‘LibGit2Sharp.NativeBinaries.1.0.210’ because ‘LibGit2Sharp.0.25.0’ depends on it.”
Just to close this up - I was able to resolve this by adding the following to the first configuration property group under the PropertyGroup tag in the csproj of every single project in the solution:
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
After doing that, a recompile and run allowed me to successfully call LibGit2Sharp! :)
Note that this was the solution provided by “bording” over on the LibGit2Sharp git issues “forum”.
I am having a problem when publishing a console application to appharbor.
Error message:
FileNotFoundException: Could not load file or assembly 'WebActivator,
Version=1.5.2.0, Culture=neutral, PublicKeyToken=null' or one of its
dependencies. The system cannot find the file specified
I have tried to add WebActivator, Version=1.5.2 through nuget and the reference is set copy local to true. I have also tried to change from .net 4.5 to 4.0.
Any suggestions?
Ok so the problem seems to be that one of my references to the console app was built with framework v 4.5. So it was working locally. Also check that you arent referencing to a MVC project which may have caused problem as well. So when I reference a pure class library framework 4.0 it seems to work. Hope this helps someone!
I've installed Migrator.NET using NuGet but when I attempt to run a migration using MSBuild I get the following error. I see that its having trouble accessing the Migrator.Framework assembly but I am unsure as to why or where specifically I need to put the DLL in order to get it to run.
C:\Users\Cody\src\App\App.Migrations\App.Migrations.csproj(64,5): error MSB4062: The "Migrator.MSBuild.Migrate" task could not be loaded from the assembly C:\Users\Cody\src\App\App.Migrations..\packages\MigratorDotNet.0.9.0.33276\tools\Migrator.MSBuild.dll.
Could not load file or assembly 'Migrator.Framework, Version=0.0.0.0, Culture=neutral, PublicKeyToken=3b3586e9632ecfce' or one of its dependencies. The system cannot find the file specified. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
Does anyone have any insight? I've spent far too long fiddling with this.
It turns out the issue was in fact that it was looking for version 0.0.0.0. I downloaded the project and recompiled the Migrator.Framework binary as version 0.0.0.0 as a quick fix. The real solution is recompiling Migrator.MSBuild.dll to look for the proper version of Migrator.Framework.
I'll see if this was a one-off error or if I can reproduce it, and submit it as a bug to the Migrator.NET team if it is in fact a bug with the NuGet package.