SlowCheetah no transforma el archivo en la compilación


Tengo un proyecto para el que estoy tratando de usar SlowCheetah. He creado mi archivo de configuración (Test.web.config) y todas las transformaciones que quiero usar (Debug_Mock.config, Debug_SQL.configuración, Lanzamiento) en mi configuración de compilación tengo un evento post-compilación que se supone que copia el archivo transformado en otro directorio pero el archivo no se puede encontrar

(error xcopy salió con el código 4)

SlowCheetah no parece estar transformando el archivo y colocándolo en el directorio de salida (bin carpeta) como yo esperaría. ¿Alguien tiene alguna idea de por qué no está sucediendo, tal vez un entorno en algún lugar?

FYI: Este proceso funciona en otra máquina, con el mismo proyecto. Por lo que puedo decir, la misma configuración también. Pero puede que no esté buscando en el lugar correcto.

Author: Agnel Amodia, 2012-11-21

6 answers

  • Habilite build verbosity (Tools -> Options -> Projects and Solutions -> Build and Run) y vea la diferencia entre la versión que está funcionando y la que no.

  • Que yo sepa, slow-Cheetah soporta transformaciones de configuración para los archivos app.config pero no web.configs en depuración en la actualidad. Debería poner un archivo web.config transformado en la carpeta bin de su proyecto, pero su proyecto todavía lee desde config file en la carpeta raíz. Por favor, echa un vistazo a los eventos pre / post build en http://sedodream.com/CommentView,guid,68b7e248-b9f5-4d07-bdfe-eb037bcf2cbb.aspx.

  • Puede solicitar el soporte de transformación de configuración web en la depuración en
    https://github.com/sayedihashimi/slow-cheetah/issues/39

  • Intenta reinstalar Slow-Cheetah.

 8
Author: user1858286,
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-29 02:38:09

Para mí, el problema era que el grupo de propiedades slow cheetah en el archivo de configuración estaba debajo de la sección donde comprobaba si existía.

Así que la solución era simplemente mover el grupo de propiedades por encima de esa línea en algún lugar que permitiera que la transformación se ejecutara como se esperaba.

Pon esto:

<PropertyGroup Label="SlowCheetah">
  <SlowCheetahToolsPath>$([System.IO.Path]::GetFullPath( $(MSBuildProjectDirectory)\..\packages\SlowCheetah.2.5.10.3\tools\))</SlowCheetahToolsPath>
  <SlowCheetah_EnableImportFromNuGet Condition=" '$(SC_EnableImportFromNuGet)'=='' ">true</SlowCheetah_EnableImportFromNuGet>
  <SlowCheetah_NuGetImportPath Condition=" '$(SlowCheetah_NuGetImportPath)'=='' ">$([System.IO.Path]::GetFullPath( $(MSBuildProjectDirectory)\Properties\SlowCheetah\SlowCheetah.Transforms.targets ))</SlowCheetah_NuGetImportPath>
  <SlowCheetahTargets Condition=" '$(SlowCheetah_EnableImportFromNuGet)'=='true' and Exists('$(SlowCheetah_NuGetImportPath)') ">$(SlowCheetah_NuGetImportPath)</SlowCheetahTargets>
</PropertyGroup>

Por encima de esto:

<Import Project="$(SlowCheetahTargets)" Condition="Exists('$(SlowCheetahTargets)')" Label="SlowCheetah" />
 30
Author: laurencee,
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-11-24 20:46:12

Compruebe en su Proyecto, si existe una carpeta llamada SlowCheetahque contiene el archivo SlowCheetah.Transformar.objetivos. Si falta este archivo, siga los siguientes pasos:

  1. haga clic derecho en solución
  2. "Administrar Paquetes NuGet para la Solución...", buscar SlowCheetah
  3. haga clic en"Administrar"
  4. deseleccione su proyecto y haga clic en "Aceptar"
  5. haga clic en" Administrar " de nuevo
  6. seleccione su proyecto y haga clic una vez más en "Aceptar"

Esto recreará el archivo que falta.

 15
Author: Thorsten Hüglin,
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-01-14 14:04:35

Con SlowCheetah 2.5.15 y Visual Studio 2015, tuve que desinstalar el paquete nuget y luego eliminar manualmente lo siguiente del correspondiente .archivo csproj:

<Import Project="$(SlowCheetahTargets)" Condition="Exists('$(SlowCheetahTargets)')" Label="SlowCheetah" />

Y

<PropertyGroup Label="SlowCheetah">
  <SlowCheetahToolsPath>$([System.IO.Path]::GetFullPath( $(MSBuildProjectDirectory)\..\packages\SlowCheetah.2.5.15\tools\))</SlowCheetahToolsPath>
  <SlowCheetah_EnableImportFromNuGet Condition=" '$(SlowCheetah_EnableImportFromNuGet)'=='' ">true</SlowCheetah_EnableImportFromNuGet>
  <SlowCheetah_NuGetImportPath Condition=" '$(SlowCheetah_NuGetImportPath)'=='' ">$([System.IO.Path]::GetFullPath( $(MSBuildProjectDirectory)\Properties\SlowCheetah\SlowCheetah.Transforms.targets ))</SlowCheetah_NuGetImportPath>
  <SlowCheetahTargets Condition=" '$(SlowCheetah_EnableImportFromNuGet)'=='true' and Exists('$(SlowCheetah_NuGetImportPath)') ">$(SlowCheetah_NuGetImportPath)</SlowCheetahTargets>
</PropertyGroup>

Una vez hecho esto y reinstalado el paquete SlowCheetah nuget, mi problema se resolvió.

 3
Author: James Blake,
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-07-08 16:49:01

Después de una reinstalación como se describió anteriormente, necesitaba agregar los nodos subType y transformOnBuild a mi archivo csproj, y comenzó a funcionar para mí.

<None Include="App.config">
  <SubType>Designer</SubType>
  <TransformOnBuild>true</TransformOnBuild>
</None> 
<None Include="App.QA.config">
  <DependentUpon>App.config</DependentUpon>
  <IsTransformFile>True</IsTransformFile>
</None>
 3
Author: Hink,
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-06-05 05:51:36

Tenga en cuenta que debe instalar la extensión SlowCheetah Visual studio Y el paquete SlowCheetah nuget para el proyecto en cuestión para que la transformación funcione.

 3
Author: Frank Liu,
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-09-28 08:20:21