Relative Path Model Attributes and Imports namespace paths wrong.

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
peterharris
Posts: 13
Joined: Fri 03 Jan 2014 11:13

Relative Path Model Attributes and Imports namespace paths wrong.

Post by peterharris » Thu 27 Feb 2014 22:30

I understand that in Model Settings -> Model -> Attributes I can load assemblies and then their attribute classes, so I can assign those attribute(s) to entity properties, which works great. I've been able to add assemblies from the GAC or browse to one manually, but I have not been able to add an assembly by its path relative to the project or the LQML model.

The reason why I need this is because the attribute I need to assign is added from NuGet package, which resides in the packages folder at the solution file level. I am then developing on two machines (work, and then home) and sharing my code across the two machines using a private git repository, and the project paths end up being different on both machines. So now if I make a change to the model, it throws an exception. I then have to manually edit the .edps file and change all the attribute assemblies to the correct path for my machine. I could install the packages in the GAC but this defeats the point of using packages in the first place, as the idea is that their portable and relative/isolated to the project.

All the relative paths seem to be relative to the Visual Studio IDE start path, but that isn't very useful. I understand that Entity Developer is being launched by the IDE so its getting its start in path from that, but is there a way that it can running with its start path relative to my solutions folder? That way the packages references can be relative. Also it might be useful to be able to change the file path within the Model Settings dialog instead of having to find it in the .edps file, because adding and removing from the dialog warns that it will remove the attributes from the entity properties...

Also, I seem to be getting another strange issue. I have set the Entity Namespace property to be "Entities", but whenever I save the model, it imports the namespace without using its full name E.g.

Code: Select all

Imports Entities
which causes an error on compilation, so I have to manually change the line to the full namespace E.g.

Code: Select all

Imports AssemblyNS.Data.Entities
It's not a huge deal, just a little annoying every time I make a change to the model. Have I set something up wrong here?

Many thanks

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

Re: Relative Path Model Attributes and Imports namespace paths wrong.

Post by MariiaI » Fri 28 Feb 2014 12:33

Thank you for the remark regarding using relative paths in Model Settings -> Model -> Attributes. We will investigate this issue and inform you when any results are available.
Also, I seem to be getting another strange issue. I have set the Entity Namespace property to be "Entities", but whenever I save the model, it imports the namespace without using its full name E.g.
CODE: SELECT ALL
Imports Entities
which causes an error on compilation
We couldn't reproduce this issue in our environment. Please send us a test project with your model, so that we are able to reproduce it and find a solution for you.

peterharris
Posts: 13
Joined: Fri 03 Jan 2014 11:13

Re: Relative Path Model Attributes and Imports namespace paths wrong.

Post by peterharris » Sat 01 Mar 2014 13:26

Thank you for responding so quickly.

I have attached a project exampling the issue to an email to the support team.

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

Re: Relative Path Model Attributes and Imports namespace paths wrong.

Post by MariiaI » Mon 03 Mar 2014 12:09

Thank you for the sample project. We have reproduced this behaviour. We will investigate it and inform you about the results as soon as possible.

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

Re: Relative Path Model Attributes and Imports namespace paths wrong.

Post by MariiaI » Fri 07 Mar 2014 06:23

The behaviour is changed: now paths to assemblies with attributes (Model Settings -> Model -> Attributes) are saved and used as relative paths.
The bug with invalid code generation when different namespaces for context and entity classes are used in the VB.NET projects is fixed.

New build of LinqConnect 4.4.453 is available!
It can be downloaded from http://www.devart.com/linqconnect/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?f=31&t=29103.

Post Reply