Print Page | Close Window

CodeFirst on TFS Build

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2012
Forum Discription: For .NET 4.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=4064
Printed Date: 25-Mar-2025 at 5:20pm


Topic: CodeFirst on TFS Build
Posted By: smi-mark
Subject: CodeFirst on TFS Build
Date Posted: 21-Mar-2013 at 6:52am
Having an issue getting the model to build on our TFS build server.

    DevForceEntityModelMetadataDeploy:
         In EntityModelMetadataDeploy.  Parms:  Assembly='C:\Builds\1\TaxOffice\Nightly TaxOffice Build\Binaries\TaxOffice.Model\TaxOffice.Model.dll', TargetFolder='C:\Builds\1\TaxOffice\Nightly TaxOffice Build\Sources\Dev\Source\TaxOffice\TaxOffice\TaxOffice.Model.Desktop'
         IdeaBlade.VisualStudio.Build.Tasks, Version=7.1.0.0, Culture=neutral, PublicKeyToken=287b5094865421c0
         Trying model metadata discovery for C:\Builds\1\TaxOffice\Nightly TaxOffice Build\Binaries\TaxOffice.Model\TaxOffice.Model.dll
         Creating metadata from DbContext 'TaxOfficeDbContext'
         Searching for connectionString named 'TaxOfficeEntities': found
     1>C:\Builds\1\TaxOffice\Nightly TaxOffice Build\packages\IdeaBlade.DevForce.Aop.7.1.0\tools\IdeaBlade.DevForce.Common.targets(61,5): error : An error occurred during metadata generation and a metadata file could not be created.  Error: The system cannot find the file specified [C:\Builds\1\TaxOffice\Nightly TaxOffice Build\Sources\Dev\Source\TaxOffice\TaxOffice\TaxOffice.Model.Desktop\TaxOffice.Model.csproj]
         EntityModelMetadataDeploy: No metadata files generated.

The dll and folder exist as you can tell it's finding the DbContext and connection string.

Any ideas?



Replies:
Posted By: kimj
Date Posted: 21-Mar-2013 at 10:58am
The EntityModelMetadataDeploy task first generates in-memory metadata, and then tries to obtain a Visual Studio DTE instance to first check if the metadata has changed, and then to write an ibmmx file and update the model's hashcode stored in the project file. Since it's complaining about not finding the project file it's likely this last part which is failing.

Due to the VS dependency, we generally don't recommend running the EntityModelMetadataDeploy task on a build server. You can turn it off by setting the "SkipDevForce" property to true. You can do this via an MSBuild argument, or by creating a file named IdeaBlade.Override.targets which contains the property.



Print Page | Close Window