Problems loading DLL from C:\Program Files (x86) subdirectory.
At my company we are using LINQPad to deliver a DSL environment. The DSL depends on numerous custom DLLs that we develop internally. We don't have an internal NuGet server, but all the needed DLLs are present in the parent (to the DSL) application. Our current solution is to generate a "skeleton" .linq file and then have our engineers add the need code (mostly LINQ query on data in a safe environment), in LINQPad.
Generated .linq Files look like:
<Query Kind="Program">
<Connection>
<ID>26bdc913-63f5-45b1-a19b-e3d446275127</ID>
<Persist>true</Persist>
<Driver>EntityFrameworkDbContext</Driver>
<CustomAssemblyPath>C:\Program Files (x86)\[Company]\[Project]\\[EfModel].dll</CustomAssemblyPath>
<CustomTypeName>[Company].ModelNameSpace.ModelContext</CustomTypeName>
<AppConfigPath>C:\Program Files (x86)\[Company]\[Project]\[App].config</AppConfigPath>
<DisplayName>DoNotUse</DisplayName>
</Connection>
<Reference>C:\Program Files (x86)\[Company]\[Project]\\[DDL1].dll</Reference>
<Reference>C:\Program Files (x86)\[Company]\[Project]\\[DDL2].dll</Reference>
<Reference>C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll</Reference>
<Namespace>[Company].[Namespace1]</Namespace>
<Namespace>[Company].[NameSpace2]</Namespace>
<Namespace>[Company].[Project].LinqPadEnvironment</Namespace>
</Query>
DataTable Main()
{
SetupEnvironment();
DslEnvironment.Quite(false);
using(var data = MeasurementData.GetData(76611))
{
//Code Goes Here
}
}
This Previously worked on LINQPad 4.55 but does not work under LINQPad 4.57.2 (current version)
LINQPad fails with an index out of bounds error, which also happens when the .linq file is generated with a wrong reference. If location of the DLLs is moved outside of C:\Program Files (x86)\ then everything works.
Using LINQPad 4.55 with -noupdate also works, but we will like have maintenance issues with this solution.
When 4.55 or 4.57 save changes to the generated file the reference change to the form
<Reference><ProgramFilesX86>\[Company]\[Project]\\[DDL1].dll</Reference>
which I suspect might be part of the problem.
Any help/bug fixes, other than switching to NuGet to deliver the code?
Thanks In Advance.
Comments
Thanks
The is because I am using AppDomain.CurrentDomain.BaseDirectory for the file location generation. The program in not always run in the same directory under development. I want to switch to an Internal NuGet server for infrastructure, but we are not ready yet to do it.
* Date/time
* LINQPad Version
* OS Version
* Framework Version
* Core count
* Exception type name
* Exception message
* Exception stack trace
* Any notes you type into the box provided
The LINQ query is not included, nor any of your references.
Thanks!
I have include a bug report with a reference to this discussion.