Worldpay library compatiblity with Newtonsoft 2.0.0.0 - c#

I'm trying to integrate online payment in a existing web application.
I'm using as a payment vendor worldpay which has a git link (link)
The problem is that the sdk is built on version 2.0.0.0 of Newtonsoft and in the other web application I'm using version 10.
I've tried to build again the SDK with version 10.0.0.0 but I get a build failure.
I've also tried to use both dll with diferent versions using codeBase but it doesn't seem to work.
Does someone has any ideas how to use this sdk with a greater version of Newtonsoft?

The way we resolved this problem was by renaming worldpay's Newtonsoft.Json.dll to WorldPayNewtonsoft.Json.dll.
1 Download worldpay-lib-dotnet-3-5 from worldpay-lib-dotnet
2 Open with visual studio Newtonsoft.Json project, rename it to WorldPayNewtonsoft.Json.dll (from Project (right click) -> Properties -> Assembly name) and build it.
3 Open Worldpay.Sdk project in visual studio and replace the Newtonsoft.Json reference with the new one called WorldPayNewtonsoft.Json.dll and build Worldpay.Sdk project.
4 Take then the new built Worldpay.Sdk.dll and WorldPayNewtonsoft.Json.dll from bin folder and put them into your project references without worrying about Newtonsoft.Json.dll conflicts.
In our case this made it work.
Hope it helps!

Related

How to see from where comes the Detected Dependencies in a Setup Visual Studio Project

I have a setup project generating a .MSI file to install a asp.net website on a IIS.
This website have something like 10 project linked to him.
I have a problem when I install the msi. Their is a conflict between 2 references (System.Net.Http 4.0.0.0 and System.Net.Http 4.1.1.3).
In my Detected Dependencies, I have 2 System.Net.Http dll (2 version) and I have to exclude the 4.0.0.0 to skip the error during the install.
How can I find what add this dll in my Detected Dependencies, since I already checked all my project and they are all using the 4.1.1.3.
Maybe another reference need the 4.0.0.0 as dependencie ?
How can I get this global view ?
There is no straightforward way to check the dependencies from a bird's eye view in visual studio atm.
You can find plenty of options in this SO question to check who needs System.Net.Http.
In this question here there is an option to use ildasm for dependency discovery too.

Visual Studio 2019 Error - Could not load file or assembly or one of its dependencies

I have some trouble with running my project. When I try to run, the following error appears:
FileNotFoundException: Could not load file or assembly 'Dapper,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its
dependencies. The system cannot find the file specified
Context:
I have a Class Library X and a Web Application Y which have dependencies on X. When I try to run my API project, it throws the above error.
BUT, when my colleagues try to run the same API project, it works fine (no errors, and in /bin folder, it loads all the .dll libraries..)
I did those approaches:
Restart Visual Studio, clean and build a solution
Remove the class library references and add it again
Tools > Import and Export Settings Wizard > Reset all settings (maybe some setting was not well configured). I also tried to import colleague settings and didn't work either.
I tried various approaches(even in a different machine, but same VS settings) but none of these worked for me.
Visual studio 2019 16.4 Enterprise.
I'd also try:
1) Deleting your bin and obj folders in your solution before a rebuild.
2) Check that you've not got multiple versions of the same package across the solution (right click on solution in solution explorer -> manage nuget packages for solution).
3) Check that the properties of the reference (right click in solution explorer on the reference in question) shows a path to the package that you'd expect relative to the solution (eg not in mydocuments/nuget packages or something!).
4) Try a fresh clone of the repo (this should in effect replicate your co-workers' set up) and see if the problem still exists then.
I suppose another cause could be that your coworkers have a locally installed package / dll that they're happily referencing without realising, but you don't have?
When you copy a project from someone or another system, you need to download and install all components. normally VS will give you the option to "restore packages" when you load a newly imported from git but not sure if it does when you open an existing solution from a different system.
Right Click your project, Manage Nuget Packages
Browse -> Search for Dapper. Install
In the error you receieve, it tells you what version of the package should be installed as well. Installing a significantly different version might cause other unexpected errors.
thank you for your solutions but I found the problem:
The project solution has some projects with .net standard 2.0 and some with .net framework 4.8. Somehow, when I run the app, some packages are not loaded correctly and it throws an error.
That line below solved my problem:
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
Put it in all .net framework 4.8 projects on first XML tag.
Thank your for all.
Regards.
I had exactly the same Dapper error message today when referencing a .Net Standard 2.1 class library in a .Net Core 3.1 WinForm app. My resolution was to double-click the class library name in Solution Explorer to open the .csproj file, and then add a CopyLocalLockFileAssemblies tag to the PropertyGroup tag and setting it to true.

Nuget Hell: Cannot reference NuGet package in UWP application due to public key difference

I have a UWP app and a bunch of NETStandard 2.0 libraries. The libraries contains a lot of logic and communication interfaces that I am using in ASP.NetCore and Desktop WPF applications, so I am not going to change them.
I use NuGet packages in the libraries so I could reference those in NetCore and NetFramework projects as well. I would like to reference these packages in the UWP project - cause this is the whole point of this standardization concept isn't it?
For the UWP project this does not work. I have the latest Nuget package of System.ServiceModel.Primitives which is 4.5.3 (DLL version 4.5.0.3 - don't ask why) and PublicKeyToken is b03f5f7f11d50a3a - this can be referenced in every project except UWP.
Regardless of every attempt:
- I have installed the Nuget package for the project
- I have referenced the version explicitly in the CSPROJ file
- I have removed every other reference to SDK file version
But still, the UWP project looks for the dll in
C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\microsoft.netcore.universalwindowsplatform\6.2.8\ref\uap10.0.15138\System.ServiceModel.Primitives.dll
That DLL has version of 4.2.1.1 and the PublicKeyToken is cc7b13ffcd2ddd51
Because the two tokens are different - binding redirects does not work - or maybe I am missing something. Does anyone have a workaround for this?
The whole solution is in VS2019 and I have the latest Win10 SDK installed 10.0.18362.1.
Thank you in advance.
EDIT: I forgot to mention, I have a repro on GitHub
You can create a separate .NET Standard project and incapsulate all your logic (and usage of System.ServiceModel.Primitives assembly) into this project. Then you can add it as a reference to the project with UWP executable.
Also you can setup a binding redirect for strongly-named assemblies by specifying codebase according to this article

dnn 7.4.2 build references missing

VS 2017 Pro - all .Net libraries installed
I need to use DNN version 7.4.2
I've downloaded the 7.4.2 version of the platform and am trying to compile the DNN_Platform solution.
When I do, a number of projects are missing references to
System.Net.Http
System.Net.Http.Formatting
System.Web.Http
System.Web.Http.WebHost
System.Web.WebPages
System.Data.SqlServerCe
How can I get the solution to find these references and build? Do I need to compile something else first? The instructions for compiling the DNN solutions would be appreciated.
When I tried to use NuGet to get System.Net.Http it tells me:
trying to install this package into a project that targets '.netframework,version=v4.0', but the package does not contain any assembly references or content files that are compatible with that framework."
When I do try to compile the solution I get errors suggesting remedies like:
retarget your application to a framework version which contains "System.Net.Http".
But I want to build the source as it was downloaded.
How can I do that?
For those that want to know, you need to install Asp.Net MVC 4 to resolve these reference issues.
You can find it in this link here

Xamarin Studio cross platform app error

At the moment I'm trying to launch empty app with cross-platform solution in Xamarin Studio.
I've tried make app with empty library project and shared library, both has same errors. Now unresolved problems are:
1) Build error:
Error XA5207: Please install package: 'Android Support Library' available in SDK installer. Java library file classes.jar doesn't exist. (XA5207) (*projectName*)
Error XA5207: Please install package: 'Android Support Library' available in SDK installer. Java library file libs/internal_impl-21.0.3.jar doesn't exist. (XA5207) (*projectName*)
This question didn't help me.
2) Some links says it could be because of old Mono.Android.Support.v4 component. My component version is 21.0.3.0. After clicking for update it says:
You are trying to install this package into a project that targets 'MonoAndroid,Version=v4.0', but the package does not contain any assembly references or content files that are compatible with that framework.
My Mono.Android assembly version is 0.0.0.0 and I dodn't know how to update it.
I've tried PCL project with PCL 4.5 - profile7. New projects builds normal, but after first project clean it gives me error about not found classes.jar file like described above. Another new PCL project still builds fine.
UPDATE
Error in PCL project occures not after clean - it occures with included Xamarin.Forms NuGet to Android project.
UPDATE
After rising target framework of android project to v4.0.3 I successfuly updated Mono.Android.Support.v4 component, but it still show me error about Please install package.
UPDATE
I'm using Windows 7 OS, same problem with all users including new user. But on another computer with Windows 8 it works. It is not a solution for me, but it can somehow help someone.
i think your java JDK and JRE not install properly and your path not set in your environment variable you must add your jdk path in that and if you are make application using cross platform then also add path SDK in your computer environmental variable. using CMD throw creating project.

Categories