StrataFrame Forum

Inherited UI Toolbox problem ...

http://forum.strataframe.net/Topic32340.aspx

By Charles Thomas Blankenship - 12/31/2013

Question 1:

I've recompiled the components of StrataFrame and the Inherited UI (for DevExpress) projects to Framework 4.5 ... and up until this morning everything was working as expected (since May 2013 actually) ... however, today, the only component that appears in the StrataFrame Inherited UI toolbox is the BrowseDialog.

So, I deleted the toolbox tab, created a new one, added components ... selected MicroFour StrataFrame Inherited UI.dll, sorted by the Namespace column and the list of available items in that .dll is in fact comprised of only the BrowseDialog from the MicroFour.StrataFrame.UI.Windows.Forms.DevEx namespace.  Why would only one component in the project, located in a different folder (DevExpress Extended) than the other ones (DevExpress), be the only available component in the dll?

Odd ... in any event ... here is the information in the Output window:


------ Rebuild All started: Project: MicroFour StrataFrame Inherited UI, Configuration: Release Any CPU ------

MicroFour StrataFrame Inherited UI -> C:\Program Files (x86)\MicroFour\StrataFrame Source Code\MicroFour StrataFrame Inherited UI\bin\Release\MicroFour StrataFrame Inherited UI.dll

Microsoft (R) .NET Global Assembly Cache Utility. Version 3.5.30729.1

Copyright (c) Microsoft Corporation. All rights reserved.

Failure adding assembly to the cache: This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

Question 2:  Why does the above error message appear when all of the SF projects are rebuilt?  This has bugged me for a while now.

1 file(s) copied.

1 file(s) copied.

========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========


http://www.dropbox.com/s/hd5ayjn6x4x7hke/DevExpressStrataFrameInherited.gif







By StrataFrame Team - 12/31/2013

The gacutil.exe has a new version for 4.0+ because the CLR runtime changed in .NET 4.0 and the location of the GAC changed (it's no longer defaulted to C:\Windows\Assembly, that's just for .NET 1.1 and 2.0).  So, you'll need to change the afterbuild.bat file to use the new gacutil.  Just edit it and change the path to the new one.  On my machine, the new gacutil is located in C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools.  Yours might be somewhere different.
By Charles Thomas Blankenship - 12/31/2013

That worked for the StrataFrame DevExpress Inherited UI ... but upon trying to run the application I go back to an older problem as shown in the diagram.

http://www.dropbox.com/s/zk2m9povpyeuxux/MethodAccessException.gif

Sorry to bug you guys so much today ... just when I think I've wrapped my head around some things ... reality rears its ugly head!
By StrataFrame Team - 12/31/2013

Ah, it looks like StrataFrameApplication.RunApplication() is what needs to be marked as SecurityCritical.  Since you're already compiling the source, try marking it and recompile it and see if that works.
By Charles Thomas Blankenship - 12/31/2013

Yes ... also ... modifying the following code in MicroFour StrataFrame / Business / BusinessLayer.vb rounded out the solution:




<SecurityCritical()>

Private Sub ISerializable_GetObjectData(ByVal info As System.Runtime.Serialization.SerializationInfo, ByVal context As System.Runtime.Serialization.StreamingContext) Implements System.Runtime.Serialization.ISerializable.GetObjectData

'-- Yadda ... yadda ... yadda

End Sub
By Charles Thomas Blankenship - 1/2/2014

As a follow up to this thread ... I also had to modify the My Project | AssemblyInfo.vb for the MicroFour StrataFrame Base modules with the following code.
  • <Assembly: AssemblyTitle("MicroFour StrataFrame UI")>
  • <Assembly: AssemblyDescription("UI component for the StrataFrame Application Framework")>
  • <Assembly: AssemblyCompany("MicroFour, Inc.")>
  • <Assembly: AssemblyProduct("MicroFour StrataFrame")>
  • <Assembly: AssemblyCopyright("Copyright © MicroFour, Inc. 2009 All Rights Reserved.")>
  • <Assembly: AssemblyTrademark("")>
  • <Assembly: AllowPartiallyTrustedCallers()>
  • <Assembly: SecurityRules(SecurityRuleSet.Level1)>
Here is a description of why ... http://msdn.microsoft.com/en-us/library/dd233102(v=vs.110).aspx