Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2006-10-23
7
Medium Priority
?
224 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 1500 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
Industry Leaders: 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!

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

722 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