[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework

How to find one executable from another

Gregory Khra

7/22/2008 5:28:00 PM

I need to use the namespace defined in file1.exe in the file2.exe. So far it
worked as long as both files were in the same folder. Now I need to move one
of them. I added app.config (below) to the second file with the following
text, but it did not work. Can somebody help? Maybe there is another way to
discover file1.exe from file2.exe at runtime (file1 path is available)

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="file1"/>
<codeBase version="1.42.6.0"
href="C:\mypath\file1.exe"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

Note: assembly name and version are correct.

2 Answers

Cowboy

7/24/2008 1:53:00 PM

0

I am not sure I understand. Why can't you move a local copy of the assembly
to the other project?

Also, since both of these are exes, are you trying to get one to run from
the other or just using its bits?

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces...list...

or just read it:
http://gregorybeamer.spaces...

********************************************
| Think outside the box! |
********************************************
"Gregory Khra" <GregoryKhra@discussions.microsoft.com> wrote in message
news:0163378E-C793-4548-B929-F19508313FFC@microsoft.com...
>I need to use the namespace defined in file1.exe in the file2.exe. So far
>it
> worked as long as both files were in the same folder. Now I need to move
> one
> of them. I added app.config (below) to the second file with the following
> text, but it did not work. Can somebody help? Maybe there is another way
> to
> discover file1.exe from file2.exe at runtime (file1 path is available)
>
> <?xml version="1.0" encoding="utf-8" ?>
> <configuration>
> <runtime>
> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
> <dependentAssembly>
> <assemblyIdentity name="file1"/>
> <codeBase version="1.42.6.0"
> href="C:\mypath\file1.exe"/>
> </dependentAssembly>
> </assemblyBinding>
> </runtime>
> </configuration>
>
> Note: assembly name and version are correct.
>

GregKhrapunovich

7/24/2008 3:11:00 PM

0

"Cowboy (Gregory A. Beamer)" wrote:
> Why can't you move a local copy of the assembly
> to the other project?

I am trying to reuse the object from one project in another project. Moving
this object into a DLL will involve serious redesign because it refers to
other objects that cannot be moved. For the same reason I cannot reuse the
source code. But I can simply use the namespace from the first project (first
..exe) in the second .exe, it allows me to create the object I need. At design
time I inlude the reference in my second project, but at runtime I need
something else, like .config.
P.S. Something was wrong with my profile, it would not let me reply. I had
to create a different profile, but it's still the same person.