nil4 / dotnet-transform-xdt

Modern .NET tools and library for XDT (Xml Document Transformation)
Apache License 2.0
118 stars 12 forks source link

Does not accept specified project file #14

Closed helloserve closed 7 years ago

helloserve commented 7 years ago

My solution file (.sln) and project file (.csproj) is in the same folder location. If I simply run dotnet transform-xdt I get:

Specify which project file to use because this 'D:\Projects\Foo' contains more than one project file.

Expected behavior To specify the project file using normal syntax dotnet transform-xdt .\Foo.csproj which would result in normal operation.

Observed behavior It still displays the same error message regardless of specifying the project or solution file.

Additional This same problem persists when attempting to run the transform as part of the publish step. e.g.

 dotnet publish .\Foo.csproj -c production -o D:\webpublish\foo\
Microsoft (R) Build Engine version 15.3.409.57025 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Foo -> D:\Projects\Foo\bin\production\netcoreapp1.1\Web.dll
  Foo -> D:\webpublish\foo\
  Specify which project file to use because this 'D:\Projects\Foo' contains more than one project file.
D:\Projects\Foo\Foo.csproj(80,5): error MSB3073: The command "dotnet transform-xdt --xml "D:\Projects\Foo\Web.config" --transform "D:\Projects\Foo\Web.production.config" --output "D:\webpublish\Foo\Web.config"" exited with code 1.
nil4 commented 7 years ago

Thank you for your feedback, @helloserve! I would also expect your use case to work.

Unfortunately there is an open CLI issue (https://github.com/dotnet/cli/issues/4808) and this behavior affects all custom dotnet tools. Because it is not something specific to this project, there is nothing actionable that I can fix here, and thus I will close this issue.

I do however encourage you to add your feedback on the CLI issue. Once that is fixed, your scenario should also start working.

nil4 commented 7 years ago

@helloserve more details about the issue in this comment: https://github.com/xunit/xunit/issues/1360#issuecomment-323701095

helloserve commented 7 years ago

Thanks! Lets hope they get round to working in this pretty basic piece of functionality.