Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 339
  • Last Modified:

unable to run a c# program

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:
http://img.photobucket.com/albums/v462/unsolvedenigma/work/error3.bmp


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.
0
chinese_bunny
Asked:
chinese_bunny
3 Solutions
 
YurichCommented:
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.

regards
0
 
AgariciCommented:
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

hth,
A.
0
 
chinese_bunnyAuthor Commented:
now im using another computer which actually has .net
this is the new error message
http://img.photobucket.com/albums/v462/unsolvedenigma/work/error4.bmp

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

namespace Light1
{
      class Class1
      {
            /// <summary>
            /// The main entry point for the application.
            /// </summary>
            [STAThread]
            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
0
 
Razzie_Commented:
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.
0
 
chinese_bunnyAuthor Commented:
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
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now