After much pain and suffering , I finally found some info on porting apps from previous versions of MSVC to the current .NET 2005.
Many of the articles failed to address the main issue which is an incorrect build environment. I falsely assumed that clicking on the old MSVC 6 IDE file and allowing 2005 to convert it would work.
However, this does not work. Follow these steps and you should be ok.
First define this in your C/C++ pre-processor settings to ensure you don't get complaints from the MS gods about the C/C++ standard library functions being deprecated. They are attempting to force you to use their own custom versions of the self-same files that, probably, only run better on Windows and have next to nothing to do with pure C/C++.
To get rid of all that deprecated crap define: _CRT_SECURE_NO_DEPRECATE
This essentially will get your compiler environment back to normal and out of what Bill thinks is best mode. We all know Bill doesn't always know what's best nor do his cronies.
In order to ensure a successful port I recommend doing the following:
- Clean your old project folder up and remove all non-essential elements like folders containing non-resource bitmaps, data, etc. All non-build related files and folders should be removed.
- Select File->New->Project from existing code.
- Follow the rest of the dialogs and respond according to what support you need. Be careful of the files you add because if your project folder has a lot of non-essential items it will all be added to the project.
- Now manually copy back all the folders and data that your app needs to run, but doesn't need to build.
- Add your directories (C/C++ tree), library dependencies (Linker tree), defines, etc, etc.
- Ensure your manifest is being generated by selecting manifest from the Linker tree in project properties. My manifest was not being generated correctly because of what was on this line.
- Now copy the correct DLLs from your VisualStudio/Redist folder. If you are using the debug DLLs, use the debug_noRedist folder. Copy the DLLs from those folders (if you need both crt and mfc) into your application folder.
This should create a valid project that should run with no problem.
The manifest created should work as generated. I did all of this and finally after about a day of messing with 2005, my editor application now works correctly and calls out correctly to my DirectX engine DLL.
There are other ways to do this, but so far this seems to be the easiest. I don't like having multiple copies of all these dlls every time I create a project, but the other methods are just a giant mess. Porting, any way you slice it, is an exercise in frustration and get's worse when you are using DLLs and porting them as well. So far I've had to re-build the DLLs inside of MSVC 2005 in order to get them to work correctly. This is directly stated in the documentation. You MUST rebuild any DLLs or LIBs inside of 2005 if your 2005 application depends on them. You can use the depends.exe utility in the bin folder of your visualstudio/vc folder.
The STL in 2005 will also still complain about DLL-interfaces when using any of it's classes. There are several documents on the web about this, but based on my research these warnings are simply an annoyance. There are work-arounds but all have drawbacks and side-effects. I would simply use #pragma to turn this warning off. Note that there are times when this warning will lead to a build error so shutting it off may suppress vital information, but only in certain cases.
You can build your project without using CLR or the common language runtime by specifying this in the project properties. There is a combo box in Project properties->Configuration->General->Common Language Runtime Support. This should keep you in the world of ISO C/C++ rather than MS's bloated extensions to C++.
This has been a major headache and I pity the poor fella out there that has to port thousands of lines or even millions of lines of code to .NET 2005.
In order to deploy this application correctly I recommend following the guidelines and examples provided in the help file under Setup and Deployment. The famous MSVCRT.DLL is no longer used by MSVC and is now considered a system level dll that only the operating system will use. Don't ask me why.
I'm not totally impressed with 2005's IDE and it seems they've taken all the good things from 6.0 out and replaced them with completely assinine methods of doing the same operation. I can't wait to try to distribute my tools and game code to my dev team. That's a disaster just waiting to happen right now.