In web project, project File gets modified while adding transformation #14

Closed
mukeshkagarwal opened this Issue Jun 4, 2012 · 6 comments

Projects

None yet

2 participants

@mukeshkagarwal

in a web project if we have transformation files added manually and we click on the transformation config file we cannot see the
Preview transform action in context menu. For this we have to click on "add transform" in root config file and then the action item appears in the context menu of transform config file.

Clicking on Add transform modifies Project File that is not desired.

@mukeshkagarwal

in the csproj file I found the  following changes.

  1. A new PropertyGroup Node Added under Project Node

    <PropertyGroup>
        <SlowCheetahTargets Condition=" '$(SlowCheetahTargets)'=='' ">$(LOCALAPPDATA)\Microsoft\MSBuild\SlowCheetah\v1\SlowCheetah.Transforms.targets</SlowCheetahTargets>
      </PropertyGroup>

  2. A new TransformOnBuild Node Added at Project/ItemGroup/Content[@Include="Web.config"]       <TransformOnBuild>true</TransformOnBuild>
  3. and for each tranform file a new "IsTransformFile" Node added under
    Project/ItemGroup/Content[@Include="Web.1.debug.config"]
    <IsTransformFile>True</IsTransformFile>
  4. A new Import Node Added under Project Node(at the end of file)

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

All the changes can be un done except the 3rd one if we want to keep the "Preview transform" action live.

@sayedihashimi
Owner

Interesting thanks, I wasn't aware of this behavior. I will take a look at this but probably not until a week or two. Currently I'm away from home and focused some speaking that I'm doing.

@sayedihashimi
Owner

In this case I do agree that we could prevent adding those items to the project file if we are considering only web.config. For other files we need to update the project to ensure that they get transformed. In your case are you discussing previewing of web.config specifically? I want to make sure that I understand your issue before working to solve it.

@mukeshkagarwal

Yes, I am discussing for previewing only.

@sayedihashimi
Owner

I verified that for the Preview command it will not modify the project. I did make a change to exclude the "Add Transform" command for web.config since it has its own "Add Config Transform" command which will not modify the project. This change was made in commit a067a73. I've got a new build available at https://dl.dropbox.com/u/40134810/SlowCheetah/SlowCheetah-a067a7375d.zip. I would appreciate if you verify it. For now I'm going to close this item because I think it's resolved. Let me know if I mis-understood anything or didn't fix it correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment