MSBUILD fails randomly with "Version store out of memory (cleanup already attempted)" errors - MSB4018 - by mikeruth

Status : 

 


74
0
Sign in
to vote
ID 749108 Comments
Status Active Workarounds
Type Bug Repros 31
Opened 6/14/2012 9:12:24 AM
Access Restriction Public

Description

I am encountering what seems to be a random problem when building SSDT solutions using MSBUILD from the VS11 beta .net framework.   Somewhat randomly when issuing build commands from a powershell prompt the build fails and with the callstack output show below.  If I close and reopen the prompt it will temporarily correct this problem however it seems to resurface after building the project a number of times. 
 
Something that might be related is that I recently went from about 3 .sqlproj's in the solution to 9 .sqlproj's in the solution,  The solution contains only database project types. 
 
I haven't been able to reproduce the failure when building from within VS, the problem only occurs when building the solution using MSBUILD.  This looks like a bug to me. 

A reliable workaround seems to be to reduce the parallellism of the build to 1. 
 
MSBUILD command being used:
 
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe DB.sln /target:build /m:8 /nodeReuse:false /property:Configuration=test /noconsolelogger /l:FileLogger,Microsoft.Build.Engine;logfile=.\projectLog.txt;verbosity=normal;append=true
 
Callstack from error:
 
   C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(495,5): error MSB4018: The "SqlBuildTask" task failed unexpectedly.
        C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(495,5): error MSB4018: Microsoft.Isam.Esent.Interop.EsentVersionStoreOutOfMemoryException: Version store out of memory (cleanup already attempted)
        C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(495,5): error MSB4018:    at Microsoft.Isam.Esent.Interop.Update.Save(Byte[] bookmark, Int32 bookmarkSize, Int32& actualBookmarkSize)
        C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(495,5): error MSB4018:    at Microsoft.Data.Tools.Schema.SchemaModel.ModelStore.EseCommand.InsertRowWithFirstIdentityColumn(Object[] values)
        C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(495,5): error MSB4018:    at Microsoft.Data.Tools.Schema.SchemaModel.ModelStore.CreateIdentifierImpl(Int32 externalPartsId, ICollection`1 parts)
        C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(495,5): error MSB4018:    at Microsoft.Data.Tools.Schema.Sql.SchemaModel.SqlSchemaModel.RegisterAliasedToDboElements(String logicalSourceName, IEnumerable`1 elements)
        C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(495,5): error MSB4018:    at Microsoft.Data.Tools.Schema.Sql.SchemaModel.SqlSchemaModel.OnCustomDataAdded(CustomSchemaData customData)
 
Sign in to post a comment.
Posted by Mark S (SolSoft Solutions) on 8/22/2016 at 6:46 AM
@ExcaliburVT -- it seems implied by Eric's post that you can set an environment variable

SET DACFX_MODEL_STORAGE_TYPE = MEMORY
Posted by ExcaliburVT on 7/27/2016 at 12:17 PM
Eric, is there a way to do the CmdLineInMemoryStorage while utilizing Microsoft.SqlServer.Dac.DacProfile for deployment from within powershell? I don't see it in the deployment options.

-Thanks!
Posted by Ryan P - Denver on 7/25/2016 at 8:45 AM
This is happening with the VSTS Hosted Build agent using VS2015 build. Quite frustrated that a paid-for build agent encounters this error. This error has been around way too long - please just get it fixed!
Posted by PA1420 on 5/31/2016 at 2:09 AM
I've added two workarounds, one for MSBUILD and one for SSMS, where this issue is also encountered.
Posted by PA1420 on 5/31/2016 at 1:56 AM
4 years and still no workarounds! Oh dear.
Posted by chuckholzwarth on 4/22/2016 at 8:22 AM
I have been experiencing this as well. I have a build that runs MSBuild to create the DACPACs and then applies the resulting DACPACs to a given database. My build agent is single threaded so only one build can be in progress at a given time. This won't work for an environment where database builds can run in parallel.

I did the following.
1) Created a command file that stops and then starts the SQL server instance on the system.
2) Created a build target that calls the command file in step 1.
3) modified the build to call the restart target before the database solution.
4) Modified the command file that applies the DACPACs to the target database to stop and start the SQL server before and after the DACPAC install.

I had tried to just put the restart commands in the command file, but if a DCAPAC build failed due to a coding issue, then every build after that would fail due to the out of memory issue. I also noticed that the out of memory issue could come up immediately after a successful database build so stopping SQL server before and after the DACPAC install got rid of that issues as well.
Posted by Eric [MSFT] on 3/4/2016 at 12:13 PM
Thank you for sharing more details of this issue. While SSDT engineering team is working on to address this issue, I'd like to share more information about the recent investigation. I hope it can help you avoid this issue as much as possible.

There are two main cases that you may experience the ESE Version Store out of memory issue.

1. While opening up a VS solution, SSDT / Visual Studio crashes with the ESE out of memory exception.
2. Or the same issue occurs while building a solution / database project in SSDT / Visual Studio or using MSBUILD.exe

Background:

SSDT (DACFx which is the engine for the model based database development) analyzes and constructs a schema model for an entire database from .sql files in your database project. For instance, it identifies all schema objects (tables, columns, views, sp, views etc), properties and their relationships to each other if any. The performance and time to finish the model construction thus directly depends on the complexity of your database schema. During this operation, DACFx utilizes Microsoft Extensible Storage Engine (ESE) to store interim artifacts. ESE is a file based database and VersionStore is its technology to track and manage transactions. When the number of transactions increases and DISK IO reaches a point to impact its transaction performance, the chance of occurrence for a long running transaction increases. The VersionStore has a size limit and constantly clean-up as transactions complete. If its clean-up operation is disrupted due to a long running transaction, it eventually hits the VersionStore out-of-memory exception, hence the issue in SSDT / Visual Stuiod and MSBUILD.

By default, ESE uses x:\users\<yourusername>\AppData\Local\Temp as a temporary storage to create *.model files. You can monitor the DISK IO on these files using Task manager or Resource Monitor for more detail. To monitor ESE critical error event, you can use EventViewer. The location of log is under Applications and Services Logs - Microsoft - Windows - ESE.

Possible workaround:

Until the fix is available in SSDT, reducing DISK IO operation or increase its IO capacity is a way to lower the chance of hitting this issue. In our investigation, we used a customer provided solution that constantly hit the ESE VersionStore out of memory exception and found out following temporary mitigation.

1.    Msbuild with CmdLineInMemoryStorage option
a.    Use Msbuild.exe <your solution or project file> /t:build /p:CmdLineInMemoryStorage = TRUE to build a database project, this method works correctly and eliminate ESE VersionStore out-of-memory issue.
b.    We found a bug that previous suggestion does not work: neither <CmdLineInMemoryStorage>True</CmdLineInMemoryStorage> in a database project file nor SET DACFX_MODEL_STORAGE_TYPE = MEMORY as an environment variable apply correctly. If you are experiencing VersionStore OOM issue while opening up a solution in Visual Studio, then following mitigation could be used.

2.     (If you can) Use SSD to increase the DISK IO performance
a.    Please make sure x:\users\<yourusername>\AppData\Local\Temp folder is on the SSD.

3.    (If the project is very large) Use DACPAC as a database reference and reduce the amount of objects in a single database project or a solution.

**Please note that the number of reference resolution warnings turned out not directly contribute to the ESE VersionStore out-of-memory issue.

I will keep this thread updated with more information as it’s available. Please let me know if any of above workaround could solve your immediate issue.

Thanks,
Eric
Posted by _K_R_W_ on 3/3/2016 at 9:41 PM
"Re: Posted by Eric [MSFT] on 2/26/2016 at 10:43 AM: If you encounters this issue with a simple / small project as well, please let us know."

[My Setup]

VS2K13 Ultimate (fully patched) w/ SSDT 12.0.50730.0

Database Solution with two database projects both setup the same in terms of settings, etc. but the size of the post deployment data script imports differ drastically.

Target is (localdb)\ProjectsV12.

Both projects have 184 tables and 588 stored procedures.

Suppressing warnings 71502, 71562 in both.

Post deployment scripts configured for both projects with data import scripts called from post deployment script via command:

:r .\InsertDataStatements.sql

The project that builds ok only has a 94MB data import script whereas the project that fails has a 3GB+ data import script.

When you comment out the ":r .\InsertStatements.sql" line in the post deployment script for the failing project it builds fine.

Thanks!
Posted by ChrisK89 on 3/3/2016 at 2:09 AM
I am quite consistently having this error on our build environment and it is getting incredibly frustrating as builds are not being delivered on time. Error out put below:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets (550): The "SqlBuildTask" task failed unexpectedly.
Microsoft.Isam.Esent.Interop.EsentVersionStoreOutOfMemoryException: Version store out of memory (cleanup already attempted)
at Microsoft.Isam.Esent.Interop.Api.Check(Int32 err)
at Microsoft.Isam.Esent.Interop.Api.JetUpdate(JET_SESID sesid, JET_TABLEID tableid, Byte[] bookmark, Int32 bookmarkSize, Int32& actualBookmarkSize)
at Microsoft.Isam.Esent.Interop.Update.Save(Byte[] bookmark, Int32 bookmarkSize, Int32& actualBookmarkSize)
at Microsoft.Data.Tools.Schema.SchemaModel.ModelStore.EseCommand.InsertRow(Object[] values)
at Microsoft.Data.Tools.Schema.SchemaModel.ModelStore.RelationshipEntry.AddAnnotation(IModelAnnotation annotation)
at Microsoft.Data.Tools.Schema.SchemaModel.DataSchemaModel.ReferenceLinker.MarkExternalReferencesWithAnnotations(ModelStore store)
at Microsoft.Data.Tools.Schema.SchemaModel.DataSchemaModel.LoadExternals(TextReader input, String fileName, String logicalSourceName, IList`1 externalPartsSubstitution, Boolean suppressErrorsForMissingDependencies)
at Microsoft.Data.Tools.Schema.SchemaModel.DataSchemaModel.AddReference(CustomSchemaData customData)
at Microsoft.Data.Tools.Schema.SchemaModel.DataSchemaModel.OnCustomDataAdded(CustomSchemaData customData)
at Microsoft.Data.Tools.Schema.Sql.SchemaModel.SqlSchemaModel.OnCustomDataAdded(CustomSchemaData customData)
at Microsoft.Data.Tools.Schema.SchemaModel.DataSchemaModel.AddCustomData(CustomSchemaData customData, Boolean raiseEvents)
at Microsoft.Data.Tools.Schema.Sql.SchemaModel.SqlModelBuilder.Add(CustomSchemaData customSchemaData)
at Microsoft.Data.Tools.Schema.SchemaModel.ModelBuilder.AddOrUpdate(CustomSchemaData customSchemaData)
at Microsoft.Data.Tools.Schema.Sql.Build.SqlTaskHost.AddOrUpdate(CustomSchemaData customSchemaData)
at Microsoft.Data.Tools.Schema.Tasks.Sql.TaskHostLoader.ProcessReferences(TaskLoggingHelper providedLogger, SqlTaskHost host, ErrorManager errors)
at Microsoft.Data.Tools.Schema.Tasks.Sql.TaskHostLoader.LoadImpl(ITaskHost providedHost, TaskLoggingHelper providedLogger)
at Microsoft.Data.Tools.Schema.Tasks.Sql.TaskHostLoader.Load(ITaskHost providedHost, TaskLoggingHelper providedLogger)
at Microsoft.Data.Tools.Schema.Tasks.Sql.SqlBuildTask.ExecuteLoadTaskHostStep()
at Microsoft.Data.Tools.Schema.Tasks.Sql.SqlBuildTask.ExecuteStep(Func`1 step)
at Microsoft.Data.Tools.Schema.Tasks.Sql.SqlBuildTask.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext()

I have tried using the property '/Properties:Storage=File' on the command line but it still fails. There are 15 projects in the solution and we use /m:8 for multi threading. This is set on the build definition so lowering threading is not an option as it will affect all projects. There were 4355 warnings on my last build in total. TFS platform is TFS 2012 Update 4 and we build using Visual Studio 2013.
The sooner this is resolved the better before our QA department gets too angry!
Posted by The Jeremy Gray on 2/29/2016 at 8:00 AM
I am seeing this behavior, here are my stats.
Database projects: 1, (I do have references to 14 dacpacs of other databases whose code is not stored in the solution)
Stored Procedures: 7946
Build Warnings: 54108

Lets chat
Posted by Eric [MSFT] on 2/26/2016 at 10:43 AM
I have reactivate this issue to have our team to reinvestigate and address it. Building a db project is one of the fundamental scenario of SSDT that should be reliable and stable. I apologize for any inconvenience this issue may have caused you and for the item being closed without a full resolution. I will keep this thread updated as we progress and findings we have so that it can help you reduce the chance to face this issue.

Currently we think this issue typically occurs with a highly complex VS solution / project. If you encounters this issue with a simple / small project as well, please let us know.
The complexity we see is

- Number of database projects within a VS soluion and database references between projects.
- and Large number of stored projects e.g. a few hundreds of SPs.
- and Large number of build warnings (reference resolution warnings) from those Stored Procedures.

If you can share your case in terms of the complexity of the database project, it will help expedite the process.

Thanks,
Eric Kang
SQL Data Tools Team
Posted by HealthcareConsultant on 2/10/2016 at 3:53 PM
Has anyone also run into this problem when using the DacFX dlls? I am and haven't figured out how to add the <CmdLineInMemoryStorage>True</CmdLineInMemoryStorage> option to the DeployOptions in DacFX.
Posted by Mike McIver on 2/4/2016 at 3:43 AM
Most definitely NOT fixed.
Randomly (weeks or months) build first throws "Version store out of memory (cleanup already attempted)"
Subsequent builds throw this ...
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(550,5): Error: SQL71508: The model already has an element that has the same name ...
... along with dozens of SQL72501 "unresolved reference to".
Big pain ... the only way I found to workaround is to create a new project and copy files from old project.
Posted by James Bradt on 1/27/2016 at 2:49 PM
I'm also encountering this same issue in our Jenkins build

MsBuild 2015 against a solution with a .sqlproj

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(550,5): error MSB4018: Microsoft.Isam.Esent.Interop.EsentVersionStoreOutOfMemoryException: Version store out of memory (cleanup already attempted)
Posted by Marek Kędziora on 1/20/2016 at 1:29 AM
Microsoft Visual Studio Professional 2013
Version 12.0.40629.00 Update 5
Microsoft .NET Framework
Version 4.5.51209

Installed Version: Professional

SQL Server Data Tools 12.0.50730.0
Microsoft SQL Server Data Tools

Error    1    04018: The "SqlBuildTask" task failed unexpectedly.
Microsoft.Isam.Esent.Interop.EsentVersionStoreOutOfMemoryException: Version store out of memory (cleanup already attempted)
Posted by Constantijn Enders on 1/14/2016 at 2:53 AM
Come on microsoft Fix this.
I have migrated my databases to VisualStudio Online, created a hosted build agent and it fails (sometimes) with that error. I am unsure if it is a full build or an incremental build

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(550,5): Error MSB4018: The "SqlBuildTask" task failed unexpectedly. Microsoft.Isam.Esent.Interop.EsentVersionStoreOutOfMemoryException: Version store out of memory (cleanup already attempted)
Posted by JDSX on 1/2/2016 at 8:40 PM
This is definitely not fixed yet as of latest VS2015 and SSDT.
Posted by PsyVision on 12/7/2015 at 1:02 AM
We are using Octopus Deploy to execute a PowerShell script that uses DacDeploy services to generate a database script and then deploy a database (from a SQL Proj DAC Package). This is very often failing with "Version store out of memory". We are using Windows Server 2008/12, Visual Studio 2015, SQL 2008 and 2012 with the February (I think) DAC Framework update.
Posted by agos on 11/26/2015 at 9:15 PM
VS2015 SSDT v14 - Not fixed
It's happen often. We rerun build and it's ok. Can you provide us internal builds with tracing?
Posted by Bart Read1 on 11/19/2015 at 3:42 AM
A couple more details: Windows Server 2012, Visual Studio 2013 (unsure of service pack level). Will let you know when I know more.
Posted by Bart Read1 on 11/19/2015 at 3:40 AM
I can confirm this isn't fixed - saw it this morning in our CI environment (TeamCity), but can't reproduce. Re-running the build seemed to fix it.
Posted by Krzysztof Zajączkowski on 9/28/2015 at 4:34 AM
Not fixed. Occurs frequently to me. I am using Visual Studio Professional 2013 with Update 5 (12.0.40629.00) with SQL Server Data Tools 12.0.50512.0.
Posted by Constantijn Enders on 9/17/2015 at 6:46 AM
Absolutely not fixed. Using SSDT (11.1.50730.0) and Visual Studio Premium 2012 with Update 5
Posted by GeneWald on 9/15/2015 at 8:57 AM
I am seeing this error when I run multiple builds at the same time against the same database in our dev branch. We have different configurations for different target servers, so each build should be getting its own copy of the source code and an independent thread to do the build. We are using TFS2012 and have 4 build agents configured on each of 2 different build machines, using latest version of SSDT (11.1.50730.0). Each build succeeds when run independently, and all are configured with max cpus set to 1 even though each build machine has 4 cpus and 8gb of ram, running windows server 2012 R2.
Posted by MgSm88 on 9/3/2015 at 8:40 AM
We just started encountering this issue on our build server (TeamCity) after switching to MSBuild Tools 2015 (MSBuild ToolsVersion 14.0). This is definitely not resolved.
Posted by Andrew Stanton on 8/18/2015 at 6:55 AM
Can MS please post the version of the software (KB or update #) that this correction is included in?
Posted by reidca on 8/6/2015 at 4:22 AM
Also experiencing this problem using VS2013 and MSBuild 12.0.

In what way has this been fixed? If it has then what is the fix? Are we expected to add <CmdLineInMemoryStorage>True</CmdLineInMemoryStorage> to each sql project? What does that actually do ? come on Microsoft, we need a better reply than this.
Posted by Phil Parkin on 7/3/2015 at 4:03 AM
We use VSOnline to licence VS Pro on our build server and it seems to have trouble keeping the licence up to date from month to month. Manually refreshing the licence credentials fixed the problem. This error message could be improved!
Posted by Phil Parkin on 6/3/2015 at 3:34 AM
This has just happened on our build server. SSDT 2013 / SQL Server 2014, TeamCity running the build.

[SqlBuildTask] C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(550, 5): error MSB4018: The "SqlBuildTask" task failed unexpectedly.
Microsoft.Isam.Esent.Interop.EsentVersionStoreOutOfMemoryException: Version store out of memory (cleanup already attempted)
at Microsoft.Isam.Esent.Interop.Api.Check(Int32 err)
at Microsoft.Isam.Esent.Interop.Api.JetUpdate(JET_SESID sesid, JET_TABLEID tableid, Byte[] bookmark, Int32 bookmarkSize, Int32& actualBookmarkSize)
at Microsoft.Isam.Esent.Interop.Update.Save(Byte[] bookmark, Int32 bookmarkSize, Int32& actualBookmarkSize)
at Microsoft.Data.Tools.Schema.SchemaModel.ModelStore.EseCommand.InsertRow(Object[] values)
at Microsoft.Data.Tools.Schema.SchemaModel.ModelStore.RelationshipEntry.AddAnnotation(IModelAnnotation annotation)
.........................
Posted by Luis Fraile on 6/2/2015 at 4:48 AM
I'm havinng this issue also, with 2013.4 (VS and TFS) and latest version of SSDT :(
Posted by Rick Glos on 12/8/2014 at 10:50 AM
This issue just occurred on our build server after a large number of builds and never having seen this before.
Posted by gus1691 on 8/8/2014 at 5:39 PM
Ditto, I started to experience the same issue after the July 2014 SSDT release and more frequently with the Visual Studio 2013 Update 3 patch.
Posted by wojtek.slupski on 8/8/2014 at 1:10 AM
This started happening yesterday, after I installed the latest updates for Visual Studio 2013 (they were TFS related I think so I'm not sure if this is the case)
Posted by MediaNick on 8/5/2014 at 6:01 AM
I regularly experienced this issue last year prior to the SSDT release that supported the CmdLineInMemoryStorage switch, and once I started using that switch I hadn't experienced it again until now. I'm running the July 2014 SSDT release against a SQL Server 2014 localDb instance (12.0.2000.8), and every 10th build or so I get this error.

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(1016,5): error MSB4018: The "SqlStaticCodeAnalysisTask" task failed unexpectedly. [C:\Jenkins\jobs\DROM_Dev\workspace\DROM.Log\DROM.Log.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(1016,5): error MSB4018: Microsoft.Isam.Esent.Interop.EsentVersionStoreOutOfMemoryException: Version store out of memory (cleanup already attempted)

The sqlproj already contains the CmdLineInMemoryStorage switch (set to True). What is going on?
Posted by mikeruth on 2/26/2014 at 10:17 AM
It's mentioned below that this is fixed in a post-december data tools update by using this new switch
<CmdLineInMemoryStorage>True</CmdLineInMemoryStorage>

Can someone from Microsoft confirm that this fix is included in the January update? It looks like that is specific to PDW.
Posted by jagt70 on 8/16/2013 at 7:33 AM
This is marked as Fixed, so please can you provide details of the fix. I'm suffering from this bug and it fails sqlproj builds in our CI environment.
Posted by A_R_ on 6/26/2013 at 7:38 AM
How is it marked as fixed? I get this error every other day. Here is stacktrace:
Loading project references...
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018: The "SqlBuildTask" task failed unexpectedly. [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018: Microsoft.Isam.Esent.Interop.EsentVersionStoreOutOfMemoryException: Version store out of memory (cleanup already attempted) [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Isam.Esent.Interop.Update.Save(Byte[] bookmark, Int32 bookmarkSize, Int32& actualBookmarkSize) [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.SchemaModel.ModelStore.EseCommand.InsertRow(Object[] values) [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.SchemaModel.ModelStore.InsertIntoCoreAnnotation(Type type, ModelIdentifier name, Int32 attachedCount, Int32 handle) [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.SchemaModel.ModelStore.CacheAnnotationData.Flush() [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.SchemaModel.ModelStore.CacheBase`2.EnsureSpaceExists() [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.SchemaModel.ModelStore.CacheBase`2.SetData(TKey key, TData data) [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.SchemaModel.ModelStore.CreateAnnotationImpl(Type type, ModelIdentifier identifier) [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.SchemaModel.ModelStore.CreateNamedAnnotation[TAnnotation](ModelIdentifier identifier) [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.SchemaModel.DataSchemaModel.ReferenceLinker.MarkExternalReferencesWithAnnotations(ModelStore store) [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.SchemaModel.DataSchemaModel.LoadExternals(TextReader input, String fileName, String logicalSourceName, IList`1 externalPartsSubstitution, Boolean suppressErrorsForMissingDependencies) [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.SchemaModel.DataSchemaModel.OnCustomDataAdded(CustomSchemaData customData) [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.Sql.SchemaModel.SqlSchemaModel.OnCustomDataAdded(CustomSchemaData customData) [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.SchemaModel.DataSchemaModel.AddCustomData(CustomSchemaData customData, Boolean raiseEvents) [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.Sql.SchemaModel.SqlModelBuilder.Add(CustomSchemaData customSchemaData) [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.SchemaModel.ModelBuilder.AddOrUpdate(CustomSchemaData customSchemaData) [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.Sql.Build.SqlTaskHost.AddOrUpdate(CustomSchemaData customSchemaData) [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.Tasks.Sql.TaskHostLoader.ProcessReferences(TaskLoggingHelper providedLogger, SqlTaskHost host, ErrorManager errors) [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.Tasks.Sql.TaskHostLoader.LoadImpl(ITaskHost providedHost, TaskLoggingHelper providedLogger, Boolean runAllBuildTimeValidationRules) [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.Tasks.Sql.TaskHostLoader.Load(ITaskHost providedHost, TaskLoggingHelper providedLogger, Boolean runAllBuildTimeValidationRules) [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.Tasks.Sql.SqlBuildTask.ExecuteLoadTaskHostStep() [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.Tasks.Sql.SqlBuildTask.ExecuteStep(Func`1 step) [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.Tasks.Sql.SqlBuildTask.Execute() [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext() [X:\\src\WWW.Database\WWW.Database.sqlproj]
(SqlBuild target) ->
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018: The "SqlBuildTask" task failed unexpectedly. [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018: Microsoft.Isam.Esent.Interop.EsentVersionStoreOutOfMemoryException: Version store out of memory (cleanup already attempted) [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Isam.Esent.Interop.Update.Save(Byte[] bookmark, Int32 bookmarkSize, Int32& actualBookmarkSize) [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.SchemaModel.ModelStore.EseCommand.InsertRow(Object[] values) [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.SchemaModel.ModelStore.InsertIntoCoreAnnotation(Type type, ModelIdentifier name, Int32 attachedCount, Int32 handle) [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.SchemaModel.ModelStore.CacheAnnotationData.Flush() [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.SchemaModel.ModelStore.CacheBase`2.EnsureSpaceExists() [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.SchemaModel.ModelStore.CacheBase`2.SetData(TKey key, TData data) [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.SchemaModel.ModelStore.CreateAnnotationImpl(Type type, ModelIdentifier identifier) [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.SchemaModel.ModelStore.CreateNamedAnnotation[TAnnotation](ModelIdentifier identifier) [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.SchemaModel.DataSchemaModel.ReferenceLinker.MarkExternalReferencesWithAnnotations(ModelStore store) [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.SchemaModel.DataSchemaModel.LoadExternals(TextReader input, String fileName, String logicalSourceName, IList`1 externalPartsSubstitution, Boolean suppressErrorsForMissingDependencies) [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.SchemaModel.DataSchemaModel.OnCustomDataAdded(CustomSchemaData customData) [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.Sql.SchemaModel.SqlSchemaModel.OnCustomDataAdded(CustomSchemaData customData) [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.SchemaModel.DataSchemaModel.AddCustomData(CustomSchemaData customData, Boolean raiseEvents) [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.Sql.SchemaModel.SqlModelBuilder.Add(CustomSchemaData customSchemaData) [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.SchemaModel.ModelBuilder.AddOrUpdate(CustomSchemaData customSchemaData) [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.Sql.Build.SqlTaskHost.AddOrUpdate(CustomSchemaData customSchemaData) [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.Tasks.Sql.TaskHostLoader.ProcessReferences(TaskLoggingHelper providedLogger, SqlTaskHost host, ErrorManager errors) [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.Tasks.Sql.TaskHostLoader.LoadImpl(ITaskHost providedHost, TaskLoggingHelper providedLogger, Boolean runAllBuildTimeValidationRules) [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.Tasks.Sql.TaskHostLoader.Load(ITaskHost providedHost, TaskLoggingHelper providedLogger, Boolean runAllBuildTimeValidationRules) [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.Tasks.Sql.SqlBuildTask.ExecuteLoadTaskHostStep() [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.Tasks.Sql.SqlBuildTask.ExecuteStep(Func`1 step) [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Data.Tools.Schema.Tasks.Sql.SqlBuildTask.Execute() [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [X:\\src\WWW.Database\WWW.Database.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(509,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext() [X:\\src\WWW.Database\WWW.Database.sqlproj]
Posted by Patrick [MSFT] on 2/14/2013 at 12:43 PM
This looks like a problem with our file-backed storage. We're looking at the core problem, but I've added a command-line switch to our next SSDT release (post-December 2013) to force the msbuild commandline utilities to use an in-memory model. With the next release define <CmdLineInMemoryStorage>True</CmdLineInMemoryStorage> in the first PropertyGroup in your .sqlproj file.
Posted by MikeCousins on 2/1/2013 at 9:31 AM
We're also getting this error intermittently.

Have you guys had any luck with reducing the number of parallel builds to 1?
Posted by jhess001 on 11/20/2012 at 9:52 PM
I'm having a similar issue building 2 ssdt database projects from the command line in parallel with msbuild. I get the following exception most (but not all) of the time:

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(465
,5): error MSB4018: The "SqlBuildTask" task failed unexpectedly.\r [c:\TeamProjects\Development\Main\Source\Datab
ase\Temp\ISMIS\ISMIS.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(465
,5): error MSB4018: System.ObjectDisposedException: Store must be open for this operation.\r [c:\TeamProjects\Dev
elopment\Main\Source\Database\Temp\ISMIS\ISMIS.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(465
,5): error MSB4018:    at System.IO.IsolatedStorage.IsolatedStorageFileStream..ctor(String path, FileMode mode, F
ileAccess access, FileShare share, Int32 bufferSize, IsolatedStorageFile isf)\r [c:\TeamProjects\Development\Main
\Source\Database\Temp\ISMIS\ISMIS.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(465
,5): error MSB4018:    at MS.Internal.IO.Packaging.PackagingUtilities.SafeIsolatedStorageFileStream..ctor(String
path, FileMode mode, FileAccess access, FileShare share, ReliableIsolatedStorageFileFolder folder)\r [c:\TeamProj
ects\Development\Main\Source\Database\Temp\ISMIS\ISMIS.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(465
,5): error MSB4018:    at MS.Internal.IO.Packaging.PackagingUtilities.CreateUserScopedIsolatedStorageFileStreamWi
thRandomName(Int32 retryCount, String& fileName)\r [c:\TeamProjects\Development\Main\Source\Database\Temp\ISMIS\I
SMIS.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(465
,5): error MSB4018:    at MS.Internal.IO.Packaging.SparseMemoryStream.SwitchModeIfNecessary()\r [c:\TeamProjects\
Development\Main\Source\Database\Temp\ISMIS\ISMIS.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(465
,5): error MSB4018:    at MS.Internal.IO.Packaging.SparseMemoryStream.Write(Byte[] buffer, Int32 offset, Int32 co
unt)\r [c:\TeamProjects\Development\Main\Source\Database\Temp\ISMIS\ISMIS.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(465
,5): error MSB4018:    at MS.Internal.IO.Packaging.DeflateEmulationTransform.Decompress(Stream source, Stream sin
k)\r [c:\TeamProjects\Development\Main\Source\Database\Temp\ISMIS\ISMIS.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(465
,5): error MSB4018:    at MS.Internal.IO.Packaging.CompressEmulationStream..ctor(Stream baseStream, Stream tempSt
ream, Int64 position, IDeflateTransform transformer)\r [c:\TeamProjects\Development\Main\Source\Database\Temp\ISM
IS\ISMIS.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(465
,5): error MSB4018:    at MS.Internal.IO.Packaging.CompressStream.ChangeMode(Mode newMode)\r [c:\TeamProjects\Dev
elopment\Main\Source\Database\Temp\ISMIS\ISMIS.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(465
,5): error MSB4018:    at MS.Internal.IO.Packaging.CompressStream.Seek(Int64 offset, SeekOrigin origin)\r [c:\Tea
mProjects\Development\Main\Source\Database\Temp\ISMIS\ISMIS.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(465
,5): error MSB4018:    at MS.Internal.IO.Zip.ProgressiveCrcCalculatingStream.Seek(Int64 offset, SeekOrigin origin
)\r [c:\TeamProjects\Development\Main\Source\Database\Temp\ISMIS\ISMIS.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(465
,5): error MSB4018:    at MS.Internal.IO.Zip.ZipIOModeEnforcingStream.Read(Byte[] buffer, Int32 offset, Int32 cou
nt)\r [c:\TeamProjects\Development\Main\Source\Database\Temp\ISMIS\ISMIS.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(465
,5): error MSB4018:    at System.IO.StreamReader.ReadBuffer(Char[] userBuffer, Int32 userOffset, Int32 desiredCha
rs, Boolean& readToUserBuffer)\r [c:\TeamProjects\Development\Main\Source\Database\Temp\ISMIS\ISMIS.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(465
,5): error MSB4018:    at System.IO.StreamReader.Read(Char[] buffer, Int32 index, Int32 count)\r [c:\TeamProjects
\Development\Main\Source\Database\Temp\ISMIS\ISMIS.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(465
,5): error MSB4018:    at System.Xml.XmlTextReaderImpl.ReadData()\r [c:\TeamProjects\Development\Main\Source\Data
base\Temp\ISMIS\ISMIS.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(465
,5): error MSB4018:    at System.Xml.XmlTextReaderImpl.InitTextReaderInput(String baseUriStr, Uri baseUri, TextRe
ader input)\r [c:\TeamProjects\Development\Main\Source\Database\Temp\ISMIS\ISMIS.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(465
,5): error MSB4018:    at System.Xml.XmlTextReaderImpl..ctor(String url, TextReader input, XmlNameTable nt)\r [c:
\TeamProjects\Development\Main\Source\Database\Temp\ISMIS\ISMIS.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(465
,5): error MSB4018:    at System.Xml.XmlTextReader..ctor(TextReader input)\r [c:\TeamProjects\Development\Main\So
urce\Database\Temp\ISMIS\ISMIS.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(465
,5): error MSB4018:    at Microsoft.Data.Tools.Schema.SchemaModel.DataSchemaModel.CreateXmlReader(TextReader inpu
t)\r [c:\TeamProjects\Development\Main\Source\Database\Temp\ISMIS\ISMIS.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(465
,5): error MSB4018:    at Microsoft.Data.Tools.Schema.SchemaModel.DataSchemaModel.LoadExternals(TextReader input,
String fileName, String logicalSourceName, IList`1 externalPartsSubstitution, Boolean suppressErrorsForMissingDe
pendencies)\r [c:\TeamProjects\Development\Main\Source\Database\Temp\ISMIS\ISMIS.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(465
,5): error MSB4018:    at Microsoft.Data.Tools.Schema.SchemaModel.DataSchemaModel.AddReference(CustomSchemaData c
ustomData)\r [c:\TeamProjects\Development\Main\Source\Database\Temp\ISMIS\ISMIS.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(465
,5): error MSB4018:    at Microsoft.Data.Tools.Schema.SchemaModel.DataSchemaModel.OnCustomDataAdded(CustomSchemaD
ata customData)\r [c:\TeamProjects\Development\Main\Source\Database\Temp\ISMIS\ISMIS.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(465
,5): error MSB4018:    at Microsoft.Data.Tools.Schema.Sql.SchemaModel.SqlSchemaModel.OnCustomDataAdded(CustomSche
maData customData)\r [c:\TeamProjects\Development\Main\Source\Database\Temp\ISMIS\ISMIS.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(465
,5): error MSB4018:    at Microsoft.Data.Tools.Schema.SchemaModel.DataSchemaModel.AddCustomData(CustomSchemaData
customData, Boolean raiseEvents)\r [c:\TeamProjects\Development\Main\Source\Database\Temp\ISMIS\ISMIS.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(465
,5): error MSB4018:    at Microsoft.Data.Tools.Schema.Sql.SchemaModel.SqlModelBuilder.Add(CustomSchemaData custom
SchemaData)\r [c:\TeamProjects\Development\Main\Source\Database\Temp\ISMIS\ISMIS.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(465
,5): error MSB4018:    at Microsoft.Data.Tools.Schema.SchemaModel.ModelBuilder.AddOrUpdate(CustomSchemaData custo
mSchemaData)\r [c:\TeamProjects\Development\Main\Source\Database\Temp\ISMIS\ISMIS.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(465
,5): error MSB4018:    at Microsoft.Data.Tools.Schema.Sql.Build.SqlTaskHost.AddOrUpdate(CustomSchemaData customSc
hemaData)\r [c:\TeamProjects\Development\Main\Source\Database\Temp\ISMIS\ISMIS.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(465
,5): error MSB4018:    at Microsoft.Data.Tools.Schema.Tasks.Sql.TaskHostLoader.ProcessReferences(TaskLoggingHelpe
r providedLogger, SqlTaskHost host, ErrorManager errors)\r [c:\TeamProjects\Development\Main\Source\Database\Temp
\ISMIS\ISMIS.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(465
,5): error MSB4018:    at Microsoft.Data.Tools.Schema.Tasks.Sql.TaskHostLoader.LoadImpl(ITaskHost providedHost, T
askLoggingHelper providedLogger, Boolean runAllBuildTimeValidationRules)\r [c:\TeamProjects\Development\Main\Sour
ce\Database\Temp\ISMIS\ISMIS.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(465
,5): error MSB4018:    at Microsoft.Data.Tools.Schema.Tasks.Sql.TaskHostLoader.Load(ITaskHost providedHost, TaskL
oggingHelper providedLogger, Boolean runAllBuildTimeValidationRules)\r [c:\TeamProjects\Development\Main\Source\D
atabase\Temp\ISMIS\ISMIS.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(465
,5): error MSB4018:    at Microsoft.Data.Tools.Schema.Tasks.Sql.SqlBuildTask.ExecuteLoadTaskHostStep()\r [c:\Team
Projects\Development\Main\Source\Database\Temp\ISMIS\ISMIS.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(465
,5): error MSB4018:    at Microsoft.Data.Tools.Schema.Tasks.Sql.SqlBuildTask.ExecuteStep(Func`1 step)\r [c:\TeamP
rojects\Development\Main\Source\Database\Temp\ISMIS\ISMIS.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(465
,5): error MSB4018:    at Microsoft.Data.Tools.Schema.Tasks.Sql.SqlBuildTask.Execute()\r [c:\TeamProjects\Develop
ment\Main\Source\Database\Temp\ISMIS\ISMIS.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(465
,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Ex
ecute()\r [c:\TeamProjects\Development\Main\Source\Database\Temp\ISMIS\ISMIS.sqlproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(465
,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext() [c:\TeamP
rojects\Development\Main\Source\Database\Temp\ISMIS\ISMIS.sqlproj]
Posted by Yang [MSFT] on 7/20/2012 at 3:06 PM
Hello Mike, this is Yang here. We still can't repro this issue yet, but we're working with the ESE team to pinpoint the possible root cause. Since you reported this issue via MS Connect, I need to follow up with you through this channel as required by the system :). Will keep you posted.

Thanks,
Yang