473,657 Members | 2,550 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

System.TypeLoad Exception problem

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

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

Additional information: Method add_Closing in type
PlayEngine.D3DV ideoTask from assembly D3DVideoTask,
Version=1.0.163 2.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 13635
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.co m

"Eli Block" <eb****@gmail.c om> wrote in message
news:76******** *************** **@posting.goog le.com...
When getting a type from a dynamically loaded assembly using
Assembly.GetTyp e, I receive the following exception:

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

Additional information: Method add_Closing in type
PlayEngine.D3DV ideoTask from assembly D3DVideoTask,
Version=1.0.163 2.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.DoE vents();
}

public void CreateViewport( )
{
viewport = new Form();
viewport.Show() ;
viewport.Closin g += new CancelEventHand ler(viewport_Cl osing);
}

protected override void Start()
{
}

protected override void Stop()
{
}

protected override void Suspend()
{
}

protected override void Resume()
{
}

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

private void InitalizeDirect 3D()
{
...
}

public event VideoEventHandl er 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( "D3DVideoTask") .GetType("PlayE ngine.D3DVideoT ask",
true));

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

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in message news:<Oi******* *******@TK2MSFT NGP10.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.co m

"Eli Block" <eb****@gmail.c om> wrote in message
news:76******** *************** **@posting.goog le.com...
When getting a type from a dynamically loaded assembly using
Assembly.GetTyp e, I receive the following exception:

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

Additional information: Method add_Closing in type
PlayEngine.D3DV ideoTask from assembly D3DVideoTask,
Version=1.0.163 2.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
1576
by: cody | last post by:
my problem is as follows: abstract class A { abstract Foo(); static Doit() { A = new B(); } }
1
4706
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 upon starting the service with this line in code (long before this line is even being used) I get a System.TypeLoadException which I cannot debug since it seems to happen somwhere deep in the
0
288
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 a reference inside my VC++ project. When I run it, it throws TypeLoadException What is this error ? I traced the code, and it seems that inside my C# DLL, it has problem instantiating the external COM object Please advice
1
1633
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 an TypeLoadException: public class test_TypeLoadException { static void Main() {
0
1532
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 System::Runtime::Serialization::ISerializable { void ISerializable::GetObjectData(System::Runtime::Serialization::SerializationInfo*
0
5312
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 written in C#. I created a small .exe file to test that the library builds propertly from configuration and that it communicates properly. This work great in the System.Windows.Forms. However, when I use the library in a web enviroment things...
0
1361
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 = AppDomain.CurrentDomain.CreateInstanceFromAndUnwrap(mainDLLPath, "FullyQualifiedNamespace.Main.EntryPoint") o.StartMain(Nothing, Nothing)
0
1240
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
789
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 Pro, FW 1.1). When I copy the binary assemblies to the server machine (2000 Server SP4, FW 1.1) where the apps will be run, I have problems...specifically: Unhandled Exception: System.TypeLoadException: Could not load type <vendor type here>...
0
8425
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8326
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8522
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8622
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7355
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5647
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4333
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2745
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.