Solved

how dynamically change path of strong name key file in windows form

Posted on 2006-10-23
7
223 Views
Last Modified: 2012-05-05
Using .net 1.1, windows forms

I created an assembly/dll and placed it in the global assembly cache. In the assemblyInfo file I have to put the path to the strong name key file like so:

<Assembly: AssemblyKeyFile("C:\My Documents\MyDll\bin\MyDll.snk")>

How can I dynamically set this path at runtime?

Thanks

San
0
Comment
Question by:Sanmarie
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 9

Expert Comment

by:DjDezmond
ID: 17789443
What will decide what the path will be?

You can set a global variable, and whenever your app knows what the path will be, set it to that?

Or will that file 'follow' your app wherever its installed? if so, you can use 'application.startuppath'
0
 

Author Comment

by:Sanmarie
ID: 17789574

The problem was when I created the strong name key, I set the path to it on my machine. When my co-worker installed it, he got an error saying key not found because he didn't have the path set up.

I want the path to be independent of the machine. I just don't know how to go about it. How do I use application.startuppath?

Thanks

San
0
 
LVL 9

Accepted Solution

by:
DjDezmond earned 500 total points
ID: 17789890
Application.StartupPath = the path the executable is run from.

If your exe is in C:\MyApp\ and the DLL is in c:\YourApp\Dll then you would use:

Application.StartupPath & "\Dll\MyDll.snk"

And it would equate to:

C:\YourApp\Dll\MyDll.snk

It wouldn't matter what machine your using, or where the exe path is, as long as your DLL is always in the DLL directory of your Application directory (if that makes sense!?)
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 9

Expert Comment

by:DjDezmond
ID: 17789895
sorry... C:\MyApp and C:\YourApp were meant to be the same directory... typo there lol
0
 

Author Comment

by:Sanmarie
ID: 17790490

Thanks

I will try it out later and post a new question if any doubts
0
 
LVL 9

Expert Comment

by:DjDezmond
ID: 17794280
If you have any doubts/queries... just post in this thread. Ill carry on answering until its working.

Dez
0
 

Author Comment

by:Sanmarie
ID: 17795531

Will do today if any problems.

Thanks

San
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

631 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question