It's weird here.
After renaming the class, one of my forms began to give me errors in the designer, refusing to open. It's funny that the form worked great when I ran the program.
I started to revert my changes to get the issue out. Now I will fully return to the last commit - in which I know the form that works in the designer - cleared the solution and deleted bin / and obj / folders, as well as *. suo file for a good rating.
The form is not yet displayed in the designer.
Here are the errors he gives:
- Could not find "MyNamespace.MyControl". Make sure that the assembly containing this type is referenced. If this type is part of your development project, make sure that the project has been successfully created.
- The variable "myControl1" is either not declared or has never been assigned.
The variable is declared and assigned, and MyControl builds fine (again, the form works fine when the program actually runs). Even stranger, if I try to create a new form and drag MyControl onto it, I get this Entity-Framework error:
"MyControl". : 'System.ArgumentException: , EntityClient, . System.Data.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString) System.Data.EntityClient.EntityConnection..ctor(String connectionString) System.Data.Objects.ObjectContect.CreateEntityConnection(String connectionString) .. ..
: , , , , ( ).
? .
[]
:
MyControl.cs
public MyControl()
{
_entities = new MyEFEntities();
}
MyForm.Designer.cs
private void InitializeComponent()
{
this.myControl1 = new MyNamespace.MyControl();
...
this.Controls.Add(this.myControl1);
}
MyEFDatabase.Designer.cs
public MyEFEntities() : base("name=MyEFEntities", "MyEFEntities") { ... }
App.Config
<connectionStrings>
<add name="MyEFEntities" connectionString="metadata=res://*/MyEFDatabase.csdl|res://*/MyEFDatabase.ssdl|res://*/MyEFDatabase.msl;provider=System.Data.SqlClient;provider connection string="Data Source=MyDatabaseServer;Initial Catalog=MyDatabase;Integrated Security=True;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />
</connectionStrings>
"replace " with '" - .
[Edit2] , . ( - " ", EF ), , .