Home
Options

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

  • Options
    Have you reported the IndexOutOfRangeException? I can't see it in the logs.

    Thanks
  • Options
    Also, is there any reason that you don't use <ProgramFilesX86>\? This is the tokenized form, which is preferable.
  • Options
    The none reporting is because, we have client and internal confidential data involved with this program, so in general I don't want to autopost data collection, if I don't know what data is being sent. Mostly likely I am being paranoid in this case. If you could give a list about what is sent I will make an attempt do so. I assume that the entire .linq file is part of packet, and I can easily sanitize that, but are any of the referenced files sent?

    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.
  • Options
    If you choose to submit an error report, it posts:

    * 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!
  • Options
    Thanks Joe,

    I have include a bug report with a reference to this discussion.
Sign In or Register to comment.