473,834 Members | 1,873 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem resolving assemblies

Hello,

I am facing an issue I cannot easily solve. I am writing a non-managed C++
application that I want to be extensible using plugins. The goal is to let
people write plugins in any language they want including C# (but also C++,
Delphi or whatever...). The way I am doing things right now is to write a
managed C++ wrapper that implements the callbacks required by the
application to be recognized as a plugin and uses code written in C# and
provided as a DLL. I therefore have two DLL's for one plugin: the C++
wrapper and the C# real stuff.

This works fine except for one issue: it would be nice to place in a
"plugins" directory next to the application binary. Ideally I should
therefore have the following layout (final version also has each plugin in
its own subfolder of the plugins directory but let's keep it simple for the
moment):
-- app.exe (unmanaged C++)
-- plugins
----- wrapper.dll (managed C++)
----- plugin.dll (C#)

The problem is that wrapper.dll does not resolve the plugin.dll assembly
unless I put it next to app.exe which is not very nice. I tried to solve the
issue by using AppDomain::Curr entDomain->AppendPrivateP ath("plugins"); in
wrapper.dll but this does not work neither. Please note that my AppDomain's
BaseDirectory is the folder of app.exe and not the plugins folder so it
seems like I get the AppDomain of the application and not the one of the DLL
although app.exe is not managed... I tried a lot of things but cannot reach
anything working.

Again, there is no problem mixing all these languages (C# code wrapped by
managed C++ code for a unmanaged C++ application) as if I put plugin.dll
besides app.exe everything works fine.

Thanks for any help!

Regards,
mynab

Nov 22 '05 #1
1 1418
I haven't tried it with CurrentDomain, but I've successfully done what
you wanted in a new AppDomain by changing AppDomainSetup' s
PrivateBinPath property to the plugins directory.

Regards
Senthil

Nov 22 '05 #2

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

Similar topics

6
3313
by: Iain Bishop | last post by:
I'm trying to model objects for the following problem: A building site contains assemblies, each of which can contain other assemblies and/or materials. I have modelled this using a Site class, Assembly class, and Material class as follows... Site Class (clsSite): Option Explicit
2
2737
by: Wol | last post by:
I have two assemblies, A.dll and B.dll. A.dll contains two methods. One method, UsesB, uses a type from B.dll whereas the other, DoesNotUseB, does not. To cache a native image of A.dll with both methods precompiled, I believe I can do ngen A.dll B.dll
1
269
by: mynab | last post by:
Hello, I am facing an issue I cannot easily solve. I am writing a non-managed C++ application that I want to be extensible using plugins. The goal is to let people write plugins in any language they want including C# (but also C++, Delphi or whatever...). The way I am doing things right now is to write a managed C++ wrapper that implements the callbacks required by the application to be recognized as a plugin and uses code written in C#...
15
2436
by: Ken Allen | last post by:
I have been developing a suite of assemblies over the past couple of weeks, and this afternoon somethign started misbehaving. If I do not run the IDE and compiler the code from the command line, the compilation seems to work properly almost all of the time. More on this later. If I launch one copy of the IDE, then I can usually compile the project at least once. At some point, the build fails reporting "Could not copy temporary files...
1
1789
by: JPRoot | last post by:
Hi I have a problem with the development environment I have a DLL (jproot.dll) versionned 1.9.0.33 that I have shipped to my customer My customer made a DLL (cust.dll, versionned 1.2.3.4) that depend on jproot.dll In the manifest of this cust.dll (ildasm), it is written that it depends on jproot.dll version 1.9.0.33, which is ok I have an application (sample.exe) that depends on cust.dll
0
1217
by: JonS. | last post by:
Hey All, I'm currently working on a program that dynamically loads assemblies from a directory each into their own seperate AppDomains using a somewhat logical extension of Eric Gunnerson's article found at: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp05162002.asp Now the problem I'm having is that, though I've created a remote loader, when I try to load an assembly from a method in the...
4
5386
by: anders | last post by:
I already asked this question in the VB.NET group but as C# seems to have the same problem, I'll try here, too. I have 2 external OEM assemblies A1 and A2 that both define class X (same name, not same class) in the global namespace. I need to use both X'es in my project. How do I fully qualify the X'es to avoid the name clash between X from A1 and X from A2. The using statement provides a way of aliasing clashing names from named...
0
1205
by: Wanderer | last post by:
Hi all, who knows how to correctly make assembly resolving in asp.net? In WinApplications AppDomain.CurrentDomain.AssemblyResolve event works fine, but this is not a case of asp.net. If I use this event (I put a handler in Global.Application_Start) it seems that either I start to handle it too late or it doesn't come at all.
5
4505
by: srinivas | last post by:
Hi, I have a ASP.net application which takes excel sheet as input.It retrieves the data from the excel sheet and using that data it generates reports. On my PC everything is working fine.But if somebody access my application other than localhost,i.e something like http://MyMachinename/MyapplicationName/Report.aspx application is throwing the error "Rejected Safe Mode action : Microsoft Office Excel." I'm using code like this
6
3034
by: joseph2000 | last post by:
Hi, I'd like to ask you for some ideas how to solve problem I currently have. The problem is as follows: we have a component which is integrated with w Windows Explorer. From time to time we need to make an update, which is performed on client machines. And here the problem appears - all the assemblies used by the component are being locked by the explorer process, so we need to unlock them somehow. Till now we have used dirty...
0
9799
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
9646
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
10548
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
10219
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
9331
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
5794
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4427
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
2
3978
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3081
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.