Initializing Console Application Bundle Installation

Discussions concerning general integration topics.

Moderator: Phil Barton

Post Reply
timothymeyer16
Posts: 37
Joined: Mon Jun 14, 2021 9:47 am

Initializing Console Application Bundle Installation

Post by timothymeyer16 »

Objective:
We're attempting to automate bundle installations.

Error Information
We connect a stream to the .bnd file, which is then locked by windows, so we believe the error is with IProgress or the Cancelation token. We're unsure of the values we should be assigning to Iprogress and the cancelation token. The SDK and forum only provide examples such as:

Primaray Error
Object reference not set to an instance of an object.

I Prompt and cancelation token are passed without and initialized values.
- https://devforum.softprocorp.com/viewto ... ress#p5347
- Task<IRendering> RenderAsync(IRenderingSnapshot snapshot, object context, IPrompt<PromptEventArgs> prompt, IProgress<ProgressEventArgs> progress, CancellationToken cancellationToken);


SDK
InstallAsync Method (bundleStream, progress, cancellationToken)

Namespaces ► SoftPro.Select.Client.Bundles ► IBundleManager ► InstallAsync(Stream, IProgress<(Of <<'(ProgressEventArgs>)>>), CancellationToken)

Task<IBundleInfo> InstallAsync(
Stream bundleStream,
IProgress<ProgressEventArgs> progress,
CancellationToken cancellationToken
)


But these do not work for us.



Environment:
- Sdk 4.3.60210.48 (4.3.15.1)
- Console application



Our Code:

Stream bundleStream = File.Open(bundlePath, FileMode.Open);

IProgress<ProgressEventArgs> progress = new Progress<ProgressEventArgs>();

CancellationTokenSource source = new CancellationTokenSource();
CancellationToken token = new CancellationToken(); // source.Token;

try
{
await BundleManager.InstallAsync(bundleStream, progress, token);
}
catch( Exception ex)
{
Console.WriteLine(ex);
}




Returned Error


System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> System.NullReferenceException: Object reference not set to an instance of an object.

Server stack trace:
at SoftPro.Select.Client.SelectServer.get_AuthenticatedUserID()
at SoftPro.Select.Client.ClientUserIDOperationBehaviorFactory.ClientUserIDOperationBehavior.System.ServiceModel.Dispatcher.IClientMessageInspector.BeforeSendRequest(Message& request, IClientChannel channel)
at System.ServiceModel.Dispatcher.ImmutableClientRuntime.BeforeSendRequest(ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.PrepareCall(ProxyOperationRuntime operation, Boolean oneway, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at SoftPro.Select.Client.Bundles.BundleManagerService.ContinueInstall(Guid cookie, Int32 pos, Byte[] data)
at SoftPro.Select.Client.Bundles.BundleManagerServiceClient.ContinueInstall(Guid cookie, Int32 pos, Byte[] data)
at SoftPro.Select.Client.Bundles.BundleManager.<>c__DisplayClass15_1.<SoftPro.Select.Client.Bundles.IBundleManager.InstallAsync>b__1(Int32 pos, Byte[] data)
at SoftPro.ClientModel.IO.BinaryTransfer.<>c__DisplayClass2_0.<UploadTo>b__1(Int32 pos)
at System.Threading.Tasks.Parallel.<>c__DisplayClass42_0`2.<PartitionerForEachWorker>b__1()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object )
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at System.Threading.Tasks.Parallel.PartitionerForEachWorker[TSource,TLocal](Partitioner`1 source, ParallelOptions parallelOptions, Action`1 simpleBody, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IEnumerable`1 source, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
at System.Threading.Tasks.Parallel.ForEach[TSource](IEnumerable`1 source, ParallelOptions parallelOptions, Action`1 body)
at SoftPro.ClientModel.IO.BinaryTransfer.UploadTo(Stream source, Action`2 uploader, CancellationToken cancellationToken, Int32 chunkSize)
at SoftPro.Select.Client.Bundles.BundleManager.<>c__DisplayClass15_0.<SoftPro.Select.Client.Bundles.IBundleManager.InstallAsync>b__0()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of inner exception stack trace ---
at SoftPro.ClientModel.Threading.TaskExtensions.<>c__DisplayClass7_0`1.<Finally>b__0(Task`1 t)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at ConsoleApplication1.Program.<InstallBundle>d__3.MoveNext() in C:\Users\timadmin\documents\visual studio 2015\Projects\BundleInstaller\BundleInstaller\Program.cs:line 126
---> (Inner Exception #0) System.AggregateException: One or more errors occurred. ---> System.NullReferenceException: Object reference not set to an instance of an object.

Server stack trace:
at SoftPro.Select.Client.SelectServer.get_AuthenticatedUserID()
at SoftPro.Select.Client.ClientUserIDOperationBehaviorFactory.ClientUserIDOperationBehavior.System.ServiceModel.Dispatcher.IClientMessageInspector.BeforeSendRequest(Message& request, IClientChannel channel)
at System.ServiceModel.Dispatcher.ImmutableClientRuntime.BeforeSendRequest(ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.PrepareCall(ProxyOperationRuntime operation, Boolean oneway, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at SoftPro.Select.Client.Bundles.BundleManagerService.ContinueInstall(Guid cookie, Int32 pos, Byte[] data)
at SoftPro.Select.Client.Bundles.BundleManagerServiceClient.ContinueInstall(Guid cookie, Int32 pos, Byte[] data)
at SoftPro.Select.Client.Bundles.BundleManager.<>c__DisplayClass15_1.<SoftPro.Select.Client.Bundles.IBundleManager.InstallAsync>b__1(Int32 pos, Byte[] data)
at SoftPro.ClientModel.IO.BinaryTransfer.<>c__DisplayClass2_0.<UploadTo>b__1(Int32 pos)
at System.Threading.Tasks.Parallel.<>c__DisplayClass42_0`2.<PartitionerForEachWorker>b__1()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object )
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at System.Threading.Tasks.Parallel.PartitionerForEachWorker[TSource,TLocal](Partitioner`1 source, ParallelOptions parallelOptions, Action`1 simpleBody, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IEnumerable`1 source, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
at System.Threading.Tasks.Parallel.ForEach[TSource](IEnumerable`1 source, ParallelOptions parallelOptions, Action`1 body)
at SoftPro.ClientModel.IO.BinaryTransfer.UploadTo(Stream source, Action`2 uploader, CancellationToken cancellationToken, Int32 chunkSize)
at SoftPro.Select.Client.Bundles.BundleManager.<>c__DisplayClass15_0.<SoftPro.Select.Client.Bundles.IBundleManager.InstallAsync>b__0()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
---> (Inner Exception #0) System.NullReferenceException: Object reference not set to an instance of an object.

Server stack trace:
at SoftPro.Select.Client.SelectServer.get_AuthenticatedUserID()
at SoftPro.Select.Client.ClientUserIDOperationBehaviorFactory.ClientUserIDOperationBehavior.System.ServiceModel.Dispatcher.IClientMessageInspector.BeforeSendRequest(Message& request, IClientChannel channel)
at System.ServiceModel.Dispatcher.ImmutableClientRuntime.BeforeSendRequest(ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.PrepareCall(ProxyOperationRuntime operation, Boolean oneway, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at SoftPro.Select.Client.Bundles.BundleManagerService.ContinueInstall(Guid cookie, Int32 pos, Byte[] data)
at SoftPro.Select.Client.Bundles.BundleManagerServiceClient.ContinueInstall(Guid cookie, Int32 pos, Byte[] data)
at SoftPro.Select.Client.Bundles.BundleManager.<>c__DisplayClass15_1.<SoftPro.Select.Client.Bundles.IBundleManager.InstallAsync>b__1(Int32 pos, Byte[] data)
at SoftPro.ClientModel.IO.BinaryTransfer.<>c__DisplayClass2_0.<UploadTo>b__1(Int32 pos)
at System.Threading.Tasks.Parallel.<>c__DisplayClass42_0`2.<PartitionerForEachWorker>b__1()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object )<---

---> (Inner Exception #1) System.NullReferenceException: Object reference not set to an instance of an object.

Server stack trace:
at SoftPro.Select.Client.SelectServer.get_AuthenticatedUserID()
at SoftPro.Select.Client.ClientUserIDOperationBehaviorFactory.ClientUserIDOperationBehavior.System.ServiceModel.Dispatcher.IClientMessageInspector.BeforeSendRequest(Message& request, IClientChannel channel)
at System.ServiceModel.Dispatcher.ImmutableClientRuntime.BeforeSendRequest(ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.PrepareCall(ProxyOperationRuntime operation, Boolean oneway, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at SoftPro.Select.Client.Bundles.BundleManagerService.ContinueInstall(Guid cookie, Int32 pos, Byte[] data)
at SoftPro.Select.Client.Bundles.BundleManagerServiceClient.ContinueInstall(Guid cookie, Int32 pos, Byte[] data)
at SoftPro.Select.Client.Bundles.BundleManager.<>c__DisplayClass15_1.<SoftPro.Select.Client.Bundles.IBundleManager.InstallAsync>b__1(Int32 pos, Byte[] data)
at SoftPro.ClientModel.IO.BinaryTransfer.<>c__DisplayClass2_0.<UploadTo>b__1(Int32 pos)
at System.Threading.Tasks.Parallel.<>c__DisplayClass42_0`2.<PartitionerForEachWorker>b__1()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object )<---

---> (Inner Exception #2) System.NullReferenceException: Object reference not set to an instance of an object.

Server stack trace:
at SoftPro.Select.Client.SelectServer.get_AuthenticatedUserID()
at SoftPro.Select.Client.ClientUserIDOperationBehaviorFactory.ClientUserIDOperationBehavior.System.ServiceModel.Dispatcher.IClientMessageInspector.BeforeSendRequest(Message& request, IClientChannel channel)
at System.ServiceModel.Dispatcher.ImmutableClientRuntime.BeforeSendRequest(ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.PrepareCall(ProxyOperationRuntime operation, Boolean oneway, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at SoftPro.Select.Client.Bundles.BundleManagerService.ContinueInstall(Guid cookie, Int32 pos, Byte[] data)
at SoftPro.Select.Client.Bundles.BundleManagerServiceClient.ContinueInstall(Guid cookie, Int32 pos, Byte[] data)
at SoftPro.Select.Client.Bundles.BundleManager.<>c__DisplayClass15_1.<SoftPro.Select.Client.Bundles.IBundleManager.InstallAsync>b__1(Int32 pos, Byte[] data)
at SoftPro.ClientModel.IO.BinaryTransfer.<>c__DisplayClass2_0.<UploadTo>b__1(Int32 pos)
at System.Threading.Tasks.Parallel.<>c__DisplayClass42_0`2.<PartitionerForEachWorker>b__1()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object )<---

---> (Inner Exception #3) System.NullReferenceException: Object reference not set to an instance of an object.

Server stack trace:
at SoftPro.Select.Client.ClientUserIDOperationBehaviorFactory.ClientUserIDOperationBehavior.System.ServiceModel.Dispatcher.IClientMessageInspector.BeforeSendRequest(Message& request, IClientChannel channel)
at System.ServiceModel.Dispatcher.ImmutableClientRuntime.BeforeSendRequest(ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.PrepareCall(ProxyOperationRuntime operation, Boolean oneway, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at SoftPro.Select.Client.Bundles.BundleManagerService.ContinueInstall(Guid cookie, Int32 pos, Byte[] data)
at SoftPro.Select.Client.Bundles.BundleManagerServiceClient.ContinueInstall(Guid cookie, Int32 pos, Byte[] data)
at SoftPro.Select.Client.Bundles.BundleManager.<>c__DisplayClass15_1.<SoftPro.Select.Client.Bundles.IBundleManager.InstallAsync>b__1(Int32 pos, Byte[] data)
at SoftPro.ClientModel.IO.BinaryTransfer.<>c__DisplayClass2_0.<UploadTo>b__1(Int32 pos)
at System.Threading.Tasks.Parallel.<>c__DisplayClass42_0`2.<PartitionerForEachWorker>b__1()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object )<---
<---
Post Reply