none
Changing from .NET 2 framework to 4 gotchas...

    Question

  • Hi all,

    I am having a problem running my vb.net application in the 2010 design environment on a 64 bit computer. So far the only solution I have found is to change from the .net 2 framework to 4. Some details about that are in this thread:

    http://social.msdn.microsoft.com/Forums/vstudio/en-US/b0516e8e-fbaa-4515-b808-3f62eb0086d8/not-valid-win32-app-error-vs-2010-move-project-from-32-bit-to-64bit-system-imagelist-bug?forum=vbgeneral

    So now I am debating the consequences of changing to .net 4. I have thousands of customers using my software. I am concerned if the .MSI setup for my project will do well installing the .net 4 framework as a prerequisite. If it is set as a prerequisite in my setup project I guess it should work? When I do my next update the customers system should get updated as required to .net 4? In my updates I distribute a new setup.exe and .msi for the full app. Just wondering if anyone has experience with this?

    Any other things to worry about?

    I also see that .net 4 redistributable will install on XP SP3 systems, but sometimes XP is not mentioned. .Net 4 does work on XP SP3 right? How do I make sure it is SP3? Just tell the customer? The setup will not do this sp3 update? What happens if it is not XP sp3, setup throws error, blows up something in <st1:place w:st="on">Africa</st1:place>, or what?

    My app now works on windows 98 with the .net 2 framework installed. I guess if I go to .net 4 I have to require XP and above?

    Or if I could get the .net 2 framework to run properly on 64 bit IDE I would not change but that is back to the original problem of not valid 32bit app in my above thread. Anyone have any other info on using .net 2 framework in the vs 2010 design environment (including using directx 9c) beyond the old thread above? Or maybe I just have to stick to using my 32 bit computer to avoid unknown gotchas once it goes out to thousands of customers?

    Advice?

    Thanks,

    Tom

    Sunday, November 17, 2013 4:52 PM

Answers

All replies

  • Tom,

    Is there anything in your program where you're using things exclusive to Framework 4.0 (as in, that can't be compiled as 3.5)? That would resolve a lot of this if you use 3.5 instead.


    Please call me Frank :)

    Sunday, November 17, 2013 7:26 PM
  • Tom,

    Is there anything in your program where you're using things exclusive to Framework 4.0 (as in, that can't be compiled as 3.5)? That would resolve a lot of this if you use 3.5 instead.


    Please call me Frank :)

    Hi Frank,

    No, I have no reason to use anything other than .net 2 other than I am just trying to run my code in VS 2010 on my 64 bit system. And maybe future systems. And maybe vs 2013 and beyond. I can compile on my 32 bit system and my compiled app installs and runs fine on all systems 98 and above, 32/64 bit systems (I target x86 32 bit). My code was 2005, and earlier. The only problem is just the code wont run in vs 2010 on my 64 bit pc when using .net 2 because I get a not valid win 32 app error. In fact this error appears related to using the imagelist control as I described in my other thread because I can manually edit a number in the form.resx file imagelist junk and then it runs in vs2010.

    What will .net 3.5 avoid that I might encounter with .net 4? My main concern, which may not be founded, is just updating my existing users systems with the newer framework, and app? Is .net 3.5 part of windows 7 and above, like .net 2? I can look that up I guess I don't remember right now.

    I did not try .net 3.5 to avoid the error but can easily try it. I still have the same concerns I guess? Or do I? And on and on...

    Thanks,

    Tom

    Sunday, November 17, 2013 8:46 PM
  • Well, if you compile it as 3.5, it's more likely to be compatible with older systems. Prior to XP though, that I don't know.

    It won't hurt to try! :)


    Please call me Frank :)

    Sunday, November 17, 2013 8:50 PM
  • No, I have no reason to use anything other than .net 2 other than I am just trying to run my code in VS 2010 on my 64 bit system. And maybe future systems. And maybe vs 2013 and beyond.

    In fact, I guess I would like to upgrade my code/app to VS 2013 and .net 3.5 or 4. I am just trying to see if there are any unknown pitfalls to doing that at this time. I assume my code will upgrade easily, going from 2005 to 2010 was no problem (other than I cant seem to run on 64 bit IDE). Oh yes, I guess I would be dragging directx 9c along, as it seems the newer versions use XNA instead of whatever managed stuff directx 9c is. I would update to directx 11 or whatever as well if it is easy.

    :)

    Sunday, November 17, 2013 9:07 PM
  • Well, if you compile it as 3.5, it's more likely to be compatible with older systems. Prior to XP though, that I don't know.

    It won't hurt to try! :)


    Please call me Frank :)

    Yeah. I don't mind loosing the 98 and starting my requirements with XP. But I still have many customers using XP. It seems that .net 4 works on XP with SP3? Or is it problematic? As you know I don't have much experience with it. Is the difference in the SP3 (between .net 3.5 and 4 on XP).

    Sunday, November 17, 2013 9:13 PM
  • Yeah. I don't mind loosing the 98 and starting my requirements with XP. But I still have many customers using XP. It seems that .net 4 works on XP with SP3? Or is it problematic? As you know I don't have much experience with it. Is the difference in the SP3 (between .net 3.5 and 4 on XP).

    I use XP - and on occassion, VS2010 (Framework 4.0).

    I feel sure that if they don't have SP3, that the framework won't install for them, so that alone would be an indicator.


    Please call me Frank :)

    Sunday, November 17, 2013 9:17 PM
  • Yeah. I don't mind loosing the 98 and starting my requirements with XP. But I still have many customers using XP. It seems that .net 4 works on XP with SP3? Or is it problematic? As you know I don't have much experience with it. Is the difference in the SP3 (between .net 3.5 and 4 on XP).

    I use XP - and on occassion, VS2010 (Framework 4.0).

    I feel sure that if they don't have SP3, that the framework won't install for them, so that alone would be an indicator.


    Please call me Frank :)

    I see. Well that is good to know and what I am trying to find out. I have XP systems here as well. In fact just moved to win 7 within the last few years. Now my no. 1 computer is 64 bit though.

    So just to clarify, you feel the .net 3.5 wont install without XP sp3 as well?

    And then, my next question becomes, how do I deal with XP and the service pack 3 requirement? I mean it appears there is no way to have my setup project made in VS check for the service pack and install it if needed? Maybe the setup could check for it and if it is not installed give a message and exit gracefully? Or even install it somehow?

    And then moving on, do you know if directx 11 runs on XP? Again I can look it up but...

    Sunday, November 17, 2013 9:27 PM
  • If the OS doesn't have proper requirements, it won't install any framework which requires is - so that's really nothing to worry about as they'll be advised of that when they try to install it.

    As for 64-bit though, if you know that some of these will go to XP users, either compile as x86 only, or have two versions, 32-bit and 64-bit. That said though, any sort of assemblies included (like DirectX) need to be compatible with 32/64, so you can't mix and match those.

    Beyond that, I don't know the answer about DirectX Version 11, sorry.


    Please call me Frank :)

    Sunday, November 17, 2013 9:30 PM
  • If the OS doesn't have proper requirements, it won't install any framework which requires is - so that's really nothing to worry about as they'll be advised of that when they try to install it.

    As for 64-bit though, if you know that some of these will go to XP users, either compile as x86 only, or have two versions, 32-bit and 64-bit. That said though, any sort of assemblies included (like DirectX) need to be compatible with 32/64, so you can't mix and match those.

    Beyond that, I don't know the answer about DirectX Version 11, sorry.


    Please call me Frank :)

    Ok thanks. I am just trying to plan ahead. My setup built from 2005 was not very good about requirements, I mean it would just throw a weird cant install error and you had to look in a log file just to find out the problem was my app was already on the system. The installer made in 2010 seems to do a little better.

    This part of software is so fun. In fact I seem to do mostly this stuff and not much programming. After going through the upgrade from VB6 to .net, like rewriting almost every line of code I get a little paranoid. Of course you young bucks have it easy these days.

    Thanks again,

    Tom

    Sunday, November 17, 2013 10:06 PM
  • Ok thanks. I am just trying to plan ahead. My setup built from 2005 was not very good about requirements, I mean it would just throw a weird cant install error and you had to look in a log file just to find out the problem was my app was already on the system. The installer made in 2010 seems to do a little better.

    I can't say that I know anything about the built-in installer as I use a third-party one that's always worked well for me.

    This part of software is so fun. In fact I seem to do mostly this stuff and not much programming. After going through the upgrade from VB6 to .net, like rewriting almost every line of code I get a little paranoid. Of course you young bucks have it easy these days.

    I ain't so young these days. ;-)


    Please call me Frank :)

    Sunday, November 17, 2013 10:10 PM
  • Well, if you compile it as 3.5, it's more likely to be compatible with older systems. Prior to XP though, that I don't know.

    It won't hurt to try! :)


    Please call me Frank :)

    If I use the .net 3.5 framework then I get the not valid win32 app error running my project in VS 2010 64 bit win 7 (same as with .net 2). Switching it to .net 4 makes the error go away. The ImageList bug in the form.resx file must be fixed or avoided in .net 4 I guess?

    Tom

    Monday, November 18, 2013 4:15 AM
  • Well, if you compile it as 3.5, it's more likely to be compatible with older systems. Prior to XP though, that I don't know.

    It won't hurt to try! :)


    Please call me Frank :)

    If I use the .net 3.5 framework then I get the not valid win32 app error running my project in VS 2010 64 bit win 7 (same as with .net 2). Switching it to .net 4 makes the error go away. The ImageList bug in the form.resx file must be fixed or avoided in .net 4 I guess?

    Tom

    Just to follow up for anyone watching. I made a new project form using .net 2 framework in vs 2010 win7 64 bit with a few controls and an ImageList control, put some images in the image list (.bmp about 24x24 256 color) and VS give the error "not a valid win32 application" when I run the app. If I change to .net 4 the error goes away.

    Monday, November 18, 2013 4:45 AM
  • If I use the .net 3.5 framework then I get the not valid win32 app error running my project in VS 2010 64 bit win 7 (same as with .net 2). Switching it to .net 4 makes the error go away. The ImageList bug in the form.resx file must be fixed or avoided in .net 4 I guess?

    If it's to be run on XP, or any 32-bit OS, it needs to be set to compile using X86, or it simply won't run.


    Please call me Frank :)

    Monday, November 18, 2013 6:40 PM
  • If I use the .net 3.5 framework then I get the not valid win32 app error running my project in VS 2010 64 bit win 7 (same as with .net 2). Switching it to .net 4 makes the error go away. The ImageList bug in the form.resx file must be fixed or avoided in .net 4 I guess?

    If it's to be run on XP, or any 32-bit OS, it needs to be set to compile using X86, or it simply won't run.


    Please call me Frank :)

    Yes that's right. I am set on x86 32bit. I am 95% sure about this bug with the ImageList. I had read pieces of it a couple places that I reference in my other threads (ref above) and that's why I was looking at it specifically. I am duplicating it in a new project with a single empty form. It runs in .net 3.5 and when I add the ImageList control with some images the error starts using .NET 3.5 and then switch to 4 it goes away. No other variables. x86 etc. I am sure anyone can produce it.

    Anyway. I am done with it and I am proceeding with my big project again in .NET 4 on my no. 1 64 bit pc and I am debating VS 2013. Up up and away!

    Thanks for helping,

    Tom

    Monday, November 18, 2013 7:21 PM
  • Keep your application 32 bits, framework 2

    When installing (Specially installing on Windows8 or 8.1) check if the computer has the Framework 4 or above installed.

    If it does, add this file in the application directory:

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
       <startup>
          <supportedRuntime version="v4.0"/>
       </startup>
    </configuration>

    And name the file:

          MyApplicationName.exe.config


    (If you already have a config file, add the startup tag in it)

    ---------

    Just a trick that is good to know ...

    on Windows8 or 8.1, if the Framework get upgraded, you will lose the framework 1.0.

    The documentation will tell you that it is impossible to reinstall it (I tried and it is true)

    But using that same method, you will be able to run an app made from framework 1 on windows 8 or 8.1 without the framework 1 installed

    I ran into that exact problem today !! and this solved it


    Tuesday, November 19, 2013 12:52 AM
    • Marked as answer by tommytwotrain Wednesday, November 27, 2013 3:50 PM
    Wednesday, November 27, 2013 1:59 AM