Results 1 to 6 of 6

Thread: Questions About .Net and Portability

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2018

    Questions About .Net and Portability

    Ever since they came out with VB .Net I have always wondered why (coming from VB4-6) that they now require this .net framework? I always enjoyed the portability of Visual Basic before .net framework came out. The fact that you could just make an exe and include the necessary dependency files in the program directory and boom it just works was a major plus to me rather than always requiring an installer. Don't get me wrong installers are nice but some times I just want to make a portable application instead. So my questions are:

    1: Can I make an application that does not require an installer? If so how can I achieve this? Besides the obvious required files, how do I know what it requires?

    2: Will the application absolutely require the .net framework? Is it possible to make an application that does not require the framework like previous visual basic versions or is that just impossible?

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Bristol, UK

    Re: Questions About .Net and Portability

    VB 6 etc required an equivalent of the .Net framework (known as the VB Runtime), but that was much smaller because it offered far less functionality.

    Due to the stability of VB6 (and the small size of the runtime) the runtime was pre-installed on several versions of Windows (including XP etc)... but it is still available separately here: https://support.microsoft.com/en-us/...run-time-files

    When it comes to .Net, the framework is pre-installed, but different versions of Windows have different versions of the framework installed. Here is a post in another thread from earlier today:
    Quote Originally Posted by jmcilhinney View Post
    How old did you go? Note that Windows 10 (more recent versions, at least) have .NET 4.x installed by default but not .NET 3.5 (which includes 3.0 and 2.0) so it will not be a safe assumption that all users will have a .NET version earlier than 4.0 installed. Older versions of Windows will have .NET 3.5 installed by default but not 4.x, so 4.0 or later is not a safe assumption either. Older versions still may not have any .NET version installed by default. Unless you know that your users will always have a specific version installed, you should create an installer for your app that checks for and installs the version you require as part of the application installation.
    Note that in recent versions of Visual Studio you can choose which framework your project uses, so you can pick one that is appropriate for the version of Windows you are targeting... but if you want to support multiple versions of Windows, you may need to compile multiple copies of your program.

  3. #3
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002

    Re: Questions About .Net and Portability

    Also, there is, or will be a way to create a .NET program free of the framework, which is done by building the framework functionality into the program during compilation. I have never used this, but here's a link on it:

    My usual boring signature: Nothing

  4. #4
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Sydney, Australia

    Re: Questions About .Net and Portability

    Quote Originally Posted by Shaggy Hiker View Post
    Also, there is, or will be a way to create a .NET program free of the framework, which is done by building the framework functionality into the program during compilation. I have never used this, but here's a link on it:

    I haven't read extensively about .NET Native but I think that it only applies to UWP apps and not older technologies like Console apps, Windows Forms or even WPF. It's a couple of years old now but see the accepted answer here.

  5. #5
    Fanatic Member
    Join Date
    Feb 2003

    Re: Questions About .Net and Portability

    As far as I know you can just copy the executable from your project's .\bin folder from computer to computer. This shouldn't be a problem as long as the program uses a version of the framework typically found on any fairly up to date Windows installation.

  6. #6
    You don't want to know.
    Join Date
    Aug 2010

    Re: Questions About .Net and Portability

    The dream of .NET compatibility is supposed to be an "xcopy install". In that kind of installation, you can just copy your bin folder to another machine and you're done. This works, for the most part, if you and your clients use relatively modern Windows and stay up-to-date with installations.

    Compatibility has been better since about the .NET 4.0 era, and in general unless you try to use very new features you can make small tweaks to tell Windows to run your app on older .NET Frameworks and it just works. The story going forward will be even better, as apps that depend on .NET Standard instead of the framework will be more widely compatible forever. (Defining what forwards and backwards compatibility means is part of .NET Standard.)

    But enterprises seem to be mishmashes and take pride in how many days they've run a machine since a Windows update. So if you're targeting a wide range of machines, you have to use a spreadsheet to figure out which .NET Framework version you can target and it will undoubtedly involve some installs somewhere.

    The ".NET Native" thing that embeds the framework with your app is, as previously mentioned, only available to UWP apps. Microsoft has spent a lot of effort the last 10 years being increasingly less subtle about "this is what you should be using". Developers are either ignoring it or have reason to believe UWP isn't adequate. This is a bit of a vicious cycle: since no one uses UWP, they don't have feedback, so MS can't figure out what's missing from UWP, and so on.

    If you want to make a portable app with easy deployment and no runtime dependencies, the current best places to look are Node/HTML frameworks like Electron and Cordova. Bonus: they also run on MacOS and Linux, and with effort you can get them on iOS and Android.
    This answer is wrong. You should be using TableAdapter and Dictionaries instead.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts


Click Here to Expand Forum to Full Width