----- Original Message -----
From: "Martin Riedl" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 08, 2004 6:32 PM
Subject: [Nant-users] Problem with Dll-Dependencies


> Hi,
>
>
>
> i have a 4 Projects, 3 of them compiling to a Dll one to a
Windows-Form-exe.
>
>
>
> I would like to place the Dlls in a subdirectory called \lib to the exe
> File. Compilation runs without errors, but when I start my application it
> crashes because the exe - file can't find the one Dll in the lib-Dir it
> needs. It always searches for the appropriate File in the same Path as the
> exe.
>
>
>
> This is my build-file:
>
>
>
> <project name="ExpGUI" default="rel">
>
>             <property name="basename" value="ExpGUI"/>
>
>             <property name="debug" value="false"/>
>
>
>
>             <target name="clean">
>
>                         <delete>
>
>                                    <fileset>
>
>                                                <include
> name="bin\Debug\${basename}.exe"/>
>
>                                                <include
> name="bin\Debug\${basename}.pdb"/>
>
>                                                <include
> name="bin\Debug\Common.dll"/>
>
>                                                <include
> name="bin\Debug\Common.pdb"/>
>
>                                                <include
> name="..\..\current\${basename}.exe"/>
>
>                                    </fileset>
>
>                         </delete>
>
>             </target>
>
>
>
>             <target name="rel">
>
>                         <csc target="winexe"
> output="..\..\current\${basename}.exe" debug="false">
>
>                                    <sources>
>
>                                                <include name="*.cs"/>
>
>                                                <exclude name="Form4.cs"/>
>
>                                    </sources>
>
>                                    <resources>
>
>                                                <include name="*.resx"/>
>
>                                    </resources>
>
>                         </csc>
>                         <copy file="..\..\current\lib\gdpduExpCommon.dll"
> tofile="..\..\current\gdpduExpCommon.dll"/>
>                         <copy file="..\..\current\lib\SAP.Connector.dll"
> tofile="..\..\current\SAP.Connector.dll"/>
>             </target>
>
> This is how it works - but I don't like to copy the files to the BaseDir
of
> the exe-File like I do at the end.
>
>
>
> I already tried with references and lib tags but don't get it to work -
any
> help?

I'm confused here, you are talking about a runtime issue, not a build issue
(right?).  I don't see how references or libs might help you when running
your application.

When you want to instruct the .NET runtimeto locate assemblies in a
subdirectory (eg. lib) of the base directory (of your application), you
should add the following section to your application configuration file :

<configuration>
    ....
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <probing privatePath="lib" />
        </assemblyBinding>
    </runtime>
    ....
</configuration>

> Thanks - and sorry - I just started with Nant today - because
VS-Compilation
> sucks.

No problem ...

> By the way - I already tried an tlbimp-task - but Nant can't execute it.

What error do you get ?

Gert



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Nant-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to