ADO.NET Entity Framework Readme

ADO.NET Entity Framework Beta 3 and ADO.NET Entity Framework Tools CTP 2

Visit the ADO.NET forum for questions and discussions about the ADO.NET Entity Framework. For articles and more in-depth information, see the ADO.NET team blog. To download Entity Framework samples, go to the ADO.NET Samples page on the CodePlex Web site..

This release contains updates to the ADO.NET Entity Framework since the Beta 2 release and to the ADO.NET Entity Framework Tools since the first CTP. For more information about these new features, see the ADO.NET team blog.

1. System Requirements

1.1 Supported Architectures

Entity Framework

Entity Framework Tools

1.2 Supported Operating Systems

Entity Framework

Entity Framework Tools

1.3 Hardware Requirements

The hardware requirements are the same as those for Visual Studio 2008. See the Visual Studio 2008 Readme for more details.

2. Known Issues

2.1 Installation

2.1.1. You must uninstall previous pre-release versions of the ADO.NET Entity Framework and any pre-release versions of Visual Studio 2008 and the .NET Framework 3.5

You must uninstall any previous pre-release versions of the ADO.NET Entity Framework, including Beta 2. Then you must uninstall any pre-release versions of Visual Studio 2008 and the .NET Framework 3.5. For instructions on how to do this, see the Visual Studio 2008 Readme or the .NET Framework 3.5 Readme.

To resolve this issue:

No workaround is available.

2.1.2 Installing the Entity Framework and Entity Framework tools requires administrative privileges

To resolve this issue:

Log on to the computer as a user with Administrator privileges or agree to the UAC elevation prompt on Windows Vista.

2.1.3 Installing the 32-bit version of the Entity Framework on 64-bit operating systems is not supported

To resolve this issue:

Use the 64-bit Entity Framework runtime installer on 64-bit machines and use the 32-bit Entity Framework runtime installer on 32-bit machines.

2.1.4 Installing the 32-bit version of the Entity Framework Tools on 64-bit operating systems is not supported

To resolve this issue:

No workaround is available.

2.2 Entity Framework Product Issues

2.2.1 LINQ to Entities: Concatenating strings when constructing an anonymous type throws an exception

Using the plus (+) operator to concatenate two or more string properties into a single string in a projection raises the following exception: "DbArithmeticExpression arguments must have a numeric common type".

The following code is an example:

var query = from c in ctx.Customers
 where c.Country =="USA"
  select new   CustomerID = c.CustomerID,
   CustomerName = c.ContactTitle +" " + c.CompanyName };"

To resolve this issue:

Use String.Concat() as follows:

var query = from c in ctx.Customers
 where c.Country =="USA"
 select new   CustomerID = c.CustomerID,
  CustomerName = string.Concat(
   c.ContactTitle,
   "",c.CompanyName) };

2.2.2 LINQ to Entities: Span information provided on a referenced query is lost if another builder method is applied after Include and the query is compiled

In the following example, a builder method is applied to a query that contains a span. When the resulting query is compiled, the span information is lost instead of being propagated.

var q = from c in ctx.Customers.Include("Orders")
         where c.CustomerID == "ALFKI"
          select c;
var cq =
    CompiledQuery.Compile((NorthwindEntities _ctx) => q);

foreach (var p in cq(ctx))
    Console.WriteLine(
        p.CustomerID + ", " + 
        p.Orders.Count().ToString());
// Output is "ALFKI, 0".

To resolve this issue:

If possible, use span only at the top level. Consider projecting the related entity alongside the main entity in the query, instead of using Include:

var q = from c in ctx.Customers
         where c.CustomerID == "ALFKI"
          select new { Customer = c, Orders = c.Orders };
var cq =
    CompiledQuery.Compile((NorthwindEntities _ctx) => q);

foreach (var p in cq(ctx))
    Console.WriteLine(
        p.Customer.CustomerID + ", " + 
        p.Orders.Count().ToString());
// Output is "ALFKI, 6".

2.2.3 LINQ to Entities: First() and FirstOrDefault() methods that take an expression as a parameter do not preserve order

Using First() or FirstOrDefault() with a predicate expression may translate to a store query that changes the order of the source query. Therefore, you might get unexpected results when you try a query like the following. This is by design, but it is not yet well documented:

var query = from o in ctx.Orders
            orderby o.OrderID descending
             select o;
var first = query.First(o => o.ShipCountry=="USA");
Console.WriteLine(first.OrderID);
// Output is "10262".

foreach (var o in query)
{
    if (o.ShipCountry == "USA")
    {
        Console.WriteLine(o.OrderID);
        // Output is "11077".
        break;
    }
}

To resolve this issue:

If you want to get the first element in the original order, move the predicate to the source query and use First() or FirstOrDefault() without parameters.

var query = from o in ctx.Orders
            where o.ShipCountry =="USA"
            orderby o.OrderID descending
            select o;

var first = query.First();
Console.WriteLine(first.OrderID);
// Output is "11077".

2.2.4 Data binding to complex types displays the ToString() implementation of the complex type

Controls that are bound to queries that retrieve complex types directly, or to queries that retrieve entities that contain complex types, will display the complex type content as the result of calling the complex type's ToString() implementation. The ADO.NET Entity Framework team is currently exploring options to enhance data binding with complex types for the final product release.

To resolve this issue:

If more granular binding of a complex type is required, you can expose the desired properties of the complex type as entity properties by adding them to the associated entity classes. Use partial classes to do this.

2.3 Entity Framework Tools Product Issues

2.3.1 Cannot open an .edmx file in the designer after selecting a different database in Update Model from Database...

If you select a database in the Update Model from Database… menu item other than the database from which the model was originally created, the .edmx file may not open in the designer. If this happens, further editing is not possible.

To resolve this issue:

To generate a model from a different database, use Add New Item to add a new model to your project.

2.3.2 Visual Studio Express SKUs: Cannot save a new project with an .edmx file open in the designer

You cannot save a new project if there is a model open in the designer. Attempting to do so displays an error message.

To resolve this issue:

Close the .edmx file before saving the project.

2.3.3 Creating circular inheritance may make Visual Studio unstable

The designer detects attempts to create a circular inheritance and displays a warning message box. However, Visual Studio may become unstable after you close the dialog box.

To resolve this issue:

No workaround is available.

2.3.4 Adding an Is Not Null condition for a non-nullable column causes a validation error

Adding an Is Not Null condition to a non-nullable column in the mapping details window and validating the model reports the following error in the Visual Studio error list: "Object reference not set to an instance of an object." This issue also applies to the EdmGen.exe command line tool when you use it to validate conceptual schema definition language (CSDL), mapping specification language (MSL), and storage schema definition language (SSDL) files.

To resolve this issue:

Remove the Is Not Null condition from the column and validate again.

2.3.5 Deleting an Entity Property that is used in a function binding parameter causes the mapping details window to display a watermark

The designer does not update the MSL correctly when an entity property that is used in a function binding parameter is deleted. After the property is deleted, the mapping details window displays a watermark that says that the mapping was edited outside the designer.

To resolve this issue:

Unbind the entity property as a function binding parameter before deleting it.

2.3.6 Errors are reported when generating a model from the AdventureWorks database

The designer reports the following errors in the Visual Studio error window when generating a model from the AdventureWorks database:

Error 1     The first character in the name 2002 is not valid.    Model1.edmx 4660  21
Error 2     The first character in the name 2003 is not valid.    Model1.edmx 4661  21
Error 3     The first character in the name 2004 is not valid.    Model1.edmx 4662  21

These errors will not cause a build break and can be ignored.

To resolve this issue:

Ignore these errors or exclude the view vSalesPersonSalesByFiscalYears from the Entity Data Model wizard when you generate the model from AdventureWorks.

2.3.7 Validation errors are not always removed from the error window, even when the project builds successfully

Sometimes errors are still visible in the error window, even after the project is built successfully without errors.

To resolve this issue:

Close and reopen the solution.

2.3.8 Clicking Previous in the Entity Data Model wizard may close the wizard if there are no connections

Clicking the Previous button sometimes closes the wizard if there are no connections in the project.

To resolve this issue:

Add a connection in Server Explorer before adding a new ADO.NET Entity Data Model item to the project.

2.3.9 Double-clicking on errors in the Visual Studio error window may select the incorrect shape, connector, or mapping details

Double-clicking on errors in the Visual Studio error window does not always select the correct element, especially for mapping errors.

To resolve this issue:

No workaround is available.

2.3.10 Deleting a shape or connector in a large model may take a long time

Deleting shapes or connectors in large models (100+ shapes and connectors) may take a long time.

To resolve this issue:

No workaround is available.

2.3.11 Using the keyboard in the mapping details window is not supported

For example, deleting an association key mapping using the keyboard does not clear the delete option from the drop-down list.

To resolve this issue:

No workaround is available. Please use the mouse in this CTP to edit mappings.

2.3.12 .edmx files created in CTP1 of the designer do not always open in CTP2

The file format of .edmx files has changed in CTP2. Opening .edmx files created with earlier versions of the designer is not supported.

To resolve this issue:

Recreate the .edmx file in CTP2 of the designer.

2.3.13 Editing .edmx files in the XML Editor when the designer is open is not supported

It is possible to open an .edmx file in the XML Editor by right-clicking on it in Solution Explorer and choosing Open With... and XML Editor. Although editing .edmx files in both the XML Editor and in the designer is not supported, we understand that some advanced scenarios may require it. In these cases, you should close the designer before opening the file in the XML Editor.

To resolve this issue:

Close the designer before opening the file in the XML Editor.

2.3.14 Some scalar property facets are read-only in the Visual Studio Property window

Facets like Access, Getter, and Setter for scalar properties cannot be changed in the Visual Studio Property window.

To resolve this issue:

Open the .edmx file in XML Editor and directly change the facets in the XML.

2.3.15 Build error when projects with .edmx files created in Visual Studio Beta 2 and the EDM Designer CTP 1 are rebuilt in Visual Studio 2008 RTM

Projects with .edmx files created in earlier CTPs include a reference to EdmxDeploy.exe in the project post-build event. Building such projects in the release version of Visual Studio 2008 causes a build failure with a message that EdmxDeploy.exe could not be found.

To resolve this issue:

The functionality provided by EdmxDeploy.exe is now available in the EntityDeploy MSBUILD task. Modify the post-build event in project properties and remove the reference to EdmxDeploy.exe.

2.3.16 Cannot rename or move an .edmx file in Solution Explorer if it is open in the designer

You cannot move or rename an .edmx file in Solution Explorer when it is currently open in the designer. If you attempt this, it raises an error message.

To resolve this issue:

Close the .edmx file in the designer before renaming or moving it in Solution Explorer.

2.3.17 Cannot open .edmx files with invalid or unsupported EDM content, or with certain validation errors in the designer

When an .edmx file has invalid or unsupported content, or when certain validation errors occur, the designer reports errors but does not display the diagram. Instead, a watermark is displayed prompting users to open the file in XML Editor.

To resolve this issue:

Click the link in the watermark to open the .edmx file in XML Editor and fix the errors. Be sure to close the .edmx file in the designer before editing it in the XML Editor.

2.3.18 Unpredictable behavior when creating entities after invalid .edmx files have been opened

As noted previously, the designer reports errors but does not display the diagram when an .edmx file has invalid or unsupported content, or when certain validation errors occur. Attempting to create new entities or associations from the toolbox or context menu in this state may cause unpredictable behavior, such as crashing Visual Studio.

To resolve this issue:

No workaround is available.

2.3.19 Working with an .edmx file in a Visual Basic project displays warning messages

A number of warnings are reported when an .edmx file is added to a Visual Basic project as a link, or when its source file is opened. You may also get the message "Line Endings in the file are not consistent. Do you want to normalize the line endings?"

To resolve this issue:

Click Yes to normalize the line endings and open the file.

2.3.20 Generating a model from a database with a table, view, or column with a number for a name or special characters in its name causes errors

The wizard reports errors in the Visual Studio error window when generating a model from a database that has tables, views, or columns that only have numbers as their names or that have special characters (such as % or /) in their names.

To resolve this issue:

Exclude the tables or views that caused the problem, or rename the table, view, or column so that its name is not composed solely of numbers and does not contain special characters.

2.3.21 F1 Help does not work

Pressing F1 in the designer does not launch Help.

To resolve this issue:

Manually launch the Tools Help file from Start/All Programs/ADO.NET Entity Framework Preview

2.3.22 Text on connectors and shapes does not repaint correctly

There is a known repainting issue with text decorators on connectors and icons in shapes. For example, changing an association's multiplicity in the Visual Studio Property window does not update the text on the connector on the designer surface. Also, changing the key facet of a scalar property does not immediately refresh its icon on the designer surface.

To resolve this issue:

No workaround is available.

2.3.23 Cannot enter spaces or special characters in condition values

When typing in the value of a table mapping condition, pressing the space bar will cause focus to be lost on the condition value text box.

To resolve this issue:

Copy and paste the desired value into the text box.

2.3.24 The Entity Mapping Details window occasionally goes blank

The Entity Mapping Details window occasionally loses track of the selection and reverts to showing the watermark.

To resolve this issue:

Select a different object, or click on an empty area of the diagram, then click on the Entity or Association again.

3. Related Links

3.1 .NET Framework Readme

3.2 Visual Studio Readme

3.3 Visual Studio Express Edition Readme

3.4 Visual Studio Team Foundation Server Readme

3.5 MSDN Library for Visual Studio Readme

© 2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement