Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / May 2004

Tip: Looking for answers? Try searching our database.

How to reference a file in the project itself in VS.NET?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bob - 17 May 2004 17:59 GMT
In a VS.NET project, is it possible to reference a file in relative path?
My immediate problem is that I want to add a key file into Assemebly.cs.  I
have the .snk file in the project so I'd like to avoid adding the entire
absolute path in Assembly.cs.

Thanks a bunch for any help
Bob
Christopher Kimbell - 17 May 2004 19:20 GMT
Just add the apropriate "..\\..\\" in front of the filename.

Tip: Use @ in front of the string, then you don't have to escape it. E.g.
@"..\..\filename.snk"

The filename is relative to where the output files are located, just try a
path, if it doesn't find it will give an error, then try again.

Chris

> In a VS.NET project, is it possible to reference a file in relative path?
> My immediate problem is that I want to add a key file into Assemebly.cs.  I
[quoted text clipped - 3 lines]
> Thanks a bunch for any help
> Bob
.NETDave - 17 May 2004 23:46 GMT
You don't need to put in the entire path. Just the path it needs from the bin directory. For my projects my key file looks like this

[assembly: AssemblyKeyFile("..\\..\\my.key")

David McCarte
www.vsdntips.com

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.