Invalid Assembly marked for discovery error

Discussions related to custom development with Select.
Post Reply
chris.brady
Posts: 105
Joined: Wed Oct 17, 2012 4:20 pm

Invalid Assembly marked for discovery error

Post by chris.brady »

We get the following error the first time we try to open an order in the UI through the API using the Shell's OpenStandardEditor method, passing in an order Uri. After that, opening an order in this way doesn't generate the error. If you restart Select, the same scenario happens -- errors the first time you open the order, but never again.

Any ideas what this is? It looks like a custom message, not a MS one.
Invalid Assembly marked for discovery:
[[12:46:06.002]] [0x00000001] MessageBox: Instruction=Log Call Stack, Content= at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
at System.Environment.get_StackTrace()
at System.Diagnostics.TraceEventCache.get_Callstack()
at SoftPro.Select.LogTraceListener.OnLog(TraceEventCache eventCache, String message, TraceEventType eventType)
at SoftPro.Select.LogTraceListener.TraceEvent(TraceEventCache eventCache, String source, TraceEventType eventType, Int32 id, String message)
at System.Diagnostics.TraceInternal.TraceEvent(TraceEventType eventType, Int32 id, String format, Object[] args)
at SoftPro.OrderTracking.Controls.SnapSectionFactory.SnapSectionAssemblyLoader.Discover(String path, String searchPattern)
at SoftPro.OrderTracking.Controls.SnapSectionFactory.SnapSectionAssemblyLoader.LoadSnapSectionsFromAssemblies()
at SoftPro.OrderTracking.Controls.SnapSectionFactory.SnapSectionAssemblyLoader..ctor()
at SoftPro.OrderTracking.Controls.SnapSectionFactory.SnapSectionAssemblyLoader.get_Instance()
at SoftPro.OrderTracking.Controls.SnapSectionFactory.GetTypeForSnapSection(String controlName)
at SoftPro.OrderTracking.Controls.SnapSectionFactory.CreateSnapSection(String controlName)
at SoftPro.OrderTracking.Controls.SnapSectionContainer.MakeSnapSection(ScreenNode child, ISnapSection& section)
at SoftPro.OrderTracking.Controls.SnapSectionContainer.AddSections(IEnumerable`1 nodes)
at SoftPro.OrderTracking.Controls.Screen.OnCreateRoot(ScreenDefinition definition)
at SoftPro.OrderTracking.Controls.Screen..ctor(IServiceProvider site, ScreenDefinition definition, BindingSource dataSource)
at SoftPro.OrderTracking.Controls.Renderer.CreateScreen(IScreenLayout screenLayout, String screenName, BindingSource dataSource, Dictionary`2 args)
at SoftPro.OrderTracking.Controls.OrderCanvas.ChangeScreen(String screenName, BindingSource dataSource, Dictionary`2 args)
at SoftPro.OrderTracking.Controls.OrderCanvas.InvokeScreenChanged(String screenName, BindingSource dataSource, Dictionary`2 args, String parentExpandoText)
at SoftPro.OrderTracking.Controls.OrderCanvas.InvokeScreenChanged(String screenName, BindingSource dataSource, String parentExpandoText)
at SoftPro.Select.OrderTracking.Orders.OrderEditorPane.SoftPro.Select.Shell.ISupportBookmark.Navigate(String bookmark)
at SoftPro.Select.Controls.DocumentWindow.SoftPro.Select.Shell.ISupportBookmark.Navigate(String bookmark)
at SoftPro.Select.Managers.ShellManager.SoftPro.Select.Shell.IShell.OpenDocumentWindow(Uri moniker, String view, Object existingData, Boolean openAsNew, Boolean shellExecute)
at SoftPro.Select.Managers.ShellManager.SoftPro.Select.Shell.IShell.OpenStandardEditor(Uri moniker)
at WorkBenchLibrary.Utilities.SoftProCommands.OpenOrder(OrderIdentifier orderId, Boolean checkIfCanceled) in C:\TFS\PGPTitle\SoftPro Shell Packages\EditorFactory\WorkBench\Utilities\SoftProCommands.cs:line 55
at WorkBenchLibrary.WorkBench.orders_radGridView_CellDoubleClick(Object sender, GridViewCellEventArgs e) in C:\TFS\PGPTitle\SoftPro Shell Packages\EditorFactory\WorkBench\WorkBench.cs:line 750
at Telerik.WinControls.UI.RadGridView.OnCellDoubleClick(Object sender, GridViewCellEventArgs e)
at Telerik.WinControls.UI.RadGridView.OnMouseDoubleClick(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at Telerik.WinControls.RadControl.WndProc(Message& m)
at Telerik.WinControls.UI.RadGridView.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at SoftPro.Select.Runtime.OnRun()
at SoftPro.Select.Runtime.Start()
at SoftPro.Select.Automation.EnvICE.Start()
at System.Runtime.Remoting.Messaging.Message.Dispatch(Object target)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)
at System.Runtime.Remoting.Messaging.ServerObjectTerminatorSink.SyncProcessMessage(IMessage reqMsg)
at SoftPro.Select.Shell.SynchronizationContextAspect.SyncProcessMessage(IMessage msg)
at System.Runtime.Remoting.Lifetime.LeaseSink.SyncProcessMessage(IMessage msg)
at System.Runtime.Remoting.Messaging.ServerContextTerminatorSink.SyncProcessMessage(IMessage reqMsg)
at System.Runtime.Remoting.Channels.CrossContextChannel.SyncProcessMessageCallback(Object[] args)
at System.Threading.Thread.CompleteCrossContextCallback(InternalCrossContextDelegate ftnToCall, Object[] args)
at System.Threading.Thread.InternalCrossContextCallback(Context ctx, IntPtr ctxID, Int32 appDomainID, InternalCrossContextDelegate ftnToCall, Object[] args)
at System.Runtime.Remoting.Channels.CrossContextChannel.SyncProcessMessage(IMessage reqMsg)
at System.Runtime.Remoting.Proxies.RemotingProxy.CallProcessMessage(IMessageSink ms, IMessage reqMsg, ArrayWithSize proxySinks, Thread currentThread, Context currentContext, Boolean bSkippingContextChain)
at System.Runtime.Remoting.Proxies.RemotingProxy.InternalInvoke(IMethodCallMessage reqMcmMsg, Boolean useDispatchMessage, Int32 callType)
at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(IMessage reqMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at SoftPro.Select.Automation.EnvICE.Start()
at SoftPro.Select.Automation.EnvICE.Run(String rootSuffix, Boolean noSplash, Boolean setupMode, Boolean log, Boolean embedding, Boolean allowMultipleInstances, Boolean detectLeaks, Dictionary`2 args, String freeArg)
at SoftPro.Select.Program.Main(String[] args), Result=OK
User avatar
EverettSorrells
Posts: 3
Joined: Wed Jun 27, 2018 11:31 am

Re: Invalid Assembly marked for discovery error

Post by EverettSorrells »

Hello Chris,

Thank you for the question!

If you don't mind, assuming it is a ShellPackage this is being called from, could you send a code-snippet causing the problem? I will attempt to reproduce the problem myself, and I have some ideas of the issue at hand, but getting the source code would benefit greatly.

The error is in fact a Select TraceError, not MS based, and a curious one because with that error, I would expect there to be a filename associated, as seen here where the error is occurring:

Code: Select all

Trace.TraceError("Invalid assembly marked for discovery: " + fileName);
Regards,
Everett Sorrells
Software Developer


‘If debugging is the process of removing bugs, then programming must be the process of putting them in’
chris.brady
Posts: 105
Joined: Wed Oct 17, 2012 4:20 pm

Re: Invalid Assembly marked for discovery error

Post by chris.brady »

Correct, it's called from a shell package.

It's pretty basic. It breaks at _spShell.OpenStandardEditor(orderMoniker), where _spShell is the Shell object.

Code: Select all

        public void OpenOrder(Guid orderId)
        {
            var oId = new OrderIdentifier(orderId);
            OpenOrder(oId);
        }
        public void OpenOrder(OrderIdentifier orderId)
        {
            try
            {
                if (_cursor != null)
                    _cursor = Cursors.WaitCursor;

                var orderMoniker = new OrderUri(OrderKind.Order, orderId);

                _spShell.OpenStandardEditor(orderMoniker);

            }
            catch (Exception ex)
            {
                Log.Error(ex, orderId.Guid.ToString());
                ex.Show();
                throw; //rethrowing becuase we cannot recover at this point
            }
            finally
            {
                if (_cursor != null)
                    _cursor = Cursors.Default;
            }
        }
User avatar
EverettSorrells
Posts: 3
Joined: Wed Jun 27, 2018 11:31 am

Re: Invalid Assembly marked for discovery error

Post by EverettSorrells »

Hmm okay, nothing seems too outrageous with that operation...

What the problem appears to be is that on the first call to open an order, it has to load the assemblies and afterwards caches that information for quicker access to open/create orders. They are read directly from a file called 'Softpro.snapsections', located on typical installs under [C:\Program Files (x86)\SoftPro\Select]. For some reason, there may be a problem with either that file (which I believe is more likely the case), or the location of that file vs. your Select application.

If it is in that location, could you open that with a text editor and return the entire results, with any whitespaces/extra empty lines if any?
Everett Sorrells
Software Developer


‘If debugging is the process of removing bugs, then programming must be the process of putting them in’
chris.brady
Posts: 105
Joined: Wed Oct 17, 2012 4:20 pm

Re: Invalid Assembly marked for discovery error

Post by chris.brady »

Come to think of it, we recently installed some custom snap section work we got from SoftPro.
Looking at the .Snapsections file, and noting your request for everything, including blank lines, I noticed there was a blank line at the end of the file. Deleting that blank line got rid of the problem.
User avatar
EverettSorrells
Posts: 3
Joined: Wed Jun 27, 2018 11:31 am

Re: Invalid Assembly marked for discovery error

Post by EverettSorrells »

Yep, that'll do it! Glad to hear it was as simple as that!

If you have any other problems, let me know and I'll respond ASAP!

Regards,
Everett Sorrells
Software Developer


‘If debugging is the process of removing bugs, then programming must be the process of putting them in’
Post Reply