Have a serious problem: need to install a third-party web application. After deploying to my local machine getting the exception:
Could not load file or assembly 'System.Data.Entity, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.
The problem is i don't have sources, also nuget packadge manager cannot find anything similar to this version. Installation of Entity Framework ver. 4.2.0 does nothing either.
Any thoughts what and where I should download?
Best regards and thanks a log
You find nothing on nuget? HAve you ever tried?
Google.... "Entity Framework 4.2" leads me to...
https://www.nuget.org/packages/EntityFramework/4.2.0
That is nuget, that is Entity framework and that is 4.2.
Maybe, instead of nuget package manager, you use the nuget tools ;)
Download old version of package with nuget
tells you how to do that - using the command line (which accepts a version parameter).
You should try to install this manually:
Open the solution
Open the Package Manager Console
Type: Install-Package EntityFramework -Version 4.2.0
This will install the specific package version that you need.
You either need :
a. the assembly referenced
b. the source code to change the reference
I would contact whoever wrote the third-party application and try to resolve it from there.
Related
I've made a custom logging provider as a nuget package so I can save down exceptions and unique data to a database.
I have published this to devops and I've installed it in the main project that needs to use it.
When I now start up the main project I get a "Could not load file or assembly Microsoft.Extensions.Logging.Abstractions" error.
I've tried using different versions of all the logging nuget packages that has Abstractions but it doesnt seem to work, if I downgrade below 3.0.0 then I need to rewrite my logging provider which I dont want to do
I have already looked around a lot and tried the different solutions in the other StackOverflow questions but none of them are working.
Both the nuget package and the main project is running net461
Thanks in advance
In Visual Studio 2019 16.11.5 (latest) I have the 'Visual Studio extension development' workload installed.
I can use this to create a C# VSIX Project. If I do this it builds and runs fine as you'd expect, and has no compiler warnings or errors.
If I go to Tools/Manage NuGet Packages for solution... I can see I have NuGet package Microsoft.VisualStudio.SDK v16.0.206 installed, but the latest version is v16.10.31321.278.
If I go to the Updates tab I can select the package and click 'Update' to get the latest version.
The project still builds and runs after I do this, but I get a compiler warning about version incompatibilities of dependent libraries:
Found conflicts between different versions of "Microsoft.VisualStudio.Validation" that could not be resolved. There was a conflict between "Microsoft.VisualStudio.Validation, Version=16.9.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" and "Microsoft.VisualStudio.Validation, Version=16.10.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". "Microsoft.VisualStudio.Validation, Version=16.9.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was chosen because it was primary and "Microsoft.VisualStudio.Validation, Version=16.10.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was not.
There are more details about where the incompatibility arose, which appear to say the main package references 16.9.0 and some of the dependent libraries reference 16.10.0. If I look in project.assets.json I can see that the build actually uses v16.9.32.
So the question is: what is the correct course of action to remove this compiler warning and safely use the latest SDK to build my VSIX?
Having read around this I see a few options. I can suppress the warning, but I can't see how since it has no code. I can not upgrade the package. Or I can install a specific version of Microsoft.VisualStudio.Validation and use a binding redirect to get rid of the warning, although I don't know what the version should be. If the assembly uses semver it would seem that 16.10.x would be the right library, not the 16.9.32 the build is using.
The issue is there are two different versions of Microsoft.VisualStudio.Validation.dll files, and VS(MSBuild) can’t confirm which to use. One is from installed NuGet Package and the other is from system reference(integrated in VS). Of course, VS chose to use the primary one.
The solution should be installing a single Microsoft.VisualStudio.Validation NuGet package, version 16.10.34. And yes, it is available on nuget.org.
I think this is not a truly solution, it indeed makes the warning disappear, but in my opinion, the issue should be fixed from NuGet package(Microsoft.VisualStudio.SDK) side. During the installation/updating of Microsoft.VisualStudio.SDK package, the version 16.10.XX of the Microsoft.VisualStudio.Validation package should also be installed automatically. Maybe this will be fixed in a newly released version of Microsoft.VisualStudio.SDK package, I’m not sure.
The exception when running as the console application as Azure webjob:
Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'Azure.Core, Version=1.0.2.0, Culture=neutral, PublicKeyToken=92742159e12e44c8' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Locally this works and runs.
Referencing:
Azure.Identity version 1.3.0 which has a dependency to Azure.Core version >= 1.6.0
Azure.Security.KeyVaults.Secrets version 4.1.0 which has a dependency to Azure.Core version >= 1.0.2
So of course based on these nuspec specifications it should resolve to Azure.Core 1.6.0. Which it locally does and runs without a problem.
Yet when I deploy this using VS publish profile to our cloud as Azure Webjobs and run the application I get the exception mentioned above. (of course the file version deployed is the same as local, version 1.6.0)
I know I can fix this with an assemblybinding. Stating that version 0.0.0.0 to 1.6.0.0 should resolve to version 1.6.0.0.
But I find this very frustrating because it imposes manual labor and keeps us from updating packages whenever a newer version arrives because then we also have to remind ourselves to update the assemblybindings.
I feel like there is a better solution, or we are doing something wrong. But I simply do not know where to begin searching for a solution. I hope to get some insights from you guys!
PS:
This phenomenon is driving me nuts because we face similar issues when using packages:
Unity
Unity.Interception
Because they both depend on Unity.Container. Forcing us to either use assemblybinding to resolve this issue, or only use versions which depend on the same packages
Try doing the following steps because the approach you are taking is correct:
Uninstall both Azure.Identity and Azure.Security.KeyVaults.Secrets nuget packages.
Remove all the associated Assembly Bindings.
Delete bin and obj folders in your project folder.
Install Azure.Core version >= 1.6.0 and rebuild the solution.
Deploy the solution.
These should work ideally. I think that there are some stale dependencies which are getting deployed. You can also try deploying through pipelines, if not already doing.
Could not load file or assembly ‘Aspose.Cells, Version=19.7.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I am getting above in .Net Standard 2.0 type library. I have added Aspose.Cell nuget package reference to the library.
I think you need to add Aspose.Cells, Version=19.7.0.0 reference in hosting project also instead of only class library projects.
You may please add System.Drawing.Common library from the NuGet package manager to resolve the issue. In some cases you may also require System.Text.Encoding. Please note, while using NuGet package manager, it may automatically fetch all the required dependencies for Aspose.Cells, it look to me not in your case though. So, you should manually install System.Drawing.common v4.5.1 after installing Aspose.Cells 19.7.0.
To check the dependencies on Nuget repos page of Aspose.Cells v19.7.0, you may click on "Dependencies" node and may confirm the following depenencies for .NET Standard 2.0:
System.Drawing.Common (>= 4.5.1)
System.Text.Encoding.CodePages (>= 4.4.0)
Hope, this helps.
PS. I am working as Support developer/ Evangelist at Aspose.
Solution below
I'm trying to implement PayPal payment in an ASP.NET website, but when I run it on Azure, it tells me the assembly being referred to by RestApiSDK 0.1.1.0 is wrong. Local it all works.
Could not load file or assembly 'PayPalCoreSDK, Version=1.5.2.0, Culture=neutral, PublicKeyToken=5b4afc1ccaef40fb' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I checked with .NET Reflector and the assembly being referred to is indeed 1.5.2.0, though the latest version in NuGet Packages is 1.6.0.0. I also uninstalled both packages and re-installed them, but no luck.
So, I have two questions:
Why does this work on my localhost?
How do I fix this to work on Azure Websites as well?
Edit: As #JasonZ suggested, I installed a new version of the PayPal SDK for .NET and that worked. Thanks!
My first thought would be 32 bit local machine vs 64 bit azure?
If that's not the case, I would try manually adding them to the GAC via a webjob as stated here:
http://blogs.infosupport.com/adding-assemblies-to-the-gac-in-windows-azure/
When you "uninstall and Reinstall" do you see them in the GAC on your azure vm?
=Devon
Answer by #JasonZ: The PayPal .NET SDK has since replaced the RestApiSDK library and removes the dependency on PayPalCoreSDK.
Upgrade the nuget package
PM> install-package PayPalCoreSDK -version 1.7.0
(To upgrade the package using visual studio [Top Menu] -> Tools -> NuGet Package Manager -> Package Manager Console)
Please follow the following link for more information. https://www.nuget.org/packages/PayPalCoreSDK/