Use existing Win7 code base in Windows 8 App - windows-7

In my company we have an existing product that runs on Windows 7 and communicates with our web services.
We wish to make a Windows 8 tablet version of our product, and my first thought was:
"Hey, its just a new Windows version, so we can probably use our existing model, data access and business layer logic projects, and just focus on making a new UI layer"
But I fear that this is not the case, or am I wrong?
I tried opening our VS2010 solution file in VS2012 Express, but received an error "This edition of Visual Studio only supports Windows Store apps".
So, my naive hope now is: Can anyone tell me the easiest way to make our existing code work in a Windows 8 App?
EDIT:
The code is .NET C#, and my thought was that I just wanted to make a Windows 8 app so that the product had a tablet/touch friendly interface.

In general, you'll make a new UI using XAML, reuse a lot of your existing code, and change the data access to use SQLite.
VS2012 Express Edition is for making Windows Store apps. By "Windows Store" app, I mean an app which uses the WinRT APIs. Depending on your code, making a Windows Store version of your app can be straightforward.
If you need other features, you might need a different version of Visual Studio 2012. You definitely need to be on 2012 though. You can't build a Windows Store application with Visual Studio 2010. I think you know this already though.
If your existing .NET app uses WPF for the UI, you can reuse a lot of your XAML knowledge for the Windows 8 port. It's not as simple as recompiling, but it should be straightforward.
SQL CE is currently not an option for Windows Store applications. Instead, consider using SQLite.
Take a look at a post on MSDN called .NET for Windows Store apps - supported APIs. Some APIs you may be familiar with have been moved to WinRT. Sometimes porting is as simple as changing namespaces.
You mention that you also write to the C: drive. There's a sample on MSDN on how to read and write files.

So You need to build a new Metro Style Interface.
Wen You built interface just copy the Logic of your old application.
You can open old application in old VS 2010 and copy code line by line.
You can't convert old Windows app to Metro Style App.

Related

How to develop Windows app on Visual Studio for Mac

I recently bought an iMac in order to develop my App on Visual Studio for Mac in a better environment (lots of issues on Windows), but on the Visual Studio for mac, there is no UWP projects.
It is understood that I have to create a new .NET project, but what are exactly the steps to follow in order to achieve that correctly for the app to work on Windows with a peace of mind? Should I have gone with Visual Studio code, which support the .NET core framework completely?
I saw on other answers that I need the .NET SDK tool, and so forth, but further details are needed if you don't mind on the why (not the installation stuffs, only the tech savvy explanations for the app to build correctly at the end!
You will need to run a Windows installation (eg, via Parallels or Boot Camp) and then run the Windows version of Visual Studio to create UWP apps.
You can do a lot of the business-logic coding inside Visual Studio on MacOS, but you will need Visual Studio and the Windows SDK to use WinRT types (which are required to build a UWP app) and to correctly build / package the app for deployment.
.NET is a big ecosystem. As you cannot develop all kinds of .NET projects using Visual Studio on Windows (Xamarin.Mac for example), you cannot do the same using Visual Studio for Mac (like you found, WinForms/WPF/UWP and so on). Such limitation comes from vendor SDK availability or other underlying systems.
In your case, you can easily develop web apps, Mac apps, and iOS apps. If you do want to develop Windows specific apps, like the other answer shows, please use Windows.
You mentioned ".NET SDK", but I believe that should be ".NET Core SDK". .NET Core apps are cross platform. Thus, you can develop such apps in Visual Studio for Mac, and then deploy to Windows. However, so far only console apps and web apps can be developed. What might happen in the future is still to be determined.
Visual Studio Code, however, is just a code editor. It won't give you extra flexibility.
For those whom imperatively needs to develop their app on all platforms, here is what I did, and the pros and cons:
Buying an Imac, thinking that I could also develop UWP projects within it
After realizing that I couldn't, I bought a cheap Windows 7 pro License on ebay (around 5$), and installed it on VirtualBox.
From there, I upgraded to Windows 10 for free and installed everything. It worked like a charm.
Cons: Buying a brand new IMac while a Macbook pro would have been better. An old one even since YOU CAN'T upgrade the ram.
Working on 8go of ram computer when you must give 4go of RAM to your VM isn't quite great. 4go gets you a laggy environment! Really frustrating.
So, prefer something older, but up-gradable (a cheap Macbook pro with 16go of RAM would do).
Not to mention that you will have to install Ubuntu as another VM in order to setup a .Net core Server for the majority of you.
What environment to favor while developing, most importantly when you are a C# and Xamarin noob like me?
The best being to develop from Mac as you will have FAR LESS ERRORS AND BUGS than in VS for Windows.
Correcting mistakes is really daunting and the best is really to develop from Mac to mitigate the damages, but it won't be hurdles free as well!
It took me more time debugging than coding within VS Windows.
After developing chunk of your app within Visual Studio MAC, the best is to get the code on the windows machine and arrange it to work in UWP.
UWP apps compile fastly and like a charm, so better is to get rid of errors within macOS, IOS, Android, and then go and adapt to UWP. This is easier IF YOU THINK ABOUT CHOOSING THE CORRECT LIBRARIES (working on all platforms, hence check my last advice).
From VS Mac, compile using macOS as a host! It's the easiest way to develop fastly, and correct your bugs.
Here is an article on how to get started from Mac:
https://blog.xamarin.com/preview-bringing-macos-to-xamarin-forms/
Cons: Always having to commit the code for it's use within UWP. But that's also a good way to save your project as well, so that if you screw up (like it happened to me numerous time) you roll back.
Hope that helps others whom didn't know what to do and where to start.
ALSO:
Don't follow tutorials dating from before 2017. Use the .Netstandard/.NET Core framework to develop your App so that libraries are more portable (following the blog article above should do).
Otherwise, headaches ahead!

Convert windows phone application to universal one

Recently Microsoft announced ability to create universal applications in Visual Studio 2013. Is there any easy way to convert existing Windows Phone 8 application into universal or i have to create new project and properly move the code manually?
It is not about converting a project type or moving code. You will have to port your app from one runtime to another. This is because the Universal project templates use the Windows Runtime APIs where as your existing Windows Phone 8 application uses the Silverlight APIs.
Windows Phone Store apps use the same app model and UI framework as Windows Store apps do, and they use the Windows versions of common features such as background tasks. You will still be able to reuse a lot of your existing code, but these differences mean that it really is a porting exercise, more than just an update, to move a Windows Phone 8 to the new app model.
(Source)
There are some features that are available in Windows Phone 8 for which there is no Windows Phone Store (Universal apps) equivalent. See more here.
The right-menu option is "Add Windows 8.1...". That will add Windows 8.1 support and add a Shared section to both projects so you can share code between then.
In your solution, right click your Windows Phone application and select "Add Windows 8.1..." and follow the prompts.

How to run Embedded Visual Basic on modern PC

I try to use this abandoned software to teach newbie with Visual Basic 6 knowledges only.
I know this software is not recommended for real-world development.
I have installed eVB (full install) on Virtual PC machine with Windows XP mode
I tried to run application on emulator. Firewall allowed this connection.
But I've got message:
Emulator for windows CE will not run within another copy of emulator for windows ce
As I mentioned this problem, with no workaround:
VPC and the Emulators use the same emulation engine, and so the emulators think you're trying to run them inside another emulator instance because they can't tell the difference.
1) Is there possible to run eVB on Win7 PC?
2) Is there possible to run eVB on VmWare PC with Windows 2000/Windows XP?
3) Is there free alternative to eVB for learning purposes only?
Yes, the emulators will not run in a VM.
I do question to value of using eVB, as it's definitely a dead technology, and there's very little use for the VB6/VBA syntax any longer.
If you're trying to teach the basics of programming in general the I'd get an Express version of Visual Studio and teach VB.NET or C# for a simple, standard desktop application. Most of the knowledge there would be transferrable to a device.
If developing for a Windows CE device is a hard requirement, then I'd probably try finding an old version of Visual Studio (2005 or 2008) and using VB.NET or C# in the Compact Framework for those. My guess is that your best route there would be to try to find the eval version of Platform Builder (Windows Embedded Compact 7) which would give you something like 90 or 120 days.
The express edition of the newest versions of Studio also allow targeting Windows Phone, which has an emulator and supports VB.NET or C#.
And of course you could even try using Xamarin Studio and target Mono against an Android emulator. Again, you'd get C# on a device, though the UI paradigm is way different than anything for CE or Windows Phone.
If you simply want to write BASIC code for am embedded device, Parallax has the BASIC Stamp, which has pretty cheap starter kits. If you're after .NET on an embedded device, Netduino might be what you're after (I think they have VB.NET support).
Really I guess the question is "what's the end goal?" To learn general programming? If so, just use a desktop machine to start with. To apply programming knowledge to an embedded device? Then get something with more up-to-date support.
Regardless of the goal, I have a hard time coming up with a valid reason for trying to use eVB.

WinRT with VS2010 on Win8?

To what extent is it possible and legal to developer WinRT applications with VS2010 Pro?
On the one side, I think it should be perfectly possible and legal to create an HTML5/CSS/JavaScript WinRT App with VS2010 Pro since you can probably do so using Win 8 Notepad. On the other side, I think it might be difficult and possibly illegal to create an C# WinRT App via VS2010 Pro since doing so might require the user to circumvent intentional limitations of the VS2010 Pro software.
In the old days, the user just bought a stand alone compiler and she/he was free to link it against whatever libraries she/he choose. In this way, she/he didn't have to upgrade her/his compiler anytime she wanted a newer version of MFC or *.NET. These days, the IDE seems to be married to the compiler so I'm not sure if the user is allowed to use older IDEs (such as VS2010) to link against newer libraries like those offered in WinRT
See here.
You can use the Windows SDK, along with your chosen development
environment, to write Windows Store apps (only on Windows 8)...
So it's clearly legal. I haven't tested it, but I'm going to guess that you can probably do the code side of things in VS 2010, but VS 2010 isn't setup to do Windows Store UI so xaml, html5 etc probably won't work.
It's probably much easier to simply use Visual Studio 2012 express.
To what extent is it possible and legal to developer WinRT applications with VS2010 Pro?
It is not (directly). The APIs and the packaging tools will not be available in VS 2010.
While you could potentially do this yourself, it seems far simpler to just install Visual Studio 2012 Express for Windows 8 and use it.
These days, the IDE seems to be married to the compiler so I'm not sure if the user is allowed to use older IDEs (such as VS2010) to link against newer libraries like those offered in WinRT
It's more than just newer libraries - there's an entire new runtime, and the language needed changing in order to work with it.

Porting Windows Phone7 application to Windows 8

I ported my windows phone7 application to windows 8(just copy paste the xaml and c# code in visual studio 2012->new->project->WPFApplication) and made changes in UI sizes.The problem is the .exe file(after building wpf application) runs only in the system with .NET framework installed.I want to run my application in all system running windows(7(32/64),xp,vista).I am newbie to windows application basically wp7 developer.Thank u.
If you really want to port a windos phone 7 app to windows 8, You should go through the following resources. They provide most of the information.
http://msdn.microsoft.com/en-us/library/windows/apps/hh465136.aspx
http://leventoz.wordpress.com/2012/03/07/moving-a-windows-phone-app-to-windows-8-a-case-study-part-1/
http://leventoz.wordpress.com/2012/03/11/moving-a-windows-phone-app-to-windows-8-a-case-study-part-2/
WPF is a part of the .NET framework, so you can't write a WPF application that can run without the framework on the machine.
If you want to create a binary that run on the classic windows runtime you can't use WPF/C#/VB etc.
Best thing if you want to port your Windows Phone app to Windows 8 is to create a Microsoft Store app, File > New Project > Blank App in VS2012. The app won't run on anything except Windows 8 but the Microsoft Store for Windows 8 is probably the best place to have your app if it's ported from Windows Phone.
Migrating application to WP7 is not that easy as it sounds. There is lot of different APIs and also limited async/await in WP7 when using this extension.
I would probably recommend starting with this MSDN article. It describes basic problems and challenges and also contains useful namespace and API mapping:
Migrate/port a Windows Phone 7 app to a Windows Store app

Resources