You've been around here long enough to know that you start with Google. I can't believe that you didn't find anything at all to give you a starting point for your own code. All you have to do is Google for "sending HTML email".
The task I need to solve
For a legacy C++ application -let's call it NativeW32App.exe- I need to use an third party SDK to control an USB device and this SDK is only available as a .net assembly.
The whole SDK consists of about 70 assemblies and one of them -let's call it ThridPartyNetSDK - represents the interface for me.
The approach I go is, I implement a proxy in .net which is COMVisible and can be easely consumed by the C++ application.
So far everything works fine as long as the whole bunch of SDK assemblies is available in the directory from where the NativeW32App.exe is startet. And this (all assemblies in the app's directory) I try to avoid because it is one of about 50 SDK (from different third parties) we need to support.
So my next step was/is
Separate the SDK assemblies and my COMVisible proxy in a separate directory and hook into assembly resolving...
AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(SDK_AssemblyResolve);
... where I load the assemblies from the separate directrory in my SDK_AssemblyResolve.
It seems, that the SDK itself is loading some DLLs dynamicaly relative to the AppDomain.CurrentDomain.BaseDirectory which is
my NativeW32App.exe's startup directory.
The dirty (?) solution
I'm faking AppDomain.CurrentDomain.BaseDirectory in my proxy assembly class ctor
// Very (?) dirty way to fake BaseDirectory
Now finally this works, but I have my doubts
a.) According to the MSDN documentation setting system values (and I assume "APPBASE" is one) should have no effect. But it works fine so far
b.) I assume this can have side effects and is not appropriate for production
c.) It seems that there are better way, e.g. creating the AppDomain by myself. But I have no idea how to manage this for a COM assembly consumer.
Is AppDomain.CurrentDomain.SetData dirty or not reliable for production?
Does anybody has a hint to solve it in a better way, maybe with seperate AppDomain or what else?
Looks promising, thank you for this. I will dive into it and another
Just checked the link. That is what I'm currently doing. But the problem remains, that some of these assemblies (resolved by ResolveEventHandler) do dynamically load by themselve assemblies with the assumption that these assemblies are located in AppDomain.CurrentDomain.BaseDirectory.
That is not a good question for several reasons. First, your subject line - this is a C# forum so it's not necessary to put that in the title. What would be useful, instead, is a meaningful description of the problem. Second, your question is unclear. Try to explain in more detail what it is that you wish to know.
We do not do your HomeWork. HomeWork is not set to test your skills at begging other people to do your work, it is set to make you think and to help your teacher to check your understanding of the courses you have taken and also the problems you have at applying them. Any failure of you will help your teacher spot your weaknesses and set remedial actions. So, give it a try, reread your lessons and start working. If you are stuck on a specific problem, show your code and explain this exact problem, we might help.
As programmer, your job is to create algorithms that solve specific problems and you can't rely on someone else to eternally do it for you, so there is a time where you will have to learn how to. And the sooner, the better. When you just ask for the solution, it is like trying to learn to drive a car by having someone else training. Creating an algorithm is basically finding the maths and make necessary adaptation to fit your actual problem.
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
We do not do your HomeWork.HomeWork is not set to test your skills at begging other people to do your work, it is set to make you think and to help your teacher to check your understanding of the courses you have taken and also the problems you have at applying them. Any failure of you will help your teacher spot your weaknesses and set remedial actions.So, give it a try, reread your lessons and start working. If you are stuck on a specific problem, show your code and explain this exact problem, we might help.
Substitute "work" for "homework." Homework or work work, we don't do everything for anyone. But for some reason, the moment people see homework they immediately start bashing the user (not saying you did that.) Of course we'll help with homework, and gladly, as long as they can ask a proper question.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
Last Visit: 31-Dec-99 19:00 Last Update: 27-Mar-17 13:09