473,395 Members | 1,941 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.

Problem with dynamically loaded assemblies when deployed thru notouch deployment

We have an application which dynamically loads an assembly and creates
instances of classes. For this we have written a factory class which
reflects the assembly and creates the classes and returns the created
objects as plain objects. The caller method casts the object returned
by the object factory into appropriate class object and uses it.

All this works fine when exe is invoked directly. But when the
application is deployed on the IIS for no touch deployment, the casting
of the object returned by the object factory is throwing an invalid
cast exception. Strange thing is that the statement that is causing
exception during run time works fine if executed in the Immediate
window of the VS.Net IDE.

How do I fix it?

May 10 '06 #1
2 1252
Ravi I think factory class in which you are dynamically loading assemblies is
working fine on development machine because those assemblies are in Bin
Folder, but on production, i think factory is unable to locate assembly.

"Ravi" wrote:
We have an application which dynamically loads an assembly and creates
instances of classes. For this we have written a factory class which
reflects the assembly and creates the classes and returns the created
objects as plain objects. The caller method casts the object returned
by the object factory into appropriate class object and uses it.

All this works fine when exe is invoked directly. But when the
application is deployed on the IIS for no touch deployment, the casting
of the object returned by the object factory is throwing an invalid
cast exception. Strange thing is that the statement that is causing
exception during run time works fine if executed in the Immediate
window of the VS.Net IDE.

How do I fix it?

May 10 '06 #2
If locating the assembly is the problem, the class object will not be
returned to the caller method. Then we will get the null reference
exception. Here the object is being returned but casting is causing the
problem. Casting is working in Immediate window during debugging but
the line of code is throwing Invalid Cast exception during execution

May 10 '06 #3

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

Similar topics

12
by: SJD | last post by:
I've just read Christoph Schittko's article on XmlSerializer: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnxmlnet/html/trblshtxsd.asp . . . and very informative it is too....
0
by: Tomas Vera | last post by:
Hello All, I've developed a Commerce Server application and am having deployment problems. The issue is not Commerce Server specific, so I'll ask here, since questions get answered here. The...
9
by: Ender | last post by:
I have an application that I would like third party developers to be able to create Plug-ins that will be dynamically loaded into our application to extend functionality. I have utilized the...
0
by: Scanner2001 | last post by:
I have a web service and a deployment project. Inside the deployment project, is a custom action to create some database related items such as stored procedures. I have this packaged as an msi, and...
0
by: Kleanthis | last post by:
I have a problem, when deploying multilingual applications using cab files on Compact Framework 2.0. It seems that something is going wrong with compact framework 2.0 Below I have a description...
11
by: Ron | last post by:
I have a web project compiled with the new "Web Deployment Projects" plugin for VS2005. I'm deploying the web project to one assembly and with updateable option set to ON. When I'm running the...
2
by: Shilpa | last post by:
Hi All, I am creating an add-in for some third party tools A and B. The add-in has a single GUI that is used in both A and B. The add-in is build by referencing dlls from A and B. The problem...
2
by: millevlada | last post by:
Hi all. Here is description of my run-time assembly loading problem: I would like to have winService hosting .Net remoting objects. But, it should work in sort of pluginable way, so during...
2
by: =?ISO-8859-1?B?RulybmFz?= | last post by:
Hey all, I have a URGENT problem and I hope someone could help me... scenery: I have a windows app, coded using C# (framework 1.1 - VS2003)... The exe and dlls of the app is are stored in a...
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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,...

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.