Results 1 to 7 of 7

Thread: [RESOLVED] Why does my .exe file not work on another computer ?

  1. #1

    Thread Starter
    PowerPoster Poppa Mintin's Avatar
    Join Date
    Mar 2009
    Location
    Skunthorpe, North Lincolnshire, England.
    Posts
    2,114

    Resolved [RESOLVED] Why does my .exe file not work on another computer ?

    Hi,

    I don't know what I've done wrong now !

    I've created a new Windows Forms App (.NET) [Visual Basic] [Windows] [Desktop]

    The application runs without any hitches on the Win.10 machine it was written on.
    For the past lord knows how many years I written programs on the machine which was current at the time, and just copied the .exe file to other computers and there's been no problem.

    Normally I just find the .exe file in (For example) 'D:\Visual Studio Projects\Projects\CrossWord\CrossWord\bin\Debug', I haven't used the 'bin\Release' option for several years.

    Today however I find that in the '\bin\Debug' folder there is nothing but one new folder 'net5.0-windows' and the files which are usually just in the 'Debug' folder are all in there.

    So, ok, Bluetooth the .exe file to another Win.10 machine, fine, all copied. Try to run the the app. Nothing ! it will not run. No error notices or any indication as to why it's not running.

    So... Copy the .exe file to a memory stick and try it in a Win.7 machine, never had any problem doing that. Still won't run, still no indication as to why not.

    I tried running 'Release' and did the same with the .exe file in the 'bin\Release\net5.0-windows' folder, (yes the new folder is in there too.) No difference, still no joy.
    I used the same process two weeks ago with no problem, that app. still is still working just fine.
    I don't know what to do next.

    Current machine:
    OS Microsoft Windows 10 Home. Version:10.0.19042 Build 19042
    System Type x64-based PC

    Microsoft Visual Studio Community 2019: Version 16.8.4
    VisualStudio.16.Release/16.8.4+30907.101
    Microsoft .NET Framework: Version 4.8.04084


    Poppa
    Last edited by Poppa Mintin; Mar 6th, 2021 at 10:24 AM. Reason: Typo
    Along with the sunshine there has to be a little rain sometime.

  2. #2
    Fanatic Member
    Join Date
    Aug 2004
    Location
    Essex, UK
    Posts
    682

    Re: Why does my .exe file not work on another computer ?

    Are you sure you're targeting .NET 4.8.04084 and not .NET Core? The folder name suggests .NET 5 which is .NET Core.

  3. #3

    Thread Starter
    PowerPoster Poppa Mintin's Avatar
    Join Date
    Mar 2009
    Location
    Skunthorpe, North Lincolnshire, England.
    Posts
    2,114

    Re: Why does my .exe file not work on another computer ?

    Thanks Paulg4ije,

    I think you're right, Project > Application > Target framework = .NET 5.0

    Clicking the menu, the only options are:
    .NET Core 3.1
    .NET Core 3.0
    .NET Core 5.0
    Install other frameworks.


    Clicking install... I've downloaded:
    ndp48-web.exe
    ndp48-devpack-enu.exe

    I ran 'ndp48-web.exe' which completed in two or three seconds, but I can't see what it did.

    I ran 'ndp48-devpack-enu.exe' which took maybe a minute or so, but I still can't see what that did either, certainly neither has made any difference to my Target framework options.

    I have no idea where all the .NET Core 4.x have gone, and now I can't find how to retrieve 'em.
    I thought I was using Version 4.8.04084.


    Poppa
    Along with the sunshine there has to be a little rain sometime.

  4. #4
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,729

    Re: Why does my .exe file not work on another computer ?

    You can't change a project between .Net Core and .Net Framework - if you pick the wrong one, you need to create a new project using the right one.

    Be wary of the project type you create, one that specifies "(.Net)" as part of its name will be .Net Core

  5. #5

    Thread Starter
    PowerPoster Poppa Mintin's Avatar
    Join Date
    Mar 2009
    Location
    Skunthorpe, North Lincolnshire, England.
    Posts
    2,114

    Re: Why does my .exe file not work on another computer ?

    Thanks Si,

    That's fixed it, I'm back to normal now.

    Thanks for your help too Paulg4ije.


    Poppa
    Along with the sunshine there has to be a little rain sometime.

  6. #6
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    107,648

    Re: Why does my .exe file not work on another computer ?

    Quote Originally Posted by Poppa Mintin View Post
    I have no idea where all the .NET Core 4.x have gone
    There is no .NET Core 4.x. .NET was originally .NET Framework. A while back, they introduced .NET Core, which addressed some of the shortcomings of .NET Framework but kept the good stuff. Some may disagree, but that's the theory, anyway. .NET Core was improved over a number of versions and they are now at the point where they consider .NET Core to be able to replace .NET Framework altogether. As such, v4.8 was the last version of .NET Framework that will be released and v3.1 is the last version of .NET Core that will be labeled as .NET Core. The most recent release is just .NET 5.0, with no discriminator to indicate that it's the only .NET in town. It's based on .NET Core though, so if you want to downgrade the version then you only have .NET Core versions to choose from.

    .NET 5.0 can work like the .NET Framework in that the user can install it once and those common libraries can be used by all .NET apps, or it can work like .NET Core in that you can include just the libraries it requires along with your app. The latter allows you to control what library versions your app uses but it also means that libraries will be duplicated and yours will not get automatic security updates. .NET 5.0 supports just about every type and member that .NET Framework 4.8 did so it may seem like you should just be able to switch back and forth but .NET Core was built from the ground up and every existing type and member had to be explicitly added to it, so it's not the same thing.

    As suggested, you need to actually look at what project type you're creating to make sure that is what you want. You can certainly create .NET 5.0 apps and deploy them but if your users don't have .NET 5.0 installed then you will need to deploy all the libraries it relies on along with the app. If you want to deploy just an EXE then, for the time being, stick to .NET Framework.

  7. #7

    Thread Starter
    PowerPoster Poppa Mintin's Avatar
    Join Date
    Mar 2009
    Location
    Skunthorpe, North Lincolnshire, England.
    Posts
    2,114

    Re: [RESOLVED] Why does my .exe file not work on another computer ?

    Ah ok, Thanks John.

    At the time I wrote that, I had to rely on memory for the .NET version, being both ancient and in a hurry to get the question asked, I more or less just copied what I could see.

    I hope I've learned the lesson WRT new projects.

    Does .NET 5.0 finally get rid of that pesky default instances problem that I have ?


    Poppa
    Along with the sunshine there has to be a little rain sometime.

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