SP2 and PPC 2003 Emulator - Error when starting app.

P

PeterB

Do you need to change references in VS .NET 2003 after installing CF SP2?

I have installed PPC 2003 sdk and started to debug with emulator, something
that worked fine. Then I installed the CompactFramework SP2 on the emulator
by copying "netcf.all.wce4.X86.cab" to the emulator and ran it (correct
file??). Now I get this error when trying to start my application:

An unhandled exception of type 'System.TypeLoadException' occurred in
myApp.exe

Additional information:
Additional information: "Couldn't read the type" System.Drawing.Bitmap "from
the collection" System.Drawing, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=B03F5F7F11D50A3A.

I have a breakpoint on InitializeComponent() in the startform and I don't
even reach this point.

What to do?
 
A

Alex Feinman [MVP]

Try resetting the emulator. If soft reset does not work, do a cold reset and
reinstall SP2
 
P

PeterB

I still get the same error. I made a small testproject that imports my dll
and it worked without the SP2 installed, but when I install SP2 I get the
same error.

I guess I should overwrite the files that I am prompted about when I install
the SP2 right?

'TestProj.exe': Loaded 'D:\source
code\PocketPC\SIBesiktningPPC\TestProj\bin\Debug\mscorlib.dll', No symbols
loaded.
'TestProj.exe': Loaded 'D:\source
code\PocketPC\SIBesiktningPPC\TestProj\bin\Debug\TestProj.exe', Symbols
loaded.
'TestProj.exe': Loaded 'D:\source
code\PocketPC\SIBesiktningPPC\TestProj\bin\Debug\SIBUtils.dll', Symbols
loaded.
'TestProj.exe': Loaded 'D:\source
code\PocketPC\SIBesiktningPPC\TestProj\bin\Debug\System.Windows.Forms.DataGr
id.dll', No symbols loaded.
'TestProj.exe': Loaded 'D:\source
code\PocketPC\SIBesiktningPPC\TestProj\bin\Debug\System.Drawing.dll', No
symbols loaded.
'TestProj.exe': Loaded 'D:\source
code\PocketPC\SIBesiktningPPC\TestProj\bin\Debug\System.dll', No symbols
loaded.
'TestProj.exe': Loaded 'D:\source
code\PocketPC\SIBesiktningPPC\TestProj\bin\Debug\System.Windows.Forms.dll',
No symbols loaded.
An unhandled exception of type 'System.TypeLoadException' occurred in
TestProj.exe
Additional information: Det gick inte att läsa in typen
System.Drawing.Bitmap från sammansättningen System.Drawing,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A.


The only thing the dll does is getting a embedded resource (image) and
returns it as a bitmap, when I specify the name of the image. It's a class
library with the following code (you need a picture called noPic.gif in the
directory ..projectpath..\Images\gif\)

using System;
using System.Reflection;
using System.Drawing;

namespace SIBUtils
{
/// <summary>
/// Summary description for Class1.
/// </summary>
public class SIBImage
{
Bitmap noPic = null;
static string extension = ".gif";
static string path = "SIBUtils.Images.gif.";
public SIBImage()
{
noPic = new
Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream(path +
"noPic" + extension ));
}

public Bitmap Get( string strImgName )
{
if( strImgName != "" )
{
try
{
Bitmap bmp = new
Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream(path +
strImgName + extension));
return bmp;
}
catch( Exception exc )
{
return noPic;
}
}
return null;
}
}
}

The test prject code:

using System;
using System.Drawing;
using System.Windows.Forms;
using SIBUtils;

namespace TestProj
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Button button1;
SIBImage sibImg;

public Form1()
{
InitializeComponent();
sibImg = new SIBImage();
}

protected override void Dispose( bool disposing )
{
base.Dispose( disposing );
}

#region Windows Form Designer generated code
private void InitializeComponent()
{
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.button1 = new System.Windows.Forms.Button();
//
// pictureBox1
//
this.pictureBox1.Location = new System.Drawing.Point(120, 8);
this.pictureBox1.Size = new System.Drawing.Size(104, 136);
//
// button1
//
this.button1.Location = new System.Drawing.Point(16, 120);
this.button1.Text = "button1";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// Form1
//
this.Controls.Add(this.button1);
this.Controls.Add(this.pictureBox1);
this.MinimizeBox = false;
this.Text = "Form1";
}
#endregion

static void Main()
{
Application.Run(new Form1());
}

private void button1_Click(object sender, System.EventArgs e)
{
this.pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
this.pictureBox1.Image = sibImg.Get("noPic"); // Need a pic named
noPic
}
}
}

What have I done wrong?

regards,

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top