Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I use VB2008.
I am developing a main application which consists of forms, and usercontrols contained in a separate project which I compile into omctl.dll
In the main application I reference omctl.dll, and its usercontrols appear in the toolbox. I have added various controls onto the forms in the main application which has been set to run a form OM. OM shows in the designer, but when I run the app, I get the following message:-

System.InvalidOperationException was unhandled
  Message="An error occurred creating the form. See Exception.InnerException for details.  The error is: Could not load file or assembly 'omctl, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified."
  Source="om"
  StackTrace:
       at OM.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190
       at OM.My.MyProject.MyForms.get_Manager()
       at OM.My.MyApplication.OnCreateMainForm() in D:\Visual Studio 2008\Projects\MyApp\My Project\Application.Designer.vb:line 35
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
       at OM.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.IO.FileNotFoundException
       Message="Could not load file or assembly 'omctl, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified."
       Source="om"
       FileName="omctl, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
       FusionLog="=== Pre-bind state information ===\r\nLOG: User = Stuart-PC\\Stuart\r\nLOG: DisplayName = omctl, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null\n (Fully-specified)\r\nLOG: Appbase = file:///D:/Visual Studio 2008/Projects/MyApp/bin/Debug/\r\nLOG: Initial PrivatePath = NULL\r\nCalling assembly : om, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.\r\n===\r\nLOG: This bind starts in default load context.\r\nLOG: Using application configuration file: D:\\Visual Studio 2008\\Projects\\MyApp\\bin\\Debug\\om.vshost.exe.Config\r\nLOG: Using 
machine configuration file from C:\\Windows\\Microsoft.NET\\Framework64\\v2.0.50727\\config\\machine.config.\r\nLOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).\r\nLOG: Attempting download of new URL file:///D:/Visual Studio 2008/Projects/MyApp/bin/Debug/omctl.DLL.\r\nLOG: Attempting download of new URL file:///D:/Visual Studio 2008/Projects/MyApp/bin/Debug/omctl/omctl.DLL.\r\nLOG: Attempting download of new URL file:///D:/Visual Studio 2008/Projects/MyApp/bin/Debug/omctl.EXE.\r\nLOG: Attempting download of new URL file:///D:/Visual Studio 2008/Projects/MyApp/bin/Debug/omctl/omctl.EXE.\r\n"
       StackTrace:
            at OM.Manager..ctor()
       InnerException: 

I cannot even get to the New subroutione. It fails on F8 as well as F5

by the way - omctl.dll exists but not omctl.exe


Any help?
Posted
Updated 23-Mar-11 4:31am
v2

1 solution

0) Have you actually added a reference to omctl.dll to your application?

1) Does it rely on a 3rd party assembly that could be fouling up the works?

2) Some 3rd party stuff requires that you compile youor app as x86 instead of "Any CPU".
 
Share this answer
 
Comments
Stuart Nathan 23-Mar-11 11:22am    
0) Yes
1) No
2) My code and running o0n any CPU

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900