473,406 Members | 2,352 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

System.TypeLoadException problem

When getting a type from a dynamically loaded assembly using
Assembly.GetType, I receive the following exception:

An unhandled exception of type 'System.TypeLoadException' occurred in
playengine.dll

Additional information: Method add_Closing in type
PlayEngine.D3DVideoTask from assembly D3DVideoTask,
Version=1.0.1632.5152, Culture=neutral, PublicKeyToken=null does not
have an implementation.

I'm not sure where it is getting this 'add_Closing' method from. The
class does have an event called 'Closing'. I tried defining custom add
and remove accessors for the event but that did not make the exception
go away. What is the problem?
Nov 16 '05 #1
2 13613
Eli,

The only thing that I can think of is that there is a custom event
declaration (using add and remove) instead of the normal event declaration.
Is this assembly one that you have the code for, or is it something you can
not modify? If you have the code for it, then can you post it (if not the
assembly itself) and the code you are trying to use to access it?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Eli Block" <eb****@gmail.com> wrote in message
news:76*************************@posting.google.co m...
When getting a type from a dynamically loaded assembly using
Assembly.GetType, I receive the following exception:

An unhandled exception of type 'System.TypeLoadException' occurred in
playengine.dll

Additional information: Method add_Closing in type
PlayEngine.D3DVideoTask from assembly D3DVideoTask,
Version=1.0.1632.5152, Culture=neutral, PublicKeyToken=null does not
have an implementation.

I'm not sure where it is getting this 'add_Closing' method from. The
class does have an event called 'Closing'. I tried defining custom add
and remove accessors for the event but that did not make the exception
go away. What is the problem?

Nov 16 '05 #2
No, the event isn't a custom event declaration. Here is the code from
the assembly I'm dynamically loading:

--- Begin Code Block ---
namespace PlayEngine
{
public class D3DVideoTask : Task, IVideoTask
{
public D3DVideoTask() : base()
{
}

public override void Run()
{
Application.DoEvents();
}

public void CreateViewport()
{
viewport = new Form();
viewport.Show();
viewport.Closing += new CancelEventHandler(viewport_Closing);
}

protected override void Start()
{
}

protected override void Stop()
{
}

protected override void Suspend()
{
}

protected override void Resume()
{
}

protected void viewport_Closing(object sender, CancelEventArgs
e)
{
if (Closing != null)
{
Closing(this);
}
}

private void InitalizeDirect3D()
{
...
}

public event VideoEventHandler Closing; // <- troublesome event

private Form viewport;

private Device d3dDevice;
}
}
--- End Code Block ---

And here is the line of code used to access the class from this
assembly:

Task task = (Task)Activator.CreateInstance(Assembly.Load("D3DV ideoTask").GetType("PlayEngine.D3DVideoTask",
true));

Note that it appears to be the GetType() method that throws the
exception.

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:<Oi**************@TK2MSFTNGP10.phx.gbl>...
Eli,

The only thing that I can think of is that there is a custom event
declaration (using add and remove) instead of the normal event declaration.
Is this assembly one that you have the code for, or is it something you can
not modify? If you have the code for it, then can you post it (if not the
assembly itself) and the code you are trying to use to access it?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Eli Block" <eb****@gmail.com> wrote in message
news:76*************************@posting.google.co m...
When getting a type from a dynamically loaded assembly using
Assembly.GetType, I receive the following exception:

An unhandled exception of type 'System.TypeLoadException' occurred in
playengine.dll

Additional information: Method add_Closing in type
PlayEngine.D3DVideoTask from assembly D3DVideoTask,
Version=1.0.1632.5152, Culture=neutral, PublicKeyToken=null does not
have an implementation.

I'm not sure where it is getting this 'add_Closing' method from. The
class does have an event called 'Closing'. I tried defining custom add
and remove accessors for the event but that did not make the exception
go away. What is the problem?

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: cody | last post by:
my problem is as follows: abstract class A { abstract Foo(); static Doit() { A = new B(); } }
1
by: DC | last post by:
Hi, I am programming a windows service and all went well until I needed to use a simple array of chars which I initialize like this: char test = new char {'\x002F', '\x005E'}; Immediatly...
0
by: Paul | last post by:
Hi all I am struggling to get my FIRST Project, which basically call a C# DLL inside my VC++ exe. Inside my C#DLL which I created, it references to one external COM object I added my C# DLL as...
1
by: @ndre | last post by:
Any type declaration of double leads to a TypeLoadException when run in cf (no compilation error), i.e. cf = reduced c# set??? see example below comments? @ndre this compiles with cf, but give...
0
by: Dmitry Shuklin | last post by:
I make __value type with some private fields. I want to implement System.ISerializable for custom serialization public __value struct NativeHandle : public...
0
by: phillip | last post by:
This is interesting, I have attached my web.config file and the exception I have been logging. I created a library which provide data access to a database and a control system. The library is...
0
by: Pierre-Alain Vigeant | last post by:
Hi, I'm getting a TypeLoadException inside an object that is located in a DLL that is dynamically loaded. I have this main program "main.exe" that dynamically load "main.dll" using o =...
0
by: Campaniço | last post by:
Hi Can anyone help me with this problem. ------------------------------ PDA Transportes.exe TypeLoadException FormTransMain::.ctor+0x2c FormTransMain::Main+0x5
1
by: Tom | last post by:
Having some trouble with my assembly running another assembly, and I am starting to suspect this may be a windows bug or a framework bug. Everything works fine on my development workstation (XP...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.