none
Form Designer (Could not load file or assembly.... The system cannot find the file specified)

    Question

  • Hi everybody,

    I have a really annoying problem:

    Create 2 forms
    Form1and Form2 in a WindowsFormsApplication1
    > Form1 is the Base Class of Form2
    > Form1 is referencing Class1 a simple class from a library ClassLibrary1.

    Open the form Designer for
    Form2 (Do not open the designer for Form1). Close Visual studio 2008.
    Reopen the solution with this opened
    Designer.

    =>>
    Could not load file or assembly 'ClassLibrary1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

    The problem is really boring when you work on a big project and let opened forms in designer.

    Sorry for my English...
    I Am french...

    Thank you for your Help

    Cheers

    Loïc
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    using ClassLibrary1;

    namespace WindowsFormsApplication1
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }

            public Class1 Test
            {
                get
                {
                    return null;
                }
            }
        }
    }

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;

    namespace WindowsFormsApplication1
    {
        public partial class Form2 : Form1
        {
            public Form2()
            {
                InitializeComponent();
            }
        }
    }

    Friday, October 24, 2008 6:12 PM

All replies

  • Hi LoicBBBB

     

    This error is raised by the .Net Framework CLR. It indicates that the CLR cannot load the assembly. This error is mostly caused by the permission. Did you have full access to the assembly? Did you have more than one version of that Dll on your computer? Sometimes the different version reference of an assembly can caused the problem too.

     

    Sincerely,

    Kira Qian

    Monday, October 27, 2008 8:22 AM
  • Hi thanks for your answer Kira Qian,

    I have full access to the assembly and I have only one
    version of that Dll on my computer...

    My problem is linked to the fact that I let open the designer for the inherited form before I close VS2008...

    If I don't let the designer open before I close VS2008 I don't have the problem.... and the designer can be open without any problem.

    Maybe my problem is linked to a bad configuration of VS 2008 (I have SP 1) ???

    You can test really easily my bug as I described previously...

    If you don't have any problem it means that my installation of VS 2008 is corrupted ???

    I am a bit lost...

    Anyway,

    thanks a lot for your help....

    Cheers

    PS: If anyone could tell me if it is possible to reproduce my bug, it will help me...

    Monday, October 27, 2008 11:30 AM
  • Hi LoicBBBB

     

    Would you please send the error screenshot to me. Here is my email: v-kiqian@microsoft.com . Could you please create a new project which can reproduce this error to me so I can test if the reason is the corrupt installation of your Visual Studio.

     

    Sincerely,

    Kira Qian
    Tuesday, October 28, 2008 3:13 AM
  • Hi LoicBBBB,

     

    I have tested your project you have sent to me, I got the same error according to your steps. We did meet some similar case before, I think there is some problem with our product, sorry for any inconvenience. The only solution I found is keeping your base form(Form1) open in the designer will fix the problem temporarily. Then you can open the solution with Form2 being shown correctly. Please send this problem to the Microsoft Connect, so the product team will pay attention to it and plan to fix it in the future version. Thank you for your understanding.

     

    Sincerely,

    Kira Qian

    Friday, November 21, 2008 2:00 AM