Reputation: 21
Our project is based on DevForce 7.2.2 + EF5 + Oracle ODAC Release 2 currectly. Oracle provide new ODAC Release 3 since Cristmas day, which supports EF6, so we plan to migarte to EF6. I installed new ODAC driver and EF6, add IdeaBlade.EntityModel.Edm.EF6 and compiled project successfully. But when I tried to remove edmx.tt file and save edmx again, the error says:
Running transformation: System.Exception: Unable to load MetadataWorkspace from file:
C:\HRM\branches\work\Client\trunk\william_EF6\Source\Infor.HRCM.BusinessObjectEF\HRCMModel.edmx
This may be due to validation errors encountered during the load;
Please check for EDMX validation errors.
No Entity Framework provider found for the ADO.NET provider with invariant name 'Oracle.DataAccess.Client'.
Make sure the provider is registered in the 'entityFramework' section of the application config file.
See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.
at IdeaBlade.VisualStudio.OM.CodeGenerator.Metadata.EdmxWrapper.ThrowException(String edmxFileName, IEnumerable1 errors)
at IdeaBlade.VisualStudio.OM.CodeGenerator.Metadata.EdmxWrapper.LoadFrom(String edmxFileName, IEnumerable
1& errors)
at IdeaBlade.VisualStudio.OM.CodeGenerator.BaseDomainModelTemplate.Generate()
at Microsoft.VisualStudio.TextTemplatingF6DEE480DF7B4F94A3D12E403704A2572EB9DB1E939B6073E8F11C8E668FEEA7B6005FF1359D9D2F5838491689A816AF3A6016F8F44D717349E05C0127639B54.GeneratedTextTransformation.TransformText() in c:\HRM\branches\work\Client\trunk\william_EF6\Source\Infor.HRCM.BusinessObjectEF\HRCMModel.edmx.tt:line 9 c:\HRM\branches\work\Client\trunk\william_EF6\Source\Infor.HRCM.BusinessObjectEF\HRCMModel.edmx.tt 9 1 Infor.HRCM.BusinessObjectEF
I created new demo without DevForce(only EF6 + ODAC driver), it works. Following is my application config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
</configSections>
<connectionStrings>
<add name="HRCMContext" connectionString="metadata=res://*/HRCMModel.csdl|res://*/HRCMModel.ssdl|res://*/HRCMModel.msl;provider=Oracle.DataAccess.Client;provider connection string="data source=DEV12;password=hrm_trunk;persist security info=True;user id=HRM_TRUNK"" providerName="System.Data.EntityClient" />
</connectionStrings>
<oracle.unmanageddataaccess.client>
<version number="*">
<edmMappings>
<edmNumberMapping>
<add NETType="decimal" MinPrecision="1" MaxPrecision="19" DBType="Number" />
</edmNumberMapping>
</edmMappings>
</version>
</oracle.unmanageddataaccess.client>
<entityFramework>
<providers>
<provider invariantName="Oracle.DataAccess.Client" type="Oracle.DataAccess.EntityFramework.EFOracleProviderServices,
Oracle.DataAccess.EntityFramework,Version=6.121.2.0,
Culture=neutral, PublicKeyToken=89b483f429c47342" />
</providers>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
</entityFramework>
</configuration>
Upvotes: 0
Views: 179
Reputation: 1227
EF6 appears to be loading/resolving app.config information differently than it did in EF5, causing the DevForce problem at design-time. DevForce code generation in EF6 isn't currently able to use the information in your project's configuration file, so the entityFramework information in your config is not being found.
You can work around this problem for now by adding the entityFramework information (including the configSection entry) to your devenv.exe.config file, located in the same folder as devenv.exe.
We hope to have a fix for this in the next DevForce release.
Upvotes: 0