Convert .net project 4.5 framework to windowsCE (smartDevice) project which supports development in 2008 - windows-ce

I have written code in C# .net framework 4.5. Now, the client says he wants it in Windows CE. So I have downloaded VS 2008 and created a smart device project with Windows CE option and framework 3.5. I have used the files as is and build. The solution gives lots of error on build.
Eg of error is - Background worker in .Net 4.5 is not supported in WinCE 2008 project
Any pointers how this can be achieved? Its a huge code so rewritting whole code will cost a lot. Quick pointers are highly appreciated.
I have tried removing the references from old proj and tried including dll from VS 2008 dlls. E.g. System.Data.SQL is not present in 2008. Background worker is not present in VS2008

Check out the Smart Device Framework, it provides a port of the Background Worker for the .NET Compact Framework. It may give you some alternatives for other pieces of code you're porting over:
https://github.com/ctacke/sdf
The missing SQL Server library is a difficult one to answer without more details, but you will need to decide on how you wish to access data. Is there going to be a local database or will you need to retrieve data from the SQL Server database through some type of service?
SQL Server Compact and SQLite are popular databases used on Windows CE, so those are some options if you need to create some sort of local database.

Related

Data Access Library using EF in linux server

I've developed a data access library that exposes some repositories to access a DB using EF6.
I am a bit confused about EF and EF Core, and Asp and Asp Core...
I want to use this library in a WEB API I have to code, to access the data from a mobile phone. (Barcode will be scanned, and used to retrieve data from the db using the repos in the dll)
The Api should be able to work in Linux and Windows servers.
My question is, can I use this library, which uses EF6, to create an API and deploy it in a linux system?
Or should I migrate to EF Core? Or can I use/call it maybe with NodeJS or something like it?
In other words, do I need to use EF Core everytime I want to use the dll/app in a non windows system or can I still use "old" EF? Or maybe I understood something wrong?
Entity Framework runs on .NET Framework. Not .NET Core. .NET Framework only runs on Windows (unless you use Mono, which has EF support).
.NET Core runs on Windows, Mac OS, and Linux. Therefore, if you intend to run on Linux and use some form of EF and some form of ASP.NET, your best bet is to use EF Core running on .NET Core, and to use ASP.NET Core for the web layer.

Setting up a Smart Device Project in VS 2012 with CF3.9

I currently need to work on a Compact Framework Project again. I used to do this some time ago with VS 2008, however I don't have a license for this anymore. I do have licenses for 2012, and it really seemed like good timing for me given the recent announcements (Get started developing for Windows Embedded Compact in Visual Studio (Compact 2013)).
I downloaded and installed Application Builder for Windows Embedded Compact 2013
And install the Embedded Compact 2013 Update 5 (full setup).
Unfortunately after these steps the Project Templates still won't show up.
My current understanding is that the template will only be visible when I also install the SDK.
The SDK provided for the Windows Embedded Compact 2013 product that you are targeting. Typically, this SDK is provided by an OEM.
However, I don't have a device for development, I used to use the emulator for this and they used to be available in Visual Studio without big fuzz.
I tried to find an emulator using my preferred web search, but without any success.
Using Windows Embedded Compact 2013 (WEC2013) it's impossible to develop a Net CF 3.9 application without an SDK.
There isn't a default SDK. In general, when you have an embedded system, it isn't general purpose but it has specific features that the OEM exposes with a custom SDK. In this way, avoiding standard SDK, who develop application can't use feature that there won't be on the target hardware.
The only way you have to start develop is to install Platform Builder and using built in CEPC BSP to create a CEPC image for a virtual machine and an SDK for it.
After installing this SDK you can use your virtual machine with CEPC image to run your application. In this way you can create an "emulator" for a x86 system with WEC2013 on it.
Paolo.

Metadata exception - schema specified is not valid - Installing a C# Windows Forms application on Windows XP using ClickOnce and EF Code First

I have a C# Windows Forms application that makes use of SQL Server 2008 R2, .NET Framework 4, .NET Framework 4 Client, and Entity Framework Code First.
SQL Server 2008 R2 Express exists on the machine, and the program does create the database and tables.
[Update]
I tried installing .NET framework 4.5, but I got this message:
Blocking Issues:
The .NET Framework 4.5 is not supported on this operating system.
Warnings:
Setup may not run properly, because the Windows Modules Installer
Service is not available on this computer.
with this link
The operating system is Windows XP 2002 SP3 running inside VMware Player.
[Update 25th May 20xx]: I found a link here that caused me to think the problem is just that ClickOnce won't install on Windows XP. However I recreated the set up in Visual Studio 2010 and have the same error.
[update 26 May 20xx]: I created a test project with Visual Studio 2012 and Entity Framework 5 and was able to successfully install on Windows XP using ClickOnce. Strangely I was then able to publish a version of my big application that worked.
I am not sure what is going on. I also did install a program containing Entity Framework 6 on my test computer - but this would not have been referenced by my big application.
Have you tried installing .NET 4.5?
I know it sounds absurd, but we're seeing the same issue: Entity Framework 5.0 (4.4) targetting .NET 4.0, Code First on SQL Server CE.
Installing .NET 4.5 made the issue go away. We're still investigating, because we also have a couple of Windows XP clients.
Update:
Portions of the Entity Framework 5 code are part of the .NET framework itself (that's why there's a 4.4 version for .NET 4.0 that e.g. doesn't support enums, while the 5.0 for 4.5 does).
It seems this issue is related to that since installing .NET 4.5 inexpliccably solves this.
For Entity Framework 6 those portions were moved to Entity Framework, so Entity Framework 6 doesn't depend on framework specifics anymore. We've updated to Entity Framework 6.0 alpha 3 and everything seems fine.
Now, I don't like running alpha code, but this is the only solution we could find.

Developing applications for Windows Embedded Compact 2013

Today I stumbled over the Application Builder for CE 2013 in Microsoft's download center. As of the description, with this pack I should be able to develop apps that target Windows Embedded Compact 2013 with Visual Studio 2012.
After downloading and installing the Application Builder I found the new framework assemblies in C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\WindowsEmbeddedCompact\v3.9, but there are no project templates targeting Embedded Compact 2013 in Visual Studio 2012.
I tried to create a blank WinForms or WPF project and to retarget it to 3.9, but that doesn't seem to be possible as well. There are no online templates that could be installed.
How do I create a CF 3.9 application using Visual Studio 2012?
All I can do here is sigh. Here's the state of things as of this writing (Mid May, 2013) and it could change in the coming weeks and/or months.
The Application Builder does not ship with device templates. Templates, instead, are shipped with the device SDK. Yes, this is different than in the past. It means that to do any device development, you'll need an SDK.
Windows Embedded Compact 2013 is currently not publicly available, so no one can currently ship an SDK. The net effect of this is that, for now, for the general public, the Application Builder install is completely useless.
Once WEC 2013 is public, I don't believe Microsoft will be shipping any "generic" SDKs. I very likely will. Once we have SDKs in the wild, you'll have templates and be able to build projects.
I also downloaded the Application Builder, and found it quite useless, hey where are the compact project templates! (thanks for the confirmation ctacke) after reading this today and discovering the .net assembly folder posted by Gene, I figured I at least try to use the object browser - and found you can browse the objects by using the Windows Embedded Compact 3.9 filter - figure others might want to at least look at what's new like I am attempting to do..
It is possible to create new SDKs from OS Design projects.
Create one from CEPC.
http://msdn.microsoft.com/en-us/library/jj584864(v=winembedded.70).aspx

SQL Server CE runtime in C# project?

I have an app using SQL Server Compact Edition. So I need the runtime to be on all the machines. I've been looking for the merge modules for the runtime however I've had no luck there.
Is there a way to bring the runtime into the app itself? And in so doing not not requiring the user to install the runtime?
Or is there a way of extracting the modules from the msi and loading them into my installer?
I am using Visual Studio 2012. And playing around with a few installer creators like Create install free. As a side, does anyone have a good freeware installer creator?
Any help would be great,
many thanks in advance
You can include the SQL Server Compact DLL files with your app, so you do not need to install anything in addition to your app - see my blog for long, detailed description - which SQL Server Compact version do you use?

Resources