?
Solved

Where to place .snk files relative to VB.NET projects

Posted on 2003-10-25
6
Medium Priority
?
691 Views
Last Modified: 2008-03-17
Ok, I've officially had it with trying to work this out:

Let's say I have the following directory structure:

Programming
Programming\Solution
Programming\Solution\Project
Programming\Solution\Project\bin

Where Solution is the location of my .sln file, Project is the location of my .vbproj, and bin is where Visual Studio plonks the compiled binaries.

My problem is that every time I try something like this:

<Assembly: AssemblyKeyFile("Keyfile.snk")> ' Even with ..\ or ..\..\ preceeding the path

It won't usually compile.  I say usually, because sometimes it just decides to be nice to me and compile, while other times it will simply refuse to find the file.  I REALLY don't want to put the key files in an absolute location, but I can't for the life of me work out how to get VS.NET to find them.  I've tried putting the .snk files in the Solution, Project AND bin directories, all to no avail.

Ideally, I want to stick my .snk files in the Project directory, so can anyone tell me what I'm missing?

Thanks heaps.
0
Comment
Question by:foboldfky
[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
  • 3
  • 2
6 Comments
 
LVL 4

Expert Comment

by:brother7
ID: 9621818
0
 

Author Comment

by:foboldfky
ID: 9622339
Not quite... that uses absolute paths to reference the .snk file... I want to know how I can do it relative to where the project is.
0
 
LVL 2

Expert Comment

by:Inteliscape
ID: 9623401
this is what i use.  
<Assembly: AssemblyKeyFile(Application.ExecutablePath & "\Keyfile.snk")>
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

Author Comment

by:foboldfky
ID: 9625626
Hmm... tried
<Assembly: AssemblyKeyFile(Application.ExecutablePath & "\Keyfile.snk")>
but it says that Application is undefined.  I found it under System.Windows.Forms.Application, but it then said that a constant expression was required, so I have no idea how you get that to work... maybe my copy of VS just doesn't like me...
0
 
LVL 2

Accepted Solution

by:
Inteliscape earned 375 total points
ID: 9627121
ok i see what i done it was this line

<Assembly: AssemblyKeyFile("..\..\Keyfile.snk")>

where my Keyfile.snk is in the same path with the solution.
in my case solution and project are in the same folder under
Programming\Solution

but this is anyway the syntax so maybe you need to add or remove some ..\

hope it works now
0
 

Author Comment

by:foboldfky
ID: 9633159
Inteliscape, yours is probably the closest.

I actually tried this with two projects, both with identical Solutions/Project file layout.

One needed ..\Keyfile.snk
The other needed ..\..\Keyfile.snk

I am convinced that VS is just toying with me.

But, since you came closest, I'll give the points to you.

Maybe someday I'll actually work out why it's doing this...
0

Featured Post

Quiz: What Do These Organizations Have In Common?

Hint: Their teams ended up taking quizzes, too.

Question has a verified solution.

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

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

762 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