The new forums will be named Coin Return (based on the most recent vote)! You can check on the status and timeline of the transition to the new forums here.
The Guiding Principles and New Rules document is now in effect.

Visual Studio question

localh77localh77 Registered User regular
edited February 2007 in Help / Advice Forum
This is probably an easy question, but I just can't seem to figure it out.

I have Visual Studio .NET at work, and Visual Studio 2005 at home, and a C# windows application I wrote that compiles and runs on either. When I build it at home, though, and then try to run the .exe at work, it gives an error message (something about needing some Visual Studio resource, I can't remember exactly).

Isn't there a way to build the project so that the .exe will run on any computer (any windows computer, that is), even one that doesn't have Visual Studio at all? I've tried looking in the project settings, but the only thing I can think of to try is building in release mode instead of debug mode, which doesn't seem to make a difference.

I'll try building it at work and then running it at home tonight, but even if it works, I'm still curious why it wouldn't work the other way.

localh77 on

Posts

  • RuckusRuckus Registered User regular
    edited February 2007
    Does your work computer have .NET 1.1 or 2 installed?

    Ruckus on
  • Eggplant WizardEggplant Wizard Little Rock, ARRegistered User regular
    edited February 2007
    I had a similar situation. I had an older .NET app that was built with Visual Studio .NET 2003. I got a new PC at work, and I was going to install the latest and greatest Visual Studio when the time came for me to modify the app. I was advised not to do this by a Microsoft-loving coworker, because the server on which the app was deployed only has an older version of the runtime. I figured that you could just set a flag somewhere that would instruct Visual Studio to compile for an older runtime target, but my friend insisted that this isn't possible. I don't get it, but I'm not going to expend too many brain cycles worrying about it. I just installed VS .NET 2003 and used that to implement the changes.

    Eggplant Wizard on
    Hello
  • localh77localh77 Registered User regular
    edited February 2007
    Ruckus wrote:
    Does your work computer have .NET 1.1 or 2 installed?

    It says .NET Framework 1.0

    localh77 on
  • localh77localh77 Registered User regular
    edited February 2007
    I had a similar situation. I had an older .NET app that was built with Visual Studio .NET 2003. I got a new PC at work, and I was going to install the latest and greatest Visual Studio when the time came for me to modify the app. I was advised not to do this by a Microsoft-loving coworker, because the server on which the app was deployed only has an older version of the runtime. I figured that you could just set a flag somewhere that would instruct Visual Studio to compile for an older runtime target, but my friend insisted that this isn't possible. I don't get it, but I'm not going to expend too many brain cycles worrying about it. I just installed VS .NET 2003 and used that to implement the changes.

    I think that's what's so annoying. That should work, and it feels like it should, but I don't know for sure that it does. It just seems like I should be able to build an app that can run on a computer without visual studio.

    localh77 on
  • CronusCronus Registered User regular
    edited February 2007
    localh77 wrote:
    I had a similar situation. I had an older .NET app that was built with Visual Studio .NET 2003. I got a new PC at work, and I was going to install the latest and greatest Visual Studio when the time came for me to modify the app. I was advised not to do this by a Microsoft-loving coworker, because the server on which the app was deployed only has an older version of the runtime. I figured that you could just set a flag somewhere that would instruct Visual Studio to compile for an older runtime target, but my friend insisted that this isn't possible. I don't get it, but I'm not going to expend too many brain cycles worrying about it. I just installed VS .NET 2003 and used that to implement the changes.

    I think that's what's so annoying. That should work, and it feels like it should, but I don't know for sure that it does. It just seems like I should be able to build an app that can run on a computer without visual studio.

    I've had this happen with a game I made when I didn't include a .dll in the install that is on computers with Studio and I hadn't tested it on any non development machines. I'm not sure how to compile everything into one .exe, but perhaps someone else here or someone on google groups does.

    The only other advice I can give you if none of the above help is to make sure that your target platform is Any CPU in the build options.

    Cronus on
    camo_sig.png
    "Read twice, post once. It's almost like 'measure twice, cut once' only with reading." - MetaverseNomad
  • localh77localh77 Registered User regular
    edited February 2007
    Cronus wrote:
    The only other advice I can give you if none of the above help is to make sure that your target platform is Any CPU in the build options.

    Good call, I didn't notice that before, but I'll have to try that, thanks.

    localh77 on
  • ffordefforde Registered User regular
    edited February 2007
    localh77 wrote:
    Ruckus wrote:
    Does your work computer have .NET 1.1 or 2 installed?

    It says .NET Framework 1.0
    My first guess is you need the 2.0 Framework installed.

    fforde on
  • localh77localh77 Registered User regular
    edited February 2007
    fforde wrote:
    localh77 wrote:
    Ruckus wrote:
    Does your work computer have .NET 1.1 or 2 installed?

    It says .NET Framework 1.0
    My first guess is you need the 2.0 Framework installed.

    Installed on which computer?

    localh77 on
  • dsplaisteddsplaisted Registered User regular
    edited February 2007
    localh77 wrote:
    fforde wrote:
    localh77 wrote:
    Ruckus wrote:
    Does your work computer have .NET 1.1 or 2 installed?

    It says .NET Framework 1.0
    My first guess is you need the 2.0 Framework installed.

    Installed on which computer?

    You need the .NET 2.0 Framework installed on the computer that does not have Visual Studio 2005.

    dsplaisted on
    2850-1.png
  • ffordefforde Registered User regular
    edited February 2007
    dsplaisted wrote:
    localh77 wrote:
    fforde wrote:
    localh77 wrote:
    Ruckus wrote:
    Does your work computer have .NET 1.1 or 2 installed?

    It says .NET Framework 1.0
    My first guess is you need the 2.0 Framework installed.

    Installed on which computer?

    You need the .NET 2.0 Framework installed on the computer that does not have Visual Studio 2005.

    It is an optional download on the Windows Update site. FYI.

    fforde on
  • localh77localh77 Registered User regular
    edited February 2007
    Cool, thanks for your help :)

    localh77 on
  • blincolnblincoln Registered User regular
    edited February 2007
    The .NET Framework is what allows .NET apps to run. You can't make a .NET app that doesn't require it.

    If you want to write a program that doesn't require the framework, you need to use C++ in VS 2003 or 2005. If you use VS 6 and earlier, you can write a VB app that will also run on any Windows system. No C# in those old versions though, obviously.

    blincoln on
    Legacy of Kain: The Lost Worlds
    http://www.thelostworlds.net/
  • localh77localh77 Registered User regular
    edited February 2007
    Well, that's annoying, but it's exactly what I wanted to know - thanks!

    localh77 on
Sign In or Register to comment.