Upgrade VB 6 projects to Visual studio 2012 - visual-studio-2012

I have a couple of Projects created in visual basic 6 with oracle databases. I want to upgrade these proejects to visual studio 2012 and use TFS version control. I have read that first I need to upgrade to Visual studio 2008 and then to Visual studio 2012.
Before going ahead with the upgrade ( I need to install Visual studio 2008 as well) I want to make sure this is a realistic approach. So
1. Does converting a vb6 project to VS 2012 ok or I will have to make a lot of changes to make things work?
2. After upgradation would I be able to use TFS for the projects?

TL;DR - yes, you'll need to make lots of changes regardless of how you choose to migrate. TFS question seems irrelevant to me. If you're setup to use TFS for projects, you can use it for these after upgrade as well.
The only reason to consider a 2-step upgrade that includes VS 2008 is that was the last version that included the migration tool built-in (ie, free). As others alluded to, those tools don't make pretty code but a mashup of VB6 and .Net. After trying a few times, I now personally find it simpler and more robust to recreate a new .Net version from scratch, but using the VB6 code as a template. I copy and paste as practical and then do Find/Replace to catch the majority of errors/warnings and then deal with all the others individually. If I have to convert another project, I may use 2008 once just to see what kind of issues the original code had or if there are any unusual situations/controls I'll need to deal with, but I would still start a new 2013 project from scratch. That gives me a better opportunity to improve it as well. You'd be replacing all the connecting code to Oracle anyway. I'd been using OO4O and moved to ODP.NET. If you used 2008, you would have to move to at least 2010 to use the latter in managed mode, which is great not having to load Oracle Client on each machine.

I'd be wary of upgrading VB 6 to VB.net using the automated tools. I did it back in the day (around 2003) when .net was just starting out and my memory is that it wasn't a pleasant experience.
The code produced by the upgrade wizard is a nasty mix of old VB conventions trim, instr and .net conventions. We also had a bunch of weird bugs. Sorry it was a long time ago and I can't remember any details. Only that we did it once for a small number of components, around 6 or 7 activex dll's. That experience was bad enough that we decided it wasn't worth the pain.
We kept the VB 6 code in service until it was re-written as part of a larger push to modernise the codebase.
If you do decide to upgrade then the output is a standard visual studio project that can be source controlled in TFS just like any .net project.
If you reason for upgrading to just to use TFS then take a look at the MSSCCIProvider. This allows you at hook TFS in to the VB6 IDE

I am doing something very similar and did develop a tool to assist with the designer portion of the conversion. It parsers the VB6 file and creates designer code for .NET.
The source is here.
https://github.com/rdejournett/VBtoNET
The only thing I was not able to solve is that controls within tab pages have really wierd X locations like -60000. So I parse those to 0. You'll have to move them to the right place.

Related

Responsive Design and XAML

I am developing Windows Store app using Visual Studio 2013 with update 5 in Windows 8.1, but now we move on to windows 10, and issue arise is responsive in XAML.
I want to know is it possible to design Windows Store application behavior is responsive with existing Visual Studio version 2013?
I explore it how to responsive Windows Store app, but Visual Studio gives this in VS version 2015 and 2017 like relative panels properties, and triggers etc. So, but I can do this in Visual Studio in 2013 version.
So much has changed since Windows 8.1...
You have options on how to go proceed that would depend on many factors - like your resources (time, people, money...) or the composition of your user base.
Your best bet might be to build a separate UI for Windows 10 and reuse mostly just the view models. Possibly simply move the 8.1 version on a back burner and only fix problems and continue working on Windows 10 version separately. This would save you from having too many test dimensions in your code to do API checks etc.
The careful and cheap option is to only add specific new features lighting up on new versions of the OS using API checks.
If what you're looking for is using relative panels and triggers while staying on VS 2013 - well, you don't. The thing is though - relative panels and triggers are only there to make things slightly simpler to do. You can still achieve similar or same results in Windows 8.1 with some custom code.
You can use separate templates for your UI and switch them when the size changes.
You can handle size changes in code behind and rearrange elements and properties from there.
You can build a custom VisualStateManager and/or custom panels that do the same things as you get from the responsive design features in Windows 10, although that's possibly writing a lot of throwaway code that you wouldn't need anymore as soon as you could move to newer versions of VS and drop support for older versions of the OS.

should I delete VS 2012

I've just downloaded and started to use VS community 2013, and up to now, I'm quite impressed with it. I also have VS 2012 professional on my machine, and I'm getting little short of space on my hard drive. Would you suggest removing VS2012, and is it safe to do so?
If you have no legal / license issues with the fact to use "Community" rather than "Professional" license, AND if you don't have coworkers using strictly VS2012 I think you could reasonably uninstall VS2012.
For my second assumption, 2013 is pretty "retro compatible" with 2012, but it's better to keep homogeneous environments between developers.
I think the uninstall itself should go very well (so far never had issues myself with that kind of things, even with CTP or RC releases), but if you are afraid you can do a restoration point or some kind of backup of system before uninstall.
In my opinion, there's no point anymore in switching to VS 2013, because VS 2015 RTM will soon be available - it is currently in CTP 6 and you can get it for free.
The great thing about VS 2015 - apart from all the new features like e.g. C# 6.0 support - is that you get the full version for free, not just a community edition with reduced functionality.

Different version of VS2012 requires project migration?

I have a project that was created using VS2102 Premium. When a co-worker tries to open it with VS2012 Professional he gets a "Needs migration" message for the project. Is this due to the different flavor of VS2012?
I wouldn't have thought so for most projects, however if you've used some feature of VS Premium that is not present in VS Professional, then I guess this is the response you'll get.
If you open a project from a previous version (eg 2010) then it'll offer to upgrade the solution.
You can manually edit the project, its only an XML file. Create a new blank project to see the structure and then use winmerge or similar to copy relevant lines across.

Installshield LE and Express not detecting Office 2010 64bit

Microsoft's vexing dumping of vdproj install projects in VS 2012 leads one to try Installshield LE which is sort of built into VS2012. Sadly, it creates installers that do not work in any way shape or form with 64 bit.
So for instance clicking the Office 2010 installed checkbox only makes a prerequisite for 32 bit Office. It fails to detect 64 bit.
After a lot of chickenless head exploration of Installshield the bottom line is:
1) You need the Professional or Premiere version in order to deal with 64 bit.
2) You need to edit their provided condition to make a compound one that ORs all the guids of Office that you are interested in together as it only checks for one of the many out of the box. This details the structure of the GUIDS: http://support.microsoft.com/kb/2186281?wa=wsignin1.0. I found it helpful to install various versions in a VM and then using regedit to see what the GUID ends up being.
This post is so that someone can actually discover this with a Google search, instead of it being hidden behind a paywall / private support site.
Update October '13 AlBear
There is a beta version of installshield LE for VS2012/13
To build x64 installation packages check on the help files
Look for "64 Bit" .
The way InstallShiel LE recognizes x64 target is by either defining the [INSTALLDIR] property as one of the 64 bit Folder or by defining at least one of the setup components as 64 Bit.
This works as I built an Excel 2013 Add that loads at startup and works fine.
For the Prerequisite for VSTO to work: You need to change file size and hash a it looks like the recommendations from Microsoft article "Deploying Office solutions vsto 2013" are outdated and the XML code recommended has the wrong file size and hash. Not too difficult to fix. However I think that Microsoft is unfortunately going through a period of crisis and this failure to provide reasonable support is uncharted territory .......
Cheers
InstallShield and WiX is like Visual Studio using VB.NET and SharpDevelop using C#. Just as those tools both create EXE's and DLL's using IL code but different language providers,
InstallShield and WiX both create Windows Installer databases using different languages. Just as a VB EXE can consume a C# DLL, an InstallShield MSI can consume a WiX Merge Modules. This gives you the best of both worlds.
The thing to understand is a VSTO AddIn installer isn't a 64bit MSI, it's a 32bit MSI that deploys an AnyCPU DLL with registry entries for either 32bit or 64bit Office. It's the bitness of Office, ultimately, that determines the bitness of your AddIn.
I have a template that I've used for a dozen customers. It uses InstallShield Limited Edition and it's Preq Bootstrapper to lay down all the dependencies and consumes a merge module authored is WiX and IsWiX (CodePlex). Otherwise ISLE is just a container for the UI and it's one feature.
The merge module takes care of all the dependency detection, gating logic, laying down files, installing certificates, setting registry values and so on.
Some more details can be found at:
VSTO 4 ( 2010 ) Lessons Learned
Office 2010 Bitness Pain
Apparently the small print referenced here should have been one clue: Does InstallShield Limited Edition Support 64 bit Installer?
The current Office prerequisite in Installshield is also misleadingly worded. It should really be "Office 2010 Home & Professional 32 bit".
Perhaps they intend to upgrade it over time to be comprehensive or perhaps everyone has to go through the same hassle to fix it for a few cases they care about. The support guy claimed there are too many GUIDS for all the combinations of versions, bitness, releases etc.
Home & Student, Home & Professional, Professional, Office 2010 Professional Plus License
32bit, 64bit, Languages mangled in there, Service Packs, etc. Depending on the set you care about the number of GUIDS is rather large.

Visual Studio 11 Setup Projects

According to Microsoft Visual Studio will no longer support setup projects, requiring instead that developers download and register for a light version of InstallShield.
Does anyone know if there are alternatives out there - WiX comes to mind but in a way this is like going assembly...
Wix. it is not like assembly, it wrocks - especially compared to installshield.
Otherwise no - before Wix came around installers where a bad area to be in anyway. Only buggy products, choose your pain between Installshield and Wise installer (now Symantec Altiris).
I prefer Wix any day over the other stuff.

Resources