SharpZipLib issue while adding reference Windows Phone - c#

I am trying to add dll of SharpZipLib to my Windows Phone 8 project. It gives me following error while adding
a reference to a higher version or incompatible assembly cannot be added to the project
Here is a screen shot
I found one same type of question. Referencing ZXing.Net library
But it not works in my case. I have downloaded this dll from http://www.icsharpcode.net/OpenSource/SharpZipLib/Download.aspx
Can some one please help me ? How can I solve this issue?

Have you considered using the Microsoft Compression library on NuGet instead? It definitely lists support for Windows Phone 8.
If that's not an option for you, try to add the SharpZipLib package via NuGet as it will have clearer messaging if the package does not support WP8.

The binary you downloaded is for full .NET Framework projects only. If you want to use it in Windows Phone projects, you need to download the source code and rip out parts that are not Windows Phone friendly.
Note that SharpZipLib does not officially support Windows Phone, so you might have to fight hard to port it to Windows Phone.
Thus, you'd better use a library that officially supports Windows Phone, such as SharpCompress,
https://sharpcompress.codeplex.com/

Related

FourSquare Client library for WP8

Is there any foursquare client library available for Windows Phone 8. i checked the foursquare site and this client 'Sharp Square' but whenever i try to include it in my project i got the version incompatible error
install-package : Could not install package 'SharpSquare 1.0.0.2'. You are trying to
install this package into a project that targets 'WindowsPhone,Version=v8.0',
but the package does not contain any assembly references or content files that are
compatible with that framework.
i also tried adding the .dll after building the project but got the same error..
Loking at the source code of SharpSquare on GitHub (https://github.com/TICLAB/SharpSquare) there is no version that works with Windows Phone 8.
You need to convert it to a Windows Phone library. It should not be difficult, just removing the unnecessary references to System.Web and making all the request asynchronous. Here is my take on it, it compiles but I have not tested it: https://dl.dropboxusercontent.com/u/73642/SharpSquareWP8.zip
I think the best thing you can do is leverage Foursquare REST API https://developer.foursquare.com/docs/
And a library like RestSharp to work with them.

Add Windows Phone platform support to existing C# project

I have an opes-source project which I want to use on Windows Phone. Currently it targets one of the following: Any CPU, x86 or x64. Apparently, when I build and try to use the output as a reference in a Windows Phone project, I'm getting an error: A reference to a higher version or incompatible assembly cannot be added to the project.
I'm trying to build that open-source project so that it would target Windows Phone platform. To achieve that, I'm trying to find a way to add Windows Phone platform somewhere in VS project's settings, but with no luck. Is it possible at all? If yes, how?
Thanks.

How to add external non windows phone class library project reference to a windows phone project?

Hi there I am new to the windows phone development and I am trying to build a data driven application in which I have Created my BLL and EL and DAL ,which are all of windows phone class library type project.
I have also an extra project of type class library in my solution in which I have added the Reference to "MyGeneration.dOOdads.dll" file .
Now I want this project to be referenced in the windows phone app project.But when I try to add a reference ,The VS 2010 says...."Unable to add the selected project refernce.The project reference must be another silver light for windows phone project that is the same or the lower version ".
.
.
.
Kindly help me in this scenario. Thanks
That can't and won't work. The phone runtime only has access to a timy subset (well, sort-of) of the full .NET libraries, so any non-phone-7 library is extremely unlikely to operate at all. To stop this surprising people, only libraries built against that runtime are allowed to be referenced.
If possible, create a new project with the same c# files, targeting the phone 7 framework. Now reference this project. It is quite likely that some bits will fail to compile (demonstrating the fact that it also wouldn't have run), which can be rectified in a number if ways (#if blocks, alternative .cs files, etc).
You might also have some luck by making the existing project a "portable class library" - this, however, is the most restrictive subset of all the common frameworks, and is even less likely to still compile (without changes).
Using the Portable Class Library project, you can build portable assemblies that work without modification on the .NET Framework, Silverlight, Windows Phone 7, or Xbox 360 platforms.
(from MSDN)

dlls on windows and dylibs on macintosh

I have joined a project that has been written in xcode using objective-C that is using some frameworks. This project is aimed at adding Wii-mote functionality to both the windows and Macintosh versions of Unity3d.
My question is how should I go about getting a windows dll that mirrors the functionality of the Macintosh .bundle/.dylib?
Do I need to start translating the code from Objective-C to C#?
or,
Do I need to find/code my own windows .dll from scratch?
or,
Is there a library type that is compatible with both windows and Macintosh?
Thanks in advance for your help!
There is not a library type that is compatible with both systems. It might be possible to use C# libraries on both systems if you're using Mono on the Mac to run C# code, but you already stated that it's an Objective-C project, so I'm guessing that option is out.
So yes, you'll need to write your own .dll on the Windows side in your language of choice.

Prexisiting dlls (.NET 4 framework) issue with mono for android

I am creating a fresh Mono for android application using http://xamarin.com/monoforandroid
I selected Mono for Android Application using Visual C# option.
My Android target version is :
I went to references of the project and tried adding my pre existing dlls (made in .NET 4 Framework)
and I got this error:
The strange stuff is there is no option to change the .NET Framework from project properties. Can you tell me what I am missing?
The problem here is that you're trying to reference a .NET 4 DLL from a project that isn't .NET 4. Mono for Android uses its own profile for .NET, which is very similar to that of Silverlight (but not exactly the same). While it's possible that adding a DLL compiled for a different profile will work, it's very risky as you will probably run into problems at runtime where your app will crash, due to something being missing from the Mono for Android profile.
The best answer right now is to create a Mono for Android class library, link in the appropriate files from the library you want to use, and reference that. This will give you compile-time checking that you're not using anything unsupported by the Mono for Android profile, and help keep you more sane in the long run. I have an old blog post up here that talks about how to link files across projects.
That said, in this case you're in luck because someone else has already done that last part for you! Check out this fork of Json.NET which provides versions for MonoTouch and Mono for Android.
The strange stuff is there is no option to change the .NET Framework from project properties. Can you tell me what I am missing?
It's not particularly strange - that dialog box was written by Microsoft, with its own project types in mind. It sounds like Mono for Android doesn't have the same options available.
I strongly suspect you'll just have to use a version of JSON.NET targeting .NET 3.5.
(Having said that, Mono for Android claims to support "dynamic language features" which sounds like it should be targeting .NET 4. Odd. I suspect the fix is the same though.)

Categories

Resources