Is there som requisite that block Dapper use in a PortableLibraryProject? I'm trying to create the data access library that will be used in a wp7 and a WPF application.
WP7 app will also work in offline mode so I can't rely on a common external webservice
Dapper cannot be compiled as a Portable Class Library because there's no support for Reflection.Emit and System.Data
Dapper needs to be compiled as Portable Class Library to be able to use it from a Portable Class Library
Related
I'm developing a cross platform app in Xamarin.iOS and Xamarin.Android. I want to write a dal or repository layer once, and then make a reference to it from Android and iOS yo layers. Is this possible? Thanks.
This kind of thing is not possible for 1.x, as the API is not compatible with any PCL or .NET Standard profile (however, you can use shared projects to achieve something similar). However, version 2.0 of the library is compiled as .NET Standard 1.4 and so you can create one assembly that can be referenced by any platform that also implements at least .NET Standard 1.4 (including Xamarin iOS and Android).
I have a project, written in C which I want to use in Xamarin Forms. What is the best way to use this code? Generate libraries for each platform?
What I'd prefer is to have one wrapper that I can use in shared code that doesn't have to be implemented for each platform.
Unfortunately, the way binding works is different for Android and iOS, so you would need to generate libraries for each platform.
You can read more about how that is done here for iOS and here for Android. For iOS, you can consider using Objective Sharpie which will do the most of the work for you.
Afterwards, you can simply use DependecyService to access the native platform features.
I have an existing C libraries which uses Win32 API but it is not supported in windows 8 metro store apps.
I tried calling WinRT API but failed so is there any way ican use WinRT apis in C.
Since the question although very general seems to be specifically about SHGetSpecialFolderPath() on WinRT I'll address this:
As you found out WinRT (Metro) apps run in a sandboxed environment which only supports a limited subset of the win32 api.
SHGetSpecialFolderPath is officially deprecated on MSDN and its functionality is not available to WinRT applications. The closest equivalent would be the ApplicationData class. Unfortunately calling it from C is complicated. I would recommend writing a C++ helper which your library could call into.
I am new to MonoDroid so maybe there is an easy answer, but so far searching hasn't turned it up... Since deploying to the Android emulator takes _for_ever_ on my PC, I would like to put most of my logic into a separate library and test it from a separate winforms application. Later, I can build a regular MonoAndroid application that provides the UI and just calls the library. However, when I try to link to the MonoAndroid class library I get this message:
Warning 1 The project 'MonoAndroidClassLibrary1' cannot be referenced. The referenced project is targeted to a different framework family (MonoAndroid)
Is there another way to achieve this objective? Yes, I could simply create a separate standard windows library and copy/paste the code between the two, but there must be a better way
You can use this extension http://msdn.microsoft.com/en-us/library/ff921108%28v=pandp.20%29.aspx
You would need to create a regular .Net 2.0/3.5/4.0/etc class library and copy (or link) your source code files into it. Use this assembly for testing in winforms, and the Android class library copy for Android.
Of course, this will only allow you to write code that doesn't reference anything in the Mono.Android.dll assembly.
Is it possible to create a small library (similar to a Flash or Flex SWC component) that can be used in Silverlight apps?
Since I'm a Flash and Flex developer, I'll relate it. In Flex, if I have a SWC I can add it to my build path and then immediately use its included classes and functions in my project. Similarly, in Flash if I add a SWC to the Components folder then drag that SWC into my library, I can use the classes in my Flash project.
Does Silverlight have a similar concept? I just need a small code library that I can send to other developers, but it should be pre-compiled so the source is not readily available.
Thanks!
You should not have an issue pre-compiling the "Silverlight Class Library" project type in Visual Studio like you would traditional C# libraries, and release these to developers who can reference them in their Silverlight applications.