Quantcast
Channel: Entity Framework
Viewing all articles
Browse latest Browse all 10318

Edited Issue: Reverse Engineer Code First: Using database name as entity container name causes issues when database name has invalid chars (bad for SQL Compact) [898]

$
0
0
The Reverse Engineer Code First process uses the database name (DbConnection.Database) as the entity container name. We don't do any escaping so this may contain invalid characters. This is basically always the case when using SQL Compact since the database name is a full path to the sdf file which includes slashes.


-------------------- Original bug report --------------------

I'm facing an issue that many already faced, but with a difference: neither the SDF file name, or the path, contains invalid characters.
I've even tried with the Northwind.sdf file and Ikeep getting the same issue.

An example of a full path: D:\Sviluppo\dotnet\EnergiaClima\EnergiaClimaWindows\App_Data\Northwind.sdf

The error message:

```
System.ArgumentException: The modelEntityContainerName parameter 'D:\Sviluppo\dotnet\EnergiaClima\EnergiaClimaWindows\App_Data\NorthwindsdfContext' contains characters that are not valid.
at System.Data.Entity.Design.EntityModelSchemaGenerator..ctor(EntityContainer storeEntityContainer, String namespaceName, String modelEntityContainerName)
at Microsoft.DbContextPackage.Handlers.ReverseEngineerCodeFirstHandler.ReverseEngineerCodeFirst(Project project)
```

Any advice?

Viewing all articles
Browse latest Browse all 10318

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>