Can't reference to System.Xml.XPath.dll - html

I have created a windows phone Project that use HTML Agility Pack. I tried to reference to System.Xml.XPath.dll file but a error message say:
A reference to a higher version or incompatible assembly cannot be added to the project.
I'm using VS 2013 and Silverlight 5.

According to this, You need to use Silverlight v4 of the dll and not v5.

Related

Uno is not working for existing PCL project. uwp error is giving for .NetStandar 2.0

We have added UNO in our existing project created in Visual studio 2019( using .NetStandard). we have set target and min version for UWP as per BugTracker sample project but we are getting below error while running the .wasm project.
Severity Code Description Project File Line Suppression State
Error NU1201 Project XXXXXX.UWP is not compatible with netstandard2.0 (.NETStandard,Version=v2.0). Project ImageViewerPOC.UWP supports: uap10.0.16299 (UAP,Version=v10.0.16299) XXXXXX.Wasm D:UnoXXXXXXX.WasmXXXXXX.Wasm.csproj 1
In order to use .NET Standard 2.0 in UWP, you need to target Fall Creators Update (FCU) as the minimum version of your UWP project. That’s because .NET Standard 2.0 contains many APIs that require FCU to make them work in the context of the UWP execution environment, specifically AppContainer.

Calling a C# method from C++ in Windows Phone 8 (for real)

I'm using a game engine which generates a native C++ project (DirectX) for a Windows Phone 8 app. To integrate such things as in-app-billing however I need to call a C# method everytime a specific C++ method is triggered in the engine. There is a SO-thread named calling a C# method from C++ in WP8 which apparently is just the other way around: "a C# based app actually calling a C++ method".
Where I'm stuck right now is that I created a "Visual C++ -> Windows Phone Runtime Component" with a C++/CX public ref class sealed using Visual Studio 2012 Express for Windows Phone. This references a .winmd file of a "Visual C# -> Windows Store Class Library" that has the project properties set to "Windows Runtime Component". Interestingly I had to create this in Visual Studio 2012 Express for Windows 8 (NOT Windows Phone), because VS for WP8 doesnt provide an option for generating a .winmd file. Compiling my game I get the following error message:
No implementation file was provided for the .winmd file '...\InAppBilling.winmd'. To enable generation of registration information in the app manifest, specify the 'Implementation' metadata on the winmd reference item in the project file.
How do I call a C# method from within C++? I don't need any fancy stuff like DLLs, inheritance, delegates etc. Just a plain static call that works, everything else will be handled in C# anyway.
This is only possible if you create a XAML and Direct3D app. In that case you can call from C++ to C# using the Windows Runtime method in the other SO question.
As it is not possible to create a C# Windows Runtime component on the phone (unlike for a Windows Store app), it isn't possible to call a C# method from a native C++ project.

MvvmLight, PCL and System.Runtime

I have a VS2012 solution that contains a Portable Class Library that targets .NET 4.5, Silverlight 5 and Windows Phone 8. This PCL also references MvvmLight (PCL). I then have a Windows Phone 8 project which references this PCL. For the WP8 project I loaded the MvvmLight (PCL) NuGet Package which loaded MvvmLight, MvvmLight.Extras as well as MvvmLight.Platform.WP8.
But, when I compile the WP8 project it complains that I have an indirect reference to "System.Runtime, Version=2.5.19.0". This is true because the PCL project exposes a view model that has the ViewModelBase class as a base class, which in turn requires the System.Runtime.dll.
If I reference the platform specific versions of MvvmLight in the WP8 project, i.e. the MvvmLight NuGet package, then I also have to reference the Microsoft.Bcl.Build package and when I do that I get load more errors referring to Microsoft.Threading.Tasks.Extensions.
I have tried adding the System.Runtime.dll from the Microsoft.Bcl directory, but it does not solve the problem.
Is there something I'm missing or not tried?!?
This is an issue where NuGet is adding binding redirects when it shouldn't. Deleting the binding redirects for System.Runtime (and System.Threading.Tasks if it exists) from the app.config in your WP8 project should fix this.

Referencing ZXing.Net library

I need to reference the ZXing library to scan QR codes in my Windows Phone 8 app.
I have downloaded the ZXing.Net 0.10.0.0 from the following source: http://zxingnet.codeplex.com/
However, whenever i try to add a reference to zxing.wp8.0.dll, I get an error as follows:
A reference to higher version or incompatible assembly cannot be added
to the project.
Can I please know why am I getting this error. Is there anything that I am doing wrong or missing?
Right click on the DLL in File Explorer --> Click Properties --> Choose unblock. Then try to add a reference again.
VS2012 has the absolute worst error message for when DLLs are blocked due to the fact they were downloaded from the web.
Goto
http://nuget.org/packages/ZXing.Net
Follow the instructions to install the right version you need.

Found conflicts between different versions of the same dependent assembly.MVC3 -> MVC4 / EF4 -> EF5

The question is how to resolve conflicts between versions of assemblies in my project that was upgraded to MVC4 and EF5?
The problem is manifest in the fact that my controllers and models can include System.Data.Objects, but now my views.
I am using MVC 4, my project was upgraded from MVC 3.
Entity Framework is version 5.
I have a controller that is able to use objectcontext from System.Data.Objects.
My Usings:
using System.Data.Objects;
using System.Data.Entity;
When I try to include the using in the view form System.Data.Objects, I get :
CS0234: The type or namespace name 'Objects' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)
I am targeting .net 4.5
My Build Displays this message:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1561,5): warning MSB3247: Found conflicts between different versions of the same dependent assembly.
You can build your solution in diagnostic mode to get more detailed information about the error.
Open the VS Options dialog (Tools > Options), navigate to the "Projects and Solutions" node and select "Build and Run". Change the MS Build project build output verbosity to Diagnostic.
Have a look here.
If you look at the build message, it states the 4.0 version of the .net framework is referenced... Is there a setting in your project file or web/app.config specifying a conflicting version of the .net framework?
Are you familiar with fuslog? you can set it up to log all assembly bindings that .net is doing while running your application. You should then be able to see detailed information on what is getting bound when. If you still can't figure it out, you can always do a binding redirect on that .dll in the web.config.
http://msdn.microsoft.com/en-us/library/eftw1fys.aspx -- binding redirects
http://msdn.microsoft.com/en-us/library/e74a18c4(v=vs.71).aspx -- fusion log viewer
Set up fusion logger and take a look at what the output is. If you don't get an answer from that, try the binding redirect (which would give you at least a temporary solution).
In the directory I was publishing to, there was a folder named aspnet_client. I moved it (instead of deleting it), republished, and it worked. I'm not sure why that folder decided to give me trouble out of the blue.