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?