Click here to Skip to main content
16,019,151 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I watn to create SETUP for vb.net window application. My application using multiple dll
so I want to keep dll in seprate folder and exe in seprate folder.

When I create set up dll and exe are in same (Application Folder of setup) then it works but when I create 2 different folder in Application Folder of setup one for dll and one for exe. then it not work please suggest how can I ?

Thanks
Posted

1 solution

If the reason for using separate directories for deployed product is having multiple DLLs, this is not very productive approach. Having it all in the same directory is usually the optimal approach.

However, there can be more advanced scheme. Imagine that you deploy some products optionally. You may want different products to go to different directories, but those products use the same common framework, which is also your product you supply with the application that the user installs first.

In this case, I can see two different approaches.

First of all, you can put all your libraries used by different products to the GAC. All your assemblies should be strongly named, but I would advise you a simple rule: always sign everything you ever deploy. Please see:

http://en.wikipedia.org/wiki/Global_Assembly_Cache[^],
http://en.wikipedia.org/wiki/Strong_key[^],

http://msdn.microsoft.com/en-us/library/yf1d93sz.aspx[^],
http://msdn.microsoft.com/en-us/library/ex0ss12c%28v=vs.100%29.aspx[^]
http://msdn.microsoft.com/en-us/library/wd40t7ad.aspx[^].

These CodeProject articles could also be useful:
Building Security Awareness in .NET Assemblies : Part 3 - Learn to break Strong Name .NET Assemblies[^],
Strong Names Explained[^].

Now, about the alternative approach:

If by some reason you don't want to mess with GAC (but again, give your assemblies string names anyway, signing is too easy to doubt), you can use alternative technique based on application configuration files.

If your main executable module of your entry assembly is named, say, "My.Application.exe", the configuration file name would be "My.Application.exe.config". It might look like this:

XML
<configuration>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <probing privatePath="..\My.Libraries\Assemblies"/>
        </assemblyBinding>
    </runtime>
</configuration>


This way, you can indicate the common relative path (relative to the location of the main executable module of each entry assembly) different for different applications but pointing to the same commonly used path used for location of your framework library assemblies. You could also use absolute path, but I usually recommend relative paths for better flexibility and the ease of transfer between different systems.

—SA
 
Share this answer
 
v5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900