kernel32.dll is missing in Windows Phone 8.1 app thru NHunspell - c#

I'm trying to use NHunspell library in my windows phone app (available thru NuGet package).
In the Hunspell constructor i'm getting this error:
Additional information: Unable to load DLL 'kernel32.dll': The specified module could not be found.
Does anyone know how why it happens and how can i fix it? i'm running my app in the emulator, maybe this cause the issue?
The same code works fine in a simple desktop app, so i guess it is something with the project refrences or stuff like that...
And if there's someone who is familiar with this spellcheck lib and WP or in general, i'll appricaite his help.
Please help!
Thanks in advance!

In fact NHunspell uses Hunspell. Hunspell is not a native windows component as mentioned, it is a C coded spell checker library. If it is possible to use native compiled libraries on Windows Phone, someone could compile Hunspell for it, so that this can be deployed to the Phone. This would also be nice on Android and iOS in conjunction with Xamarin. Currently there is no native Hunspell library for windows phone. But this should be possible with Windows Phone 8 native support.
I have already laid the foundation for this cross platform compilation by separating the NHunspell and native Hunspell projects in the latest NHunspell version. But I'm targeting Linux x86 with this step. If someone is good at cross platform development, maybe this could be done for the mobile devices too.
This blog post describes the new build process where additional native builds can be integrated: Building NHunspell with PowerShell Build Tools

Related

UWP exception “Could not load file or assembly Windows.Data......"

I have a application UWP that I downloaded for to check how managed UWP with SQLServer from here: https://github.com/Microsoft/DesktopBridgeToUWP-Samples/tree/master/Samples/SQLServer
When I try to Build the application I got so many errors about the Windows resource is not found,,, I have the last version of VS2017 and also W10 Pro SO....
I tried to add references and reinstall nugets, change the debug type, change the Frameworks... and I don't get works....
Can you tell me what more to do?? Maybe you can download the Project and see the same error than me...
This reference is used to call UWP APIs in "SqlBridge" windows console project.
To call UWP APIs from a classic .NET Framework application, you could install UWPDesktop NuGet package
For more info, please see Calling Windows 10 APIs From a Desktop Application.

How to disable Native Image Generation on Windows Phone 8.1?

I've got a c++ application for Windows Phone 8.1, which uses a C# module for xml processing. The NGEN'd version of that module throws and InvalidCastException from System.StubHelpers.InterfaceMarshaler.ConvertToNative, but the non-NGEN'd version works fine (more details here: http://social.msdn.microsoft.com/Forums/en-US/16fa4316-d0ae-4aca-ac70-9946c6cc4dfb/ngend-dll-throws-exception-but-winmd-does-not?forum=wpdevelop).
Anyway, as a workaround until I resolve the underlying issue, I would like to simply disable native image generation for my app. However, the approach suggested on msdn of including a nongen.txt file in the root of the appx does not seem to be working... the file is there, but the C# module still seems to be getting NGEN'd. Has anyone else run into this / does anyone know how to disable NGEN for an app on Windows Phone 8.1?
I managed to get ahold of a guy from .NET Native who is familiar with the native image generation process. Apparently there currently is no way to disable native image generation on Windows Phone. Here's the full response:
"Nongen.txt is not supported on Windows Phone. Technically, NGen doesn’t really exist on phone. Native code generation on phone goes through a very different set of steps compared to Windows. There is currently no supported mechanism for skipping native code generation when the app is deployed through Phone app store."
Too bad - that would have been a handy workaround.

Problems referencing Facebook SDK C# WP8 from C++ Windows Phone 8 app

I try to reference facebook.dll - wp8 branch - within an app of type "Windows Phone Direct3D App (Native only)" project under Visual C++ VS2012, and I get the error:
a reference to [dllname] cannot be added because the two projects
target different runtimes.
The restriction is that I cannot change the architecture of the application, so the main entry-point must be in the C++ project, and from here to call somehow the code written in C# for facebook.
Based on http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj714080(v=vs.105).aspx , I tried also to reference the C# dll indirectly through a Visual C++ "Windows Phone Runtime Component" but again I get the same error. I tried to change some project settings and nothing worked. Trying to consume C# dll in C++, in all samples and demos which I found on the web, for wp8, the main entry-point is always in C#. Only some hints regarding windows store apps seem to indicate that could be possible to consume C# from C++, but I don't find any reference saying explicitly that my scenario on wp8 is possible or impossible.
How can I use facebook SDK from my WP8 app? Or what options I have?
Thanks in advance to anybody which shares the solution or any suggestion
C++ projects can't just invoke any C# DLL in WP8. You'll have to change how the class is built. Start a new C# XAML + C++ D3D project and have a look at IDrawingSurfaceManipulationHandler and Direct3DInterop. Basically you'll have to recreate and recompile the Facebook C# SDK to use it in WP8 C++.
However, installing and using the Facebook SDK on WP8 C# projects works OK on my machine. Have you considered usign a mixed C# and C++ project? It does have a small perf hit, but as long as you use DrawingSurfaceBackgroundGrid you should still have relatively good perf.

Is it possible to install mono or similar (C# compiler like AIDE) on android machine?

I was searching for a while, but didn't get the solution.
If you want to write mobile applications with c#, you can install mono as I understand.
It can be found on the following site http://xamarin.com/monoforandroid
.
So they support both Windows and IOS.
But I think they don't support to run their software on android
My question is:
Is there any tool to write code with c# on an android device?
I mean I want to write C# code and compile directly on my android device.
I know AIDE for java, but it seems there isn't exist any tool like AIDE for C#
Thank you..
The Mono for Android project allows you to write code in C# and run it on the Android platform. It will install a Mono runtime along with your app.
The Mono runtime run along side the Dalvik virtual machine, so performance is comparable to writing your app in Java and running it inside of Dalvik.
Take a look at C# To Go, a simple C# compiler that runs on Android. The Mono C# compiler has been ported to Mono for Android for it, and that port is also available for you to use.
Note that the compiler is not perfect. Introducing C# To Go details some of the problems you may face. Nevertheless, it may be sufficient for your needs.
I am not aware of a tool like AIDE where you can write code in C# on Android, compile on Android, and deploy to the same device. Such a tool would have to come from Xamarin as they hold the IP and sell licenses for MonoDroid.

WinRT and DLLs: What exactly am I allowed to use?

It's not all together clear to me, so I am hoping someone here knows the answer. I am using the C# Json.Net and the C# HtmlAgilityPack both built from sources for "Any CPU". I've noticed that both of these include using directives that reference assemblies that don't seem to be available in Metro yet they both build fine.
If I reference them, does this mean my app will thunk to unmanaged code?
What exactly causes thunking to unmanged code?
Why are DLLs allowed to reference assemblies that are not available to WinRT and my app is not?
Will this fail the windows store approval process?
What are the general rules for DLLs I include with my app that I need to worry about?
Thanks in advance!
When developing apps that target WinRT, the app should only use the API's available in Windows 8 WinRT. The API's are defined in WinMD files. If the app used the desktop API's, then it will be rejected during the Windows store approval process.
Imagine this scenaio. You developed a WinRT app that uses .NET DLL's from desktop mode (client profile). The app is deployed in Windows store and user downloads it on ARM tablet. The application will crash as it does not have the desktop (client) .NET DLL's on the ARM devices.
so this brings us to the question on what .NET classes we can use while developing apps for WinRT. The article http://kishore1021.wordpress.com/2012/08/06/what-is-portable-class-library-project-in-visual-studio-2012-net-4-5/ lists the .NET classes available for WinRT application development.
Change all open source projects dependencies to target WinRT. See if some methods / classes in WinRT are missing so the code does not compile. Try to find the alternative methods/classes.
Such as List.FindAll(), change to Linq Where()

Categories