Frage

Scenario first :-

I'm using Entity Framework to do some queries, to build my Models I'm trying DevArt Entity Developer inside a MVC3 project. I build the app upload to SVN and then a Continuous Integration server picks it up (Bamboo) builds and deploys using MSDeploy.

However for some reason there appears to be a problem with the deployment since MSDeploy requires to know about files in advance before it will deploy them, it means that the '.csdl', '.ssdl', or '.msl' files aren't deployed to the remote machine.

System.Data.MetadataException: Unable to load the specified metadata resource.

Now if I set DevArt from EmbedInOutputAssembly to CopyToOutputDirectory the web.config file changes form

<add name="jcps01EntitiesConnectionString" connectionString="metadata=res://*/Models.jcps01.csdl|res://*/Models.jcps01.ssdl|res://*/Models.jcps01.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=XXXXX;Initial Catalog=jcps01;Integrated Security=False;Persist Security Info=True;User ID=XXXXX;Password=XXXXX&quot;"

to

<add name="jcps01EntitiesConnectionString" connectionString="metadata=~/bin/Models/jcps01.csdl|~/bin/Models/jcps01.ssdl|~/bin/Models/jcps01.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=XXXXX;Initial Catalog=jcps01;Integrated Security=False;Persist Security Info=True;User ID=XXXXX;Password=XXXXX&quot;" providerName="System.Data.EntityClient" />

However this comes with its own set of problems, the first is that the application doesn't create a Models folder, it just makes the file /bin/Models.jcps01.msl and of course since the file isn't included in the project/solution MSDeploy doesn't deploy it :|

Has anyone ever had any success using MSDeploy with DevArt before and if so did you have to make any changes in your solution to files to copy to output directory etc etc?

War es hilfreich?

Lösung

This was caused by the build server not having DevArt Entity Developer installed, normally deploying .cs files is enough, but in the case of DevArt we needed to install their tool on the build server too.

Once this was installed things started to work (ie mapping files were generated and automatically added to the assembly file).

Surprisingly no errors were ever thrown by MSBuild about not having this application or not being able to read foreign file formats.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top