Print Page | Close Window

Unable to locate an 'IdeaBlade.ibconfig' or 'app.config' file

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=657
Printed Date: 11-Jun-2026 at 9:18am


Topic: Unable to locate an 'IdeaBlade.ibconfig' or 'app.config' file
Posted By: Tich
Subject: Unable to locate an 'IdeaBlade.ibconfig' or 'app.config' file
Date Posted: 15-Jan-2008 at 3:09am

I formatted my pc reinstalled everything and now devforce based forms wont open in the designer the project can compile and run with no error. I only get the error when I try to open the form in the designer (VS 2005).  This problem only started after I reinstalled windows. The error I get  is given below...
 

Unable to locate an 'IdeaBlade.ibconfig' or 'app.config' file on 'LIL3P-MOBILE' It must be either (a) an embedded resource in the startup project or (b) present in the same directory as the executable. Please consult the Help files for more information. Probing path: File: C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.exe.config - not found File: C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\MSTest.exe.config - not found File: C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PEVerify.exe.config - not found File: C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\VSTestHost.exe.config - not found File: a loose configuration file - not found File: C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\IdeaBlade.ibconfig - not found Design-time execution detected - Will not probe for app.config or IdeaBlade.ibconfig in AppHelper IdeaBlade.ibconfig fallthru - Default IdeaBlade.ibconfig used Logging file:

Hide    

 

at IdeaBlade.Util.IdeaBladeConfig.AssertNonDefaultVersion()

at IdeaBlade.Persistence.PersistenceManager..ctor(Boolean pShouldConnect, String pDataSourceExtension, PersistenceServiceOption pPersistenceServiceOption)

at IdeaBlade.Persistence.PersistenceManager.get_DefaultManager()

at SST_APP.Main_Module.Forms.BasicFormORM..ctor() in D:\Lil3p\Software Development Projects\Projects\MAS\MAS\Main Module\Forms\BasicFormORM.cs:line 28  



Pliz help ! 

 

 




Replies:
Posted By: davidklitzke
Date Posted: 15-Jan-2008 at 8:59am
You have run into a well-known problem which occurs when your code tries to access the PersistenceManager when you are using Visual Studio and running in Design Time.  As you have discovered, your code runs just fine while executing during runtime.
 
You are probably trying to access the PersistenceManager during the Form constructor or the Load Event for the Form.
 
The solution for this problem is to use the DesignMode property of the Form or User Control.  If DesignMode is true, you cannot try to accsss the PersistenceManager.  If DesignMode is false (which means that you are running in runtime), you have no such restriction.
 
This solution works for simple cases.  Let me know if you have a more complicated case (User Control inside of a User Control).


Posted By: Tich
Date Posted: 16-Jan-2008 at 12:28am

After doing some googling no the forum I discovered that I should do something like …

 

public BasicFormORM()

  :base()

{

    InitializeComponent();

 

    if(!this.DesignMode)

    {

pemManager=PersistenceManager.DefaultManager;

          enlEntity = new EntityList<Entity>();

    }

 

}

 

… but still this didnt work. I have a base form ‘BasicFormORM()’ which provides some basic form services like…

 

private void BasicFormORM_FormClosed(object sender, FormClosedEventArgs e)

{

  try

  {

     thisEntity.RejectChanges();

  }

  catch

  {

 

  }

}

 

…all other forms inherit from this the base form ‘BasicFormORM()’ it is these child forms that wont open the base form opens even if I don’t  use    if(!this.DesignMode).

 

After a bit of testing I confirmed that the problem is occurring because of trying to access the persistence manager from the constructor however using the DesignMode property to prevent this access is not working

Also this problem only started after a formatted my pc

 

Thanks



Posted By: davidklitzke
Date Posted: 16-Jan-2008 at 8:12am
DesignMode doesn't always accurately describe whether you are in DesignMode or not.  There are many articles on the web about this.  My favorite is:

http://weblogs.asp.net/fmarguerie/archive/2005/03/23/395658.aspx - http://weblogs.asp.net/fmarguerie/archive/2005/03/23/395658.aspx

If "if(!this.DesignMode){" doesn't work for you,  I suggest trying:
 
if (System.Diagnostics.Process.GetCurrentProcess().ProcessName != "devenv") {

 



Posted By: Tich
Date Posted: 17-Jan-2008 at 6:02am

Thanks for the help I eventually solved the problem by adding a boolean property to one of my static Utils classes my main method now looks like this

Utils.AllowGetPersistenceManager = true;

Application.Run(new frmLogin());

 

the load method of base form is now as show below

if (Utils.AllowGetPersistenceManager == true)

{

pemManager = PersistenceManager.DefaultManager;

     enlEntity = new EntityList<Entity>();             

}

...

 

I think this is the best solution because it gives you total control on whether the PersistenceManager is created or not

again thanks for pointing me in the right direction



Print Page | Close Window