Named Pipe in a Excel DNA project blows with NotSupportedException
maxima120 opened this issue · 1 comments
maxima120 commented
System.NotSupportedException: A non-collectible assembly may not reference a collectible assembly.
at System.Reflection.Emit.ModuleBuilder.GetTypeRef(QCallModule module, String strFullName, QCallModule refedModule, String strRefedModuleFileName, Int32 tkResolution)
at System.Reflection.Emit.ModuleBuilder.GetTypeRefNested(Type type, Module refedModule, String strRefedModuleFileName)
at System.Reflection.Emit.ModuleBuilder.GetTypeTokenWorkerNoLock(Type type, Boolean getGenericDefinition)
at System.Reflection.Emit.ModuleBuilder.GetTypeTokenInternal(Type type, Boolean getGenericDefinition)
at System.Reflection.Emit.TypeBuilder..ctor(String fullname, TypeAttributes attr, Type parent, Type[] interfaces, ModuleBuilder module, PackingSize iPackingSize, Int32 iTypeSize, TypeBuilder enclosingType)
at System.Reflection.Emit.ModuleBuilder.DefineType(String name, TypeAttributes attr, Type parent)
at ServiceWire.ProxyFactory.CreateProxyBuilder(String proxyName, Type interfaceType, Type channelType, Type ctorArgType)
at ServiceWire.ProxyFactory.<>c__DisplayClass5_01.<CreateProxy>b__0() at ServiceWire.PooledDictionary2.Request(TKey key, Func1 creator) at ServiceWire.ProxyFactory.CreateProxy[TInterface](Type channelType, Type ctorArgType, Object channelCtorValue, ISerializer serializer, ICompressor compressor) at ServiceWire.NamedPipes.NpProxy.CreateProxy[TInterface](NpEndPoint npAddress, ISerializer serializer, ICompressor compressor) at ServiceWire.NamedPipes.NpClient1..ctor(NpEndPoint npAddress, ISerializer serializer, ICompressor compressor)
at DnaClassLibrary.SpinFunctions.GetObject(String typeId, String objectId) in ExcelDNA\DnaClassLibrary\DnaClassLibrary\Class1.cs:line 38
[ExcelFunction(Description = "My first .NET function")]
public static string GetObject(string typeId, string objectId)
{
try
{
Debug.WriteLine("DNA - GetObject starting");
using (client = new NpClient<IMyProxyService>(new NpEndPoint(MyObjectProxy.PipeName)))
it blows on new NpClient
..
This is .Net 6 project (because Excel DNA only supports up up to v 6).
tylerje commented
There's not much I can do here. ServiceWire was not designed to work with VBA and the restricted security sandbox it runs in.