Skip to content
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.

Make it compatible with VS 2017 new .csproj format #1

Closed
eclaus opened this issue Nov 24, 2017 · 7 comments
Closed

Make it compatible with VS 2017 new .csproj format #1

eclaus opened this issue Nov 24, 2017 · 7 comments
Assignees
Milestone

Comments

@eclaus
Copy link

eclaus commented Nov 24, 2017

When used in a VS2017 .csproj (i.e. ), targets must be changed to follow the new syntax, and therefore be correctly executed.

before (will not be executed)
<Target Name="AfterCompile" ... >
<Target Name="AfterPublish" ... >

after (will be executed)
<Target Name="TransformConfig" AfterTargets="AfterCompile" ... >
<Target Name="CopyTransformedConfig" AfterTargets="AfterPublish" ... >

The new Target names above are just an exemple, it does not matter anymore AFAIK.

@golavr golavr self-assigned this Feb 17, 2018
@golavr golavr added this to the v3.2 milestone Feb 17, 2018
golavr added a commit that referenced this issue Feb 17, 2018
Fix encoding message in visual studio of added transform files .
Add messages to output window.
Move transformation to new class.
Update csproj file - run experimental instance for debug.
@patricknolan
Copy link

patricknolan commented Mar 9, 2018

Hi @golavr I just installed this extension and am using the latest .csproj format. However, when I use "Add Config Transforms" for a config file it corrupts my project file.

Could you advise when this fix\enhancement will be available?

@golavr
Copy link
Owner

golavr commented Mar 15, 2018

Hi @patricknolan you need to remove old configurations from project file prior using the new version since i made some breaking changes in the format.
just open your project file in editor and remove all configuration transformations sections manually.
After removal just apply "Add Config Transforms" on all configs you want to transform.
I working on "Remove old Config Transforms" menu command to handle this removal, it will be part of v3.2 release.

Remove the following sections manually:
<UsingTask ...
<Target Name="AfterCompile" ...
<Target Name="AfterPublish" ...
<Target Name="AfterBuild" ...

@golavr
Copy link
Owner

golavr commented Mar 16, 2018

Fixed in v3.2

@golavr golavr closed this as completed Mar 16, 2018
@patricknolan
Copy link

Hi @golavr I just installed v3.2 and when I run "Add Config Transforms" for a config file the project still fails to load with the error

error : The attribute "xmlns" in element <UsingTask> is unrecognized.

Should this be working with v3.2 when using the latest cproj file format in 2017?

@golavr
Copy link
Owner

golavr commented Mar 16, 2018

@patricknolan please send me sample of your project i want to look into it.
Make sure you remove older transformation before Migrating to v3.2 from older versions.

Please also check if path of <UsingTask TaskName="TransformXml" AssemblyFile="..." in project file is correct.

@patricknolan
Copy link

Hi @golavr sorry for the slow response. I have attached a sample project which is basically the ASPNet.Core template project.

If I try and "Add Config Transforms" for the web.config it fails.

Should this work?

TransformExample.zip

@patricknolan
Copy link

Hi @golavr just checking if you got my previous message?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants