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