Я создаю простое приложение Windows Forms.
Это очень просто, на моем ПК с Windows работает без проблем.
Если я пытаюсь скопировать .exe и.Файл pdb на моем устройстве Windows Ce и попытаться запустить его, я получаю эту ошибку:
File or assembly name
'System.windows.forms, Version= 2.0.0.0, Culture=neutral, PublickKeyToke= ..... or one of its dependecies, was not found.
Мое приложение имеет два простых текстовых поля и записывает текст в файл .txt.Это код Form1.cs:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Text;
using System.Windows.Forms;
namespace EasyManagementOrdine
{
public partial class Form1 : Form
{
private const string FILE_NAME = "ESPORTAZIONE.txt";
public List<string> listaString = new List<string>();
public StreamWriter sw;
public Form1()
{
try
{
InitializeComponent();
if (File.Exists("ESPORTAZIONE.txt"))
{
File.Delete("ESPORTAZIONE.txt");
}
this.sw = File.CreateText("ESPORTAZIONE.txt");
//this.textQuantita.KeyPress.(new KeyPressEventHandler(this, CheckEnter));
this.textCodiceBarre.Focus();
}
catch(Exception e)
{
}
}
private void codiceBarreEnter(object sender, KeyPressEventArgs e)
{
try
{
if (e.KeyChar == '\r')
{
if ((!this.textCodiceBarre.Focused ? false : this.textCodiceBarre.Text.Length > 0))
{
this.textQuantita.Focus();
}
}
}
catch (Exception exception)
{
Exception ex = exception;
MessageBox.Show(string.Concat("Errore: ", ex.Message));
}
}
private void quantitaEnter(object sender, KeyPressEventArgs e)
{
try
{
if (e.KeyChar == '\r')
{
if ((!this.textQuantita.Focused ? false : this.textQuantita.Text.Length > 0))
{
this.salvaQuantita();
}
}
}
catch (Exception exception)
{
Exception ex = exception;
MessageBox.Show(string.Concat("Errore: ", ex.Message));
}
}
private void salvaQuantita()
{
try
{
int numeroQuantita = int.Parse(this.textQuantita.Text);
string nuovaStringa = string.Concat(this.textCodiceBarre.Text, " && ", numeroQuantita);
this.sw.WriteLine(nuovaStringa);
this.textCodiceBarre.Text = "";
this.textQuantita.Text = "";
this.textCodiceBarre.Focus();
}
catch (Exception exception)
{
Exception e = exception;
MessageBox.Show(string.Concat("Errore: ", e.Message));
}
}
private void buttonOrdine_Click(object sender, EventArgs e)
{
try
{
this.sw.Close();
MessageBox.Show("Il file ESPORTAZIONE.txt è statp creato.", "Complimenti");
}
catch (Exception exception)
{
Exception ex = exception;
MessageBox.Show(string.Concat("Errore: ", ex.Message));
}
}
private void button1_Click(object sender, EventArgs e)
{
try
{
Environment.Exit(0);
}
catch (Exception exception)
{
String process = Process.GetCurrentProcess().ProcessName;
Process.Start("cmd.exe", "/c taskkill /F /IM " + process + ".exe /T");
Exception ex = exception;
MessageBox.Show(string.Concat("Errore: ", ex.Message));
}
}
}
}
В чем проблема?