none
Running a .net Application from a USB drive RRS feed

  • Question

  • Hi ,

    is it possible to run a .Net C# application from a removable drive (USB) and to include SQL Express/Lite  with it.  So that all required files are on the usb and no install is required on the workstation?  This article Portable App came out over 10 years ago and although it starts out positively the aim was never achieved.

    I was wondering if in the 12 years since it was published there had been sufficient improvements to enable a fully functioning .Net portable application to be possible ?  I know it can be achieved using other development languages.

    Erick

    Monday, November 18, 2019 7:17 AM

All replies

  • is it possible to run a .Net C# application from a removable drive (USB) and to include SQL Express/Lite  with it

    Not with SqlExpress. It requires installation on the machine where the program runs.

    On the other hand, SQLite is doable. It's just a set of libraries that you can include in your application's binaries folder.

    However, you will find another problem: if your application is programmed using the .NET Framework, you need the Framework to be installed on the target PC. That's usually not much of a problem; all "modern" Windows include a pre-installed version of the Framework. But you cannot trust it to be the "latest and greatest" version. You'll have to program to the lowest common denominator, which in practice usually means configuring your Visual Studio to generate code for the Framework 2.0, depending on which versions of Windows you need to support.

    If you want something that is completely self-contained and doesn't require an installed version of the Framework, then you will have to move to .Net Core. Latest versions of Core allow you to prepare a complete application that include all necessary libraries. Note, however, that Core does not support al the same functions that are provided by the Framework. You will need to adapt your program to this environment.

    Monday, November 18, 2019 10:55 AM
    Moderator
  • Thanks for that.

    So reiterating. It can be done with .net core and sqlLite ?

    I haven't done much work with .net core. 

    Does it include the Entity framework libraries ? 

    I didn't think .net core allows windows forms type GUI.

    Even though my application is in three tiers and I could possibly create the Data layer and business Layer as .net core class libraries, I would still need to write the GUI.  And even I use Winforms in just that part it will mean I would still need .net Framework libraries installed on the workstation.

    regards

    Erick

    Monday, November 18, 2019 10:39 PM
  • Does it include the Entity framework libraries ? 

    Not the same ones. You need to use Entity Framework Core.

    I didn't think .net core allows windows forms type GUI.

    Not in the first versions, but the latest one does allow WinForms and WPF (only on Windows machines, these type applications are not portable to other environments such as Linux or Mac).

    Tuesday, November 19, 2019 7:55 AM
    Moderator