In what directory does Visual Studio look for referenced file?

Posted on 2006-04-20
Last Modified: 2010-04-16

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"?


Question by:ba272
    LVL 13

    Assisted Solution

    same with your executable file directory
    LVL 4

    Expert Comment

    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";

    LVL 4

    Accepted Solution


    that should read:

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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
    This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    759 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

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now