0
votes

I have an ASP .NET project that contains one emdx model; the project worked fine before I add a Workflow activity to it. When the workflow activity is added to the project, the following error happens "Unable to load the specified metadata resource". I examined the generated .dll file using reflector in both cases and I found that

1- when I remove the workflow activity, the resource files (.csdl,.msl,.ssdl) are embedded correctly.

2- when the workflow activity exists, the resources are not embedded, instead the workflow resource files are embedded.

The workflow activity is ABC.xaml. in resources, I found these two files only (ABC.g.xaml, TestApp_ABC_BeforeInitializeComponentHelper.txt).

Is there any fix that will make the .edmx resource file be embedded while using Workflow.

1

1 Answers

0
votes

I couldn't find a way to make the resources be embedded, but I found a workaround that will make it work.

When the project is built, the resource files (.csdl,.msl,.ssdl) are generated in the directory /obj/Debug/edmxResourcesToEmbed. I copied the files to the bin directory and changed the connection string to be

<add name="TestDBEntities" connectionString="metadata=~/bin/TestDBModel.csdl|~/bin/TestDBModel.ssdl|~/bin/TestDBModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=****;initial catalog=TestDB;persist security info=True;user id=*****;password=******;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" /></connectionStrings>

instead of

 <add name="TestDBEntities" connectionString="metadata=res://*/TestDBModel.csdl|res://*/TestDBModel.ssdl|res://*/TestDBModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=****;initial catalog=TestDB;persist security info=True;user id=*****;password=******;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" /></connectionStrings>

by doing this, the application will get the resource files from the bin directory, instead of getting them from the .dll file.