Developer forum

Forum » Dynamicweb 10 » Issued with add soap service to DW 10.

Issued with add soap service to DW 10.

Claus Kortbek
Reply

Hello,

I have a SOAP service integration up a ERP system.

I get a error when I uses this through the Apps (NuGet), but do I add the dll directly to the application bin folder, it works perfectly.

Error description is listed below.

Message: 
A non-collectible assembly may not reference a collectible assembly.

Stacktrace:

System.NotSupportedException: A non-collectible assembly may not reference a collectible assembly. at System.Reflection.Emit.RuntimeModuleBuilder.GetTypeRefNested(Type type, Module refedModule) at System.Reflection.Emit.RuntimeModuleBuilder.GetTypeTokenWorkerNoLock(Type type, Boolean getGenericDefinition) at System.Reflection.Emit.RuntimeModuleBuilder.GetTypeTokenInternal(Type type, Boolean getGenericDefinition) at System.Reflection.Emit.RuntimeTypeBuilder.AddInterfaceImplementationCore(Type interfaceType) at System.Reflection.DispatchProxyGenerator.ProxyBuilder.AddInterfaceImpl(Type iface) at System.Reflection.DispatchProxyGenerator.ProxyAssembly.GenerateProxyType(Type baseType, Type interfaceType, String interfaceParameter, String proxyParameter) at System.Reflection.DispatchProxyGenerator.ProxyAssembly.GetProxyType(Type baseType, Type interfaceType, String interfaceParameter, String proxyParameter) at System.Reflection.DispatchProxyGenerator.CreateProxyInstance(Type baseType, Type interfaceType, String interfaceParameter, String proxyParameter) at System.Reflection.DispatchProxy.Create[T,TProxy]() at System.ServiceModel.Channels.ServiceChannelProxy.CreateProxy[TChannel](MessageDirection direction, ServiceChannel serviceChannel) at System.ServiceModel.Channels.ServiceChannelFactory.CreateProxy[TChannel](MessageDirection direction, ServiceChannel serviceChannel) at System.ServiceModel.Channels.ServiceChannelFactory.CreateChannel[TChannel](EndpointAddress address, Uri via) at System.ServiceModel.ChannelFactory`1.CreateChannel(EndpointAddress address, Uri via) at System.ServiceModel.ChannelFactory`1.CreateChannel() at System.ServiceModel.ClientBase`1.CreateChannel() at System.ServiceModel.ClientBase`1.CreateChannelInternal() at System.ServiceModel.ClientBase`1.get_Channel() at Integration.Broker.BrokerClient.ExecNavViewAsync(String userId, String password, String transactionId, String viewId, String commandName, String commandArgument, String inputDataXml, Parameter[] parameters, String connectionName) at Integration.Navision.Services.NavisionOrderService.GetNavView(String viewId, String cmd, String xml, Parameter[] parameters) at Integration.Navision.Services.NavisionOrderService.GetInvoices(String customerNumber)
 


Replies

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Claus,
Are you trying to install some custom developed add-in from Nuget using the DW10 Developer->Add ins-> Nuget list?
If yes, can you try to compare if the same files were downloaded into the Files\System\AddIns\Installed folder?
Maybe some referenced files can be missed.
What is your add-in Nuget name/url?
BR, Dmitrij
 

 
Claus Kortbek
Reply

Hi Dmitriy,

Yes it is a custom developed add-in.

And the Installed folder looks fine, my guess is that the add-in (nuget pack) that you load in is running in a difference AssemblyDomain.

Which make fail because it can't access across domains.

BR
Claus

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Claus

Can you share some info on your package? The error message is giving some pointers: "A non-collectible assembly may not reference a collectible assembly." Which in turn comes from this change in .NET : https://learn.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/7.0/collectible-assemblies

So what are you referencing in your addin? Can you show us project structure and your PackageReferences from your csproj?

 
Claus Kortbek
Reply

PackageReferences:
<PackageReference Include="Dynamicweb.Suite" Version="10.16.6" /> <PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0" />
<PackageReference Include="System.Private.ServiceModel" Version="4.10.3" /> <PackageReference Include="System.Reflection.DispatchProxy" Version="4.7.1" />
<PackageReference Include="System.ServiceModel.Duplex" Version="4.10.*" /> <PackageReference Include="System.ServiceModel.Http" Version="8.0.0" />
<PackageReference Include="System.ServiceModel.NetFramingBase" Version="8.0.0" /> <PackageReference Include="System.ServiceModel.NetTcp" Version="8.0.0" />
<PackageReference Include="System.ServiceModel.Primitives" Version="8.0.0" /> <PackageReference Include="System.ServiceModel.Security" Version="4.10.*" />
<PackageReference Include="System.ServiceModel.Federation" Version="8.0.0" />

And here is the class (Client) it calls when it fails:
public partial class BrokerClient : System.ServiceModel.ClientBase<Integration.Broker.Broker>, Integration.Broker.Broker

And the method:
public System.Threading.Tasks.Task<string> ExecNavViewAsync(string userId, string password, string transactionId, string viewId, string commandName, string commandArgument, string inputDataXml, Integration.Broker.Parameter[] parameters, string connectionName)

 

The classs (Client) is a WebReference add to project by the Development IDE.

 

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Claus

You could try to update the underlying projects to latest versions of the packages.
E.g. System.ServiceModel.Duplex exists in a later version - and as I read it is not fully compatible with latest versions of .net - see: https://learn.microsoft.com/en-us/dotnet/core/compatibility/wcf-client/6.0/net-standard-2-support

 

You must be logged in to post in the forum