Wrong Paths in StiRibbonDesignerControl

Stimulsoft Reports.NET discussion
Post Reply
OC-Thorsten
Posts: 31
Joined: Thu Jul 16, 2015 12:22 pm

Wrong Paths in StiRibbonDesignerControl

Post 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
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Wrong Paths in StiRibbonDesignerControl

Post 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.
OC-Thorsten
Posts: 31
Joined: Thu Jul 16, 2015 12:22 pm

Re: Wrong Paths in StiRibbonDesignerControl

Post 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!
Attachments
WindowsFormsApplication4.zip
(99.3 KiB) Downloaded 157 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Wrong Paths in StiRibbonDesignerControl

Post 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.
Post Reply