Problems using cfAES - compact-framework

I need to use HMACSHA256-Encryption on a Windows CE device.
I tried to use BouncyCastle / cfAES (in combination with OpenNETCF), but I can't get them to work.
BouncyCastle: I always get the error "Missing method exception: " regard macUtilities.GetMac-method.
cfAES: There's a whole bunch of error messages... "Type or namespace 'HashAlgorithm' not found" and so on...
What's the best practice to use cfAES or BouncyCastle on .NET Compact Framework? Where are the pitfalls? What are the requirements for cfAES (which version of OpenNETCF)?

I built BouncyCastle 1.7 for the Compact Framework back in 2011 with no problems. I put the solution on my blog since there was no way to add an attachment here.
For the OpenNETCF solution, the latest versions of the SDF have have HMACSHA256 already in it - why are you pulling in cfAES as well (Casey merged in his code long ago).

Related

F#: Is Profile 47 required for Microsoft.FSharp.Data.TypeProviders?

This is a follow-up to my post yesterday. To recap, I received this error message when trying to build my project:
FSC: Error FS2024: Static linking may not use assembly that targets
different profile
I consulted some kind people in the F# fpchat.com channel, and one of them suggested that the error could be due to the fact that I did not have Profile 47, because FSharp.Data uses Profile 47. I tried downloading the target pack for Profile 47, but was redirected to the Microsoft homepage instead. I tried the second answer on this SO page, but that did not work either. As of now, I am still unable to acquire Profile 47.
I consulted the FSharp.Data GitHub page, but it is not clear to me why Profile 47 is needed. I use VS2013 compiling to FSharp.Core 4.3.0.0; shouldn't that be sufficient, since the GitHub page lists it as one of the supported platforms?
I have created a new project, re-added all my source files and references, and tried re-building. I have even tried uninstalling and then re-installing Microsoft VS, even though I know it is likely irrelevant.
I think it is most probable that the problem lies with referencing FSharp.Data.TypeProviders. The error message does not appear insofar as I exclude reference to FSharp.Data.TypeProviders. The strangest thing is that I have not changed my references at all over the past week or so, but the error message only appeared yesterday.
So, my questions are:
Is Profile 47 really required? If so, how may I acquire it?
Even if I do acquire Profile 47, wouldn't I still experience trouble building my project, since my other references do not target Profile 47?
Are there any approaches that I may not have considered?
After tearing my hair out trying a variety of suggested solutions I found online, I discovered that the only way to resolve the issue was to change my Target Framework from 4.5 to 4.0, re-install all of my references to ensure compatibility with .NET 4.0, and then re-build my solution. Using .NET 4.0 means that I am no longer able to use Microsoft.Experimental.Collections, since it is compatible only with .NET 4.5. This means that I will have to re-write all of my code that makes use of Microsoft.Experimental.Collections, but I consider that a lesser evil than not being able to build my project at all.
So, to answer my own question mentioned in the title, Profile 47 is not required to use FSharp.Data.TypeProviders. :-)
EDIT:
I have found another solution to my problem. I created a new project (again), migrated all my source files over, re-installed all the DLLs I need, and this time I have no trouble whatsoever building my project. I think Carsten (who wrote the first comment to this answer) is correct in saying that the versions became messed up in the original solution files.

Type reference forwarding in the MonoDroid project requiring it

Regarding to the solution described in this post, a third assembly is required to forward the type resolution to the correct assembly.
When adding this reference to the Android class library project using the type, the forwarding seems to not be done. The reference needs to be added in the Android application project which is the end point of the build process.
Does any solution exist to add the reference embedding the forwarding in the project requiring it ?
I mean, if in my solution architecture I use :
MyApp.Core - PCL
MyApp.Core.Droid - Android class library
MyApp.UI.Droid - Android Application
The usage of System.Net namespace (System.Net.Socket.AddressFamily for example) is done in my ViewModel, which is located in MyApp.Core.Droid (redirection of MyApp.Core with some plugins). In this case, it is more logical (and readable) to have the reference in the MyApp.Core.Droid. But in the fact, the assembly resolution is done (from what I understand) when packaging the application, so in MyApp.UI.Droid. So in this case, the reference needs to be added to MyApp.UI.Droid in order to be found (failed if added to MyApp.Core.Droid).
In this case the solution works, but its quite obvious to understand for a new programmer joining the team which, has not been facing the trouble and understands why this reference needs to be added to the UI project...
I'm not sure my thought is easy to understand by the way I introduce it. Let me know if you need more explanation.
Thanks,
Guillaume.
I'm not entirely sure why this 'fails if added to MyApp.Core.Droid' - it feels like this should be added. However, I know that Xamarin have tweaked and changed the dependency resolution scripts a few times.
With that said, I think the best answer to your question is 'don't worry about it too much' - this is only a small inconveneinve right now and it will be resolved by Xamarin's updates 'soon'.
The current PCL support is something that I and a number of others have worked on in order to make things work. This set of 'hacks' is a workaround for the lack of 'proper PCL' support - it simulates what the Microsoft PCL build platform does on WindowsPhone, WPF, etc, but it isn't a perfect implementation.
Xamarin have now committed to 'proper PCL' support. When that happens then these type-forwarding dependencies will automatically be added. The good news is that this support is perhaps now only days, weeks or at most months away.

Q_STATIC_ASSERT & Q_STATIC_ASSERT_X compilation problems on Visual Studio 2010

I develop and maintain a very large opengl application, written using qt library. I'm switching from qt 4 to qt 5. I downloaded the qt 5.0.0 Windows (8) Visual Studio 2010 precompiled package. Unfortunately I discovered that I get millions of OpenGL errors caused by the OpenGL ES 2 support provided by the precompiled package. So, I downloaded the source code and I recompiled qt using the -opengl desktop flag on the configure step (for further details on the problem please refer here). The opengl compiler errors disappear but I still have hundreds compiler errors everytime inside the Qt library itself there is a reference to two macros Q_STATIC_ASSERT and Q_STATIC_ASSERT_X.
The typical kind of errors i get are:
- error C2062: type 'void' unexpected
- error C2238: unexpected token(s) preceding ';'
Some suggestions?
Thanks
As described in the comment to the question I solved the issue by looking for redefinition of static_assert and commenting it.
In particular my code was using the VCGLib library wich was redefining the assert in base.h

Cannot find the type library for this reference

I'm having troubles registering windows script file. When I'm trying to do so it says "Cannot find the type library for this reference Some.Reference"
Basically, behaviour is very similar to one described in this question Windows Scripting can't find reference but I can't figure out what to use instead of c:\path\to\control.dll.
In my case Some.Reference is Msxml2.FreeThreadedDOMDocument.4.0. so what should I actually do? I tried to use different kinds of msxml.dll, but it didn't seem to help.
Or maybe there are other ways to solve this issue?
One more detail: I managed to register this script on Windows7 but I get described error in Windows Server 2008 sp 2
Hans, thanks for your comment, because what I did is I used this tool
http://www.nirsoft.net/utils/registered_dll_view.html to view registered dlls and I found that the only abailable object I had is Msxml2.FreeThreadedDOMDocument.6.0 so I just changed my script to use this version, and as I can see from your comment it was not the worst decision

gecko in vb.net, objectreference needs objectinstance?

I want to implement a Webbrowser in my vb.net (2008)-project, however, I don't like the inbuilt IE.
I also remembered that is was kind of easy to implement a mozilla-tool like the gecko-webbrowser in the past...
It was kinf of more complicated than I remember, as I had to dwnload xulrunner and Skybound.Gecko.dll which both probably have to be included in any publishing of the finished project... I also defined x86 as target CPU and made all the needed steps to use a GeckoWebBrowser within my Application. I also called Skybound.Gecko.Xpcom.Initialize(My.Application.Info.DirectoryPath & "/xulrunner") before compiling it.
However, when I try GeckoWebBrowser1.navigate("http://...") (The element was inserted with this name per designer) the IDE tells me that an objectreference is not set to a objectinstance as if GeckoWebBrowser1 isn't defined yet... but the GeckoWebBrowser1.Created attribute is giving back true.
Does anybody know why it isn't working yet?
I have the same error in my solution. Try to use GeckoFX assembly. I use 15 version dll and error fix.
https://bitbucket.org/geckofx/geckofx-16.0/downloads