Unfortunately, my understanding of you problem is incomplete. First of all, I cannot immediately see how is it related to your previous question about indirect reference of the assembly (which is the non-existing mechanism). By the way, your explanation of your project looks very interesting and, probably, challenging. Let me first answer to what looks obvious to me.
Yes, you can use C++/CLI from Silverlight and should do this is your C++/CLI project contains valuable resources for the Silverlight solution. You only need to compile it to appropriate target .NET version. But no way you should use P/Invoke; it would be possible but just defeat the purpose. I'll explain. There are two options: all the code in your C++/CLI project is managed, or it can be the mixed-mode project, managed + unmanaged. In first case, you can just reference this DLL in your CLI assembly (Silverlight project or not), or load your assembly dynamically or use via Reflection. In other words, your C++/CLI project will compile into a regular .NET assembly and should be used as such, as any other .NET assembly. If this is a mixed-mode project (because you have some code developed as unmanaged), you would obtain a DLL, some PE file, an executable module with dual use: either as regular native (unmanaged) DLL or as a regular .NET assembly. So, P/Invoke could be possible. Don't do it! Take the real unique benefit of C++/CLI! Even if you have some unmanaged code, wrap it in some managed ("ref") class/structure, make it
public
, with the members you need to invoke, to make it accessible as object/members of managed (.NET) assembly. This is the unique feature of C++/CLI which allows to skip cumbersome P/Invoke.
"Use the DLL C++/CLI from WCF" is just not a comprehensible expression to me. WCF is another library, part of .NET FCL. You cannot "inject" anything into it from your own assembly. It will always use .NET FCL as is. But the mechanism of serialization (
Data Contract, you will need to read about it), will allow you to use your classes representing data you need to pass through the network using WCF. So, you can and are advised to use WCF, but not "the DLL C++/CLI from WCF". Rather, it will be using C++/CLI (or any other .NET language) with FCL. To get an idea, please see:
http://msdn.microsoft.com/en-us/library/ms733127%28v=vs.110%29.aspx[
^].
About last question: I don't understand what does it mean, "from browser files"? I don't know any "browser files". Perhaps, again, you need to explain the purpose or desired behavior. "What" instead of "how".
That's all for now. If you provide relevant feedback, we can discuss more of it.
SA—