ASP.Net no se puede crear / shadow copy


Recibo este error repetidamente al desarrollar ASP.Net aplicaciones:

  Cannot create/shadow copy 'XXXXX' when that file already exists

Donde XXXXX es una DLL aleatoria. Por lo general, la DLL es una de las DLL de la Biblioteca Empresarial de Microsoft, pero varía.

Es realmente aleatorio, y es muy frustrante. Pasaré horas sin obtener el error, y luego obtendré este error cada 10-20 minutos.

He visto varias soluciones. Por ejemplo, esta pregunta. He intentado usar la opción de solución Limpia, y también he simplemente reinicié mi IIS local. Sin embargo, todavía ocurre con la misma frecuencia aleatoria pero persistente.

También he visto a muchas personas mencionar el uso de esta opción en el archivo de configuración:

<hostingEnvironment shadowCopyBinAssemblies="false" />

Sin embargo, otros han mencionado que es problemático, y definitivamente no debe ser utilizado en la producción.

Entonces, ¿debería darme por vencido y probar la opción shadowCopyBinAssemblies? (Y asegúrese de no copiar este cambio a otros entornos.) ¿Soy el único que tiene este problema que a menudo?

Nota: Estoy usando Visual Studio 2008.

Author: Community, 2009-06-17

12 answers

Las siguientes soluciones vienen de este ahora desaparecido problema de connect :

  • añade <hostingEnvironment shadowCopyBinAssemblies="false" /> a la sección <system.web> de tu web.archivo de configuración.
  • Reinicie Cassini cuando tenga el problema
  • Si obtiene el error, detenga el depurador, haga clic derecho en la solución y "limpiar solución". Pulse F5 para reiniciar el depurador. Esto es realmente molesto, ya que tiene una tasa de error >50% para mí y usted pensaría que hay no debe ser una opción manual para LIMPIAR LA SOLUCIÓN! Este $1200 Aplicación POS debe limpiarlo para usted automáticamente!
  • Aquí hay otra solución que puede ser más atractiva para algunos, cortesía de Gary Farr ( http://blogs.claritycon.com/blogs/gary_farr/archive/2007/03/09/2888.aspx).
  • Agrega lo siguiente a tus eventos previos a la compilación:

    IF EXIST $(TargetPath).LOCKED (del $(TargetPath).LOCKED) ELSE (IF EXIST $(TargetPath) (move $(TargetPath) $(TargetPath).LOCKED))

  • Una solución alternativa que hace el trabajo por mí es en lugar de usar "Build" use"Build Solution"

  • Después de una construcción exitosa, cuento hasta diez, luego actualizar mi formulario web.
  • He encontrado que al volver a registrarse ASP.NET contra IIS el problema "desaparece" - no he tenido el problema desde entonces. Tendrá que ejecutar lo siguiente en la línea de comandos:
    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i. Es muy probable que esto no funcione para todos, es un problema complejo.
  • reiniciar VS.
  • Al limpiar la solución, se emitieron algunas advertencias sobre los archivos que no se pudieron eliminar. Estos archivos tenían su propiedad de solo lectura establecida. Después de establecer la propiedad de estos archivos para leer / escribir, el problema fue resuelto.
  • Reiniciar IIS

EDITAR: Elementos recuperados de una versión antigua de la página (cortesía de archive.org).

 23
Author: daxsorbito,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-10-21 12:18:22

Espere entre 10 y 30 segundos y pulse actualizar. Por alguna razón esto siempre funciona para mí.

 39
Author: joshcomley,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-06-17 10:40:29

Solo reinicia Visual studio, eso funcionó para mí.

 5
Author: Ayo Adesina,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-03-14 08:09:57

Abra las propiedades de su proyecto, abra la pestaña Web y asegúrese de que la opción Habilitar edición y continuar no esté marcada.

 1
Author: Ricardo Sanchez,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-11-06 14:48:25

En mi situación solo iisreset funcionó.

 1
Author: İbrahim ULUDAĞ,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-04-25 07:38:24

Tuve este problema con frecuencia cuando trabajaba con una DLL importada que creamos.

Los intentos de detener está sucediendo fallaron, e incluso introdujeron diferentes problemas, pero cada vez que ocurría, simplemente hacía una solución de reconstrucción y el problema desaparecía inmediatamente para esa compilación.

Además, no he visto el problema desde que trabajé en Visual Studio 2002. 2008 no tiene este tema que yo sepa, ni tampoco 2005. ¿Estás usando un VS mayor?

 0
Author: CRice,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2009-06-18 01:06:39

VAYA al modo de diseño y luego haga clic derecho y presione ver en el navegador, el problema desaparecerá Anil Madan

 0
Author: Anil,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-02-06 15:16:45

Agregue estas líneas en la línea de comandos del evento pre-build, que básicamente desbloquea el DLL dentro de Visual Studio:

 IF EXIST $(TargetPath).LOCKED  (del $(TargetPath).LOCKED)
  ELSE (IF EXIST $(TargetPath) (move $(TargetPath) $(TargetPath).LOCKED))

Vuelva a compilar y su error no se puede copiar DLL no se producirá.

 0
Author: batman,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-03-12 22:09:32

Si utiliza Entity Framework:

Mensaje de error: "No se puede crear/shadow copy" cuando ese archivo ya existe."

Solución: "Espere unos segundos y actualice la página."

Para obtener más información, visite: Escenarios Avanzados de Entity Framework 6 para una aplicación web MVC 5 (12 de 12)

 0
Author: Murat Yıldız,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-03-13 11:25:25

Estaba teniendo el mismo problema, al colocar este código en una web.config funcionó para mí.

<hostingEnvironment shadowCopyBinAssemblies="false" />
 0
Author: Musakkhir Sayyed,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-03-21 21:34:51

Simplemente Refresca (F5) tu página.

 0
Author: Mohammad Imran,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-05-18 05:22:05

Limpia y vuelve a construirlo. Me ayuda y a menudo funcionó para mí

 0
Author: Bashir ahmad,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-02-25 12:48:32