unable to run a c# program

Posted on 2005-04-13
Last Modified: 2010-04-16
hi, i've got the .net framework 1.1 on my computer, and i'm trying to run an executable written in c#.
but i keep getting this error:

This is a program that was built on another computer...i dont know if that makes a difference or not.
Any help would be greatly appreciated.
Question by:chinese_bunny
    LVL 21

    Assisted Solution

    have you tried to run this program on another machine, probably without .net framework installed, and is it workable program at all - has anyone run it before? can you get a source for it? - in this case you could probablly debug and find the error.

    the version of framework it's been built in doesn't matter - if i use 1.0 and created .exe file it will run just fine on any other machine that has dotnexfx installed.

    The error shown might be related to multithread usage and in some cases, multipletrheading can be cpu-specific, though doesn't happen that often.

    LVL 11

    Accepted Solution

    this kind of error usually apears when your exe does not find all its dependencies

    so you should check what dll loads your exe on the development machine and you dont have on the test macine


    Author Comment

    now im using another computer which actually has .net
    this is the new error message

    This is the source code:
    using System;
    using OpenNETCF.IO.Ports;

    namespace Light1
          class Class1
                /// <summary>
                /// The main entry point for the application.
                /// </summary>
                static void Main(string[] args)
                      byte[] Light1 = new byte [1];                                          // Light1 can only hold 1 byte
                      Light1[0] = 127;                                                                  // Light1 = 10101010 = 1;

                      SerialPort SerialPortCom = new SerialPort("COM6");            // Communicate on Port 6

                      SerialPortCom.BaudRate = 9600;                                          // Default value for now!! Can always be changed.

                      SerialPortCom.Open();                                                      // Open the serial port connection

                      SerialPortCom.Write(Light1, 0, 1);            // Just send 1 byte of data to the output
                                                                                  // The byte I'm sending is from byte array Light1, starting from
                                                                                  // Light1[0] & its just 1 byte

                      System.Threading.Thread.Sleep(100);            // Just to make sure that data is sent to the microcntroller
                                                                                  // Without this blocking function, the executable sometimes closes
                                                                                  // before the microcontroller receive the byte!!!!

                      SerialPortCom.Close();                                                      // Close the serial port connection

    I just want to send a byte over the serial.  It's set up as COM6
    LVL 8

    Assisted Solution

    I think it can't find the Serial port on that computer, can you check if that is the problem? Since it is a System.IO.FileNotFoundException and I can't see anything else that could cause this.

    Author Comment

    it was the .dll & mt serial was set up as com1 & afterwards i changed it to com6 and it worked...
    so pretty stupid on my part.
    thank you for all the input

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    Suggested Solutions

    Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
    This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now