Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to copy file Microsoft.SqlServer.Types

After installing Microsoft.SqlServer.Types (Spatial) package,I get build errors

  • Error 14 Could not copy "myapp\packages\Microsoft.SqlServer.Types.11.0.1\nativeBinaries\x86\msvcr100.dll" to "bin\SqlServerTypes\x86\msvcr100.dll". Exceeded retry count of 10. Failed.
  • Error 26 Could not copy "myapp\packages\Microsoft.SqlServer.Types.11.0.1\nativeBinaries\x86\SqlServerSpatial110.dll" to "bin\SqlServerTypes\x86\SqlServerSpatial110.dll". Exceeded retry count of 10. Failed.
  • Error 15 Unable to copy file "myapp\Microsoft.SqlServer.Types.11.0.1\nativeBinaries\x86\msvcr100.dll" to "bin\SqlServerTypes\x86\msvcr100.dll". The process cannot access the file 'bin\SqlServerTypes\x86\msvcr100.dll' because it is being used by another process.
  • Error 27 Unable to copy file "myapp\packages\Microsoft.SqlServer.Types.11.0.1\nativeBinaries\x86\SqlServerSpatial110.dll" to "bin\SqlServerTypes\x86\SqlServerSpatial110.dll". The process cannot access the file 'bin\SqlServerTypes\x86\SqlServerSpatial110.dll' because it is being used by another process.

After Investigation I've found that my iis worker process block these files.After restart iis,application building successfuly,but than erros appears.

How can I solve this problem???

like image 398
vborutenko Avatar asked Sep 16 '14 15:09

vborutenko


1 Answers

I found a natural solution for this.

I just stop IIS before the compilation begin and then start again IIS after the compilation.

In your project go to Properties > Build Events:

  • Pre-build event command line: iisreset /STOP

  • Post-build event command line: iisreset /START

like image 102
Anicar Cabrera Avatar answered Sep 27 '22 17:09

Anicar Cabrera