I have a program that takes in parameters and executes a Stimulsoft report. When the utility is run from Visual Studio everything works as expected, but when the utility is run on its own I get an exception. The event log shows that it cannot load System.Data.dll. Here is the event log details.
jmill: System.IO.FileNotFoundException: Could not load file or assembly 'System.Data.Dll' or one of its dependencies. The system cannot find the file specified.
File name: 'System.Data.Dll'
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at Stimulsoft.Base.StiAssemblyFinder.GetAssembly(String assemblyName)
at Stimulsoft.Report.StiReport.GetReferencedAssemblies()
at Stimulsoft.Report.StiReport.Compile(String path, Stream stream, StiOutputType outputType, Boolean autoCreate, Object standaloneReportType)
at Stimulsoft.Report.StiReport.Compile(String path, Stream stream, StiOutputType outputType, Boolean autoCreate)
at Stimulsoft.Report.StiReport.Compile(String path, StiOutputType outputType, Boolean autoCreate)
at Exec_Report.Exec_Report.RunReportExec() in C:\Utilities\Stimulsoft Command Line\Exec_Report\Exec_Report.cs:line 468
=== Pre-bind state information ===
LOG: User = NJ\jmill
LOG: DisplayName = System.Data.Dll
(Partial)
LOG: Appbase = file:///C:/Projects/Testing/
LOG: Initial PrivatePath = NULL
Calling assembly : Stimulsoft.Base, Version=2011.1.1000.0, Culture=neutral, PublicKeyToken=ebe6666cba19647a.
===
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v2.0.50727\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Projects/Testing/System.Data.Dll.DLL.
LOG: Attempting download of new URL file:///C:/Projects/Testing/System.Data.Dll/System.Data.Dll.DLL.
LOG: Attempting download of new URL file:///C:/Projects/Testing/System.Data.Dll.EXE.
LOG: Attempting download of new URL file:///C:/Projects/Testing/System.Data.Dll/System.Data.Dll.EXE.
Strange Exception
Strange Exception
Hello,
We found some strangeness in work of .NET Framework 4.0. In some cases, the compiled project cannot load the System.Data.dll system library, although the link to the library project is added.
You should do the following to solve this problem:
in start of your application please add the following lines of code:
This lines of code will be force to load System.Data library in the memory.
Thank you.
We found some strangeness in work of .NET Framework 4.0. In some cases, the compiled project cannot load the System.Data.dll system library, although the link to the library project is added.
You should do the following to solve this problem:
in start of your application please add the following lines of code:
Code: Select all
using System.Data;
....
DataSet ds = null;
Thank you.
Strange Exception
Thanks! That seems to be working - thanks again.
Strange Exception
Hello,
Great!
Thank you.
Great!
Thank you.