Context.Designer.cs not generated

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
Posts: 4
Joined: Tue 16 Sep 2014 02:25

Context.Designer.cs not generated

Post by williamatwork » Wed 17 Sep 2014 21:16

Hi there,

Very frustratingly trying to get LinqConnect to work in my project (with Postgres), and I've noticed that there is no context.designer.cs ever generated by the process, which I suspect is the root of why I cannot access any data context class.

Following these steps: ... ml#prepare

I read that the code generated from the database-to-model should be generated automatically into DataContext1.Designer.cs. Unfortunately, that's never created for me.

I think that this causes this command:
CrmDemoDataContext context = new CrmDemoDataContext();

To fail (substituting of course my own context name).

Any help would be appreciated before I give up on this for good. :)


- William

Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Context.Designer.cs not generated

Post by MariiaI » Thu 18 Sep 2014 06:31

If you work with the model in Visual Studio, just save your model - the code is generated automatically when saving the model in Visual Studio if any of the templates is added to the model. When working in standalone Entity Developer, the code is generated by selecting Generate Code from the Model menu or by pressing F7.

Please perform the following steps:
1) expand the Templates node in Model Explorer - there should be at least one template, e.g. 'LinqConnect'.
If there is no template, please do the following steps:
- open the model (*.lqml file);
- expand the "Templates" node in Model Explorer;
- select "New Template" from the shortcut menu of the "Templates" node in Model Explorer and then select the "LinqConnect" template;
- save changes to generate the code for model.

2) select Properties from the shortcut menu of the *.lqml file and check that "Custom Tool" is set to DevartLinqToSQLGenerator.

After this, perform "Run Custom Tool" on your model - right-click the *.lqml file and select "Run Custom Tool".

If this doesn't help, please send us your model, so that we could investigate the issue in more details.

Post Reply