• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 214
  • Last Modified:

In what directory does Visual Studio look for referenced file?

Hi,

I need to add a bitmap file to MapPoint, and would like to reference it by its short name, not a fulp path name.  Where could I place it so that VS can find it simply by name, such as "myBitmap.bmp"?

Thanks,
Bob

0
ba272
Asked:
ba272
  • 2
2 Solutions
 
dunglaCommented:
same with your executable file directory
0
 
SmithJWCommented:
To reference by just name it must be in the same folder as the exe AKA the Application Folder.

However, when running in debug mode, the path for Application Folder is not necesarily the same as the .exe path (other things can cause this to change too), therefore its better to specify the path relative to the EXE as follows:

String TheBitmapLocation = Application.ExecutablePath + "myBitmap.bmp";



0
 
SmithJWCommented:
apologies

that should read:

String TheBitmapLocation = Application.StartupPath + "myBitmap.bmp";
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now