473,395 Members | 1,608 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,395 software developers and data experts.

Windows Service: Get wrong type from dynamically loaded dll?

Hi

I am writing a windows service which, at some point, does a dynamic
compilation of a c# class into a dll, loads the dll in another AppDomain,
makes a call to a method within the compiled class and process the returned
object.

However, it gives me the base type of System.MarshalByRefObject on:
_obj = _domain.CreateInstanceFromAndUnwrap(file, "Scripts.MyClass");

_type = _obj.GetType(); <----
System.MarshalByRefObject type returned instead of Scripts.MyClass

The weird thing is that the same code works fine within a Windows
Application! I have been stuck with this for 2 days now :( Anybody has an
idea what is going on?

Thanks
Jeff

Jan 9 '08 #1
1 1009
Any help please?

"news.microsoft.com" <br******@yahoo.coma écrit dans le message de news:
Oq**************@TK2MSFTNGP03.phx.gbl...
Hi

I am writing a windows service which, at some point, does a dynamic
compilation of a c# class into a dll, loads the dll in another AppDomain,
makes a call to a method within the compiled class and process the
returned object.

However, it gives me the base type of System.MarshalByRefObject on:
_obj = _domain.CreateInstanceFromAndUnwrap(file, "Scripts.MyClass");

_type = _obj.GetType(); <----
System.MarshalByRefObject type returned instead of Scripts.MyClass

The weird thing is that the same code works fine within a Windows
Application! I have been stuck with this for 2 days now :( Anybody has an
idea what is going on?

Thanks
Jeff


Jan 10 '08 #2

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

Similar topics

2
by: Ken Lindner | last post by:
I have a need to become familiar with SQL Server 2000 for work. Needless to say I am new to SQL Server any version, but not IT in general. My employer has provided me with the SQL Server 2000...
1
by: Ajay Pal Singh | last post by:
Hi, I am making an windows service similar to windows task schedular. The service would invoke the methods of some assemblies at some predefined schedules. (windows service read the...
2
by: Trevor | last post by:
Argh! This problem is driving me nuts! Can you help? In November of 2003, I installed a web service on Windows Server 2003 built in VB.NET for v1.1.4322 of the framework. It contains a timer...
3
by: lk | last post by:
I need some help regarding the mechanism to put in place to be able to dynamically update a remote object when the assembly where it is defined is modified, and this whitout having service...
4
by: Chris | last post by:
Good Morning, I have spent a considerable amount of time trying to get aspx pages to render in IIS 5.1 to no avail. At first I thought it was a problem with the installation of the Quickstarts...
2
by: paul1664 | last post by:
Hi, I am trying to call a web service from within a dll, with that dll being loaded and called dynamically. eg. Assembly assembly = Assembly.LoadFile(@"C:\path\myfile.dll"); Type type =...
0
by: pratika2002 | last post by:
Hi, I am having a windows service project which is built by someone else and I have to understand the fuctionality. While running the service I am getting the following exception. "An unhandled...
5
by: dm3281 | last post by:
I'm really starting to hate writing services -- or trying to, anyway. Why do I need to rename my project to the service name? Why do I need to set the "ServiceName" property to my service name?...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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,...

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.