Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 959497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:02:20+00:00 2026-05-16T01:02:20+00:00

I have created a custom control using VB.NET in Visual Studio 2008 that gives

  • 0

I have created a custom control using VB.NET in Visual Studio 2008 that gives extensive mapping and tracking functionality to a search and rescue app. The problem I am having is that in a number of places I need to define the path to the main applications executable in order to find a number of directories the control needs to function properly. Everything works fine when I am using it in VS but when I try to embed the control in a form in a separate solution I get the following error:

Failed to create component
‘MainControl’. The error message
follows:
‘System.IO.DirectoryNotFoundException:
Could not find a part of the path
‘C:\Program Files\Microsoft\Visual
Studio
9.0\Common\IDE\GIS\Data\Default…

This seems to indicate that it is looking for the \GIS\Data\Default directory in the Visual Studio program path but I have used Application.StartupPath to define this location throughout the control.

This error only occurs when attempting to embed the control in a form outside of the controls solution. The solution I have created to develop this control has two projects (one for the control and one for a test form to do the debuging)

Can anyone provide me with some guidance on this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T01:02:21+00:00Added an answer on May 16, 2026 at 1:02 am

    This will happen when your control executes code while it is being used in the designer. It does, stuff like the constructor, Load event, Paint event, etcetera will run when you drop the control on a form in Visual Studio.

    You need to use the DesignMode property to prevent this code from running, and crashing, when the current working directory is wrong. It will be wrong in the designer, the working directory is Visual Studio’s, not the app’s in which it will eventually be used. Or use absolute paths, not relative paths.

    If that doesn’t help, how to debug design time problems is explained here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application that was started in C# 1.0 using Visual Studio .NET.
I have a custom VB.NET control that I created that is working correctly in
Basically, I have created a custom control that uses an UpdatePanel, and as I
I am using ASP.NET MVC 2 & .Net 3.5 with Visual Studio 2008. Ok,
I have created a custom control inheriting from a panel in .NET 3.5 The
I have created a custom tree view control in .NET to display directories. What
I have created a custom control but I can't bind a property to the
We're writing an application for Windows tablet PCs. I have created a custom control
I have created a Dynamic View Panel custom control and want to add a
I am working on a custom control and have created a property in property

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.