Page 1 of 1

Wrong Paths in StiRibbonDesignerControl

Posted: Thu Jul 16, 2015 1:10 pm
by OC-Thorsten
Hello,

we implements the Demoversion of Stimulsoft Reports.Net and we want to buy the product.
But we got a error when we starts the StiRibbonDesignerControl:

Code: Select all

Failed Loading assembly "Stimulsoft.Report.Design\,Version\=2015.1.0\, Culture\=neutral\, PublicKeyToken\=ebe6666cba19647a\, Version\=2015.1.0.0\, Culture\=neutral\, PublicKeyToken\=ebe6666cba19647a" or one of it's dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)
   bei System.Reflection.AssemblyName.nInit(RuntimeAssembly& assembly, Boolean forIntrospection, Boolean raiseResolveEvent)
   bei System.Reflection.RuntimeAssembly.CreateAssemblyName(String assemblyString, Boolean forIntrospection, RuntimeAssembly& assemblyFromResolveEvent)
   bei System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)
   bei System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
   bei System.Reflection.Assembly.Load(String assemblyString)
   bei Stimulsoft.Base.StiAssemblyFinder.GetAssembly(String assemblyName)
   bei Stimulsoft.Report.Design.StiResourcesHelper..cctor()
Our program starts with a trivial starter.exe.
The starter.exe starts the main program with 'InvokeMember'. The main program is on a another directory (AppData).
That looks like this:

Code: Select all

Assembly asm = Assembly.LoadFrom(cpath);
Type t = asm.GetType("Assembly.Class");
Object ob = t.InvokeMember("Main", BindingFlags.InvokeMethod | BindingFlags.Static | BindingFlags.Public, null, null, new object[1] { new String[2] { "", "" } });
The error is in this line:

Code: Select all

Stimulsoft.Report.Design.StiRibbonDesignerControl ctr = new Stimulsoft.Report.Design.StiRibbonDesignerControl();
There is no error when we copy all dlls in the directory of the starter.exe.
But the dll must be placed in the directory of the main program. That works with all other libaries. Even with the stiViewerControl1.

In my opinion the designer is looking in the wrong directory for the other DLLs.
Where the designer brings this path?
We have already tried the following (gPath is the directory of the main program):

Code: Select all

Environment.CurrentDirectory = gPath;
Stimulsoft.Report.StiConfig.ApplicationDirectory = gPath;
Stimulsoft.Report.StiConfig.DefaultReportConfigPath = gPath;
Stimulsoft.Report.StiOptions.Configuration.DefaultReportConfigPath = gPath;
Stimulsoft.Report.StiOptions.Configuration.DefaultReportSettingsPath = gPath;
Many thanks for your help!
Thorsten

Re: Wrong Paths in StiRibbonDesignerControl

Posted: Fri Jul 17, 2015 11:54 am
by HighAley
Hello, Thorsten.

We made some improvements in Ribbon Designer. Could you try our latest build (2015.1.12)?
If you still get the error, please, send us a small sample project that reproduces the issue.

Thank you.

Re: Wrong Paths in StiRibbonDesignerControl

Posted: Tue Jul 28, 2015 9:00 am
by OC-Thorsten
Hi Aleksey,

we use the current final version (2015.1.0.0)
I have attached a very simple example.
The Startproject is WindowsFormsApplication5

Thank you!

Re: Wrong Paths in StiRibbonDesignerControl

Posted: Wed Jul 29, 2015 8:31 am
by HighAley
Hello.

As we see all Stimulsoft Assemblies have Copy Local property set to False.
If you set it to True, all assemblies are copied to bin directory of WindowsFormsApplication4 project and the application runs without errors.
If Copy Local is set to False, we build the solution then copy assemblies in WindowsFormsApplication4 bin folder and the project runs without errors. As well the project runs when we copy Stimulsoft assemblies to the WindowsFormsApplication5 bin folder.
If you don't copy asemblies in folder of application they should be instaled in GAC.
You could get more information about How the Runtime Locates Assemblies on the MSDN.

Thank you.