Giter Site home page Giter Site logo

Comments (7)

KalleOlaviNiemitalo avatar KalleOlaviNiemitalo commented on June 18, 2024

This seems caused by the operating-system-dependent behaviour of CmdLine@2 referenced in azure-pipelines.yml. On Windows, it uses CMD, which does not remove quotation marks from the echo command. On Linux, it uses bash, which removes them.

from msbuild.

Varorbc avatar Varorbc commented on June 18, 2024

@KalleOlaviNiemitalo What should I do? Can you give me some advice? Thanks.

from msbuild.

KalleOlaviNiemitalo avatar KalleOlaviNiemitalo commented on June 18, 2024

I can think of ways to fix it, but haven't tried these:

from msbuild.

Varorbc avatar Varorbc commented on June 18, 2024

This seems caused by the operating-system-dependent behaviour of CmdLine@2 referenced in azure-pipelines.yml. On Windows, it uses CMD, which does not remove quotation marks from the echo command. On Linux, it uses bash, which removes them.

It occurred to me that this was not the case, and if so, the value of Test1 should be empty in windows. Now it is true in both windows and linux environments, and as expected, there is no problem.

from msbuild.

KalleOlaviNiemitalo avatar KalleOlaviNiemitalo commented on June 18, 2024

It occurred to me that this was not the case, and if so, the value of Test1 should be empty in windows.

What? Your Windows build log shows

  Restored D:\a\1\s\ClassLibrary1\ClassLibrary1\ClassLibrary1.csproj (in 170 ms).
  Test1= true" Test2=true
  ClassLibrary1 -> D:\a\1\s\ClassLibrary1\ClassLibrary1\bin\Debug\net8.0\ClassLibrary1.dll
  Test1= true" Test2=true

where the value of Test1 clearly includes a quotation mark. And the Linux build log has

  Restored /home/vsts/work/1/s/ClassLibrary1/ClassLibrary1/ClassLibrary1.csproj (in 116 ms).
  Test1= true Test2=false
  ClassLibrary1 -> /home/vsts/work/1/s/ClassLibrary1/ClassLibrary1/bin/Debug/net8.0/ClassLibrary1.dll
  Test1= true Test2=false

without the quotation mark.

(The space between Test1= and true comes from your MSBuild code.)

from msbuild.

Varorbc avatar Varorbc commented on June 18, 2024

My mistake, I ignore it "

What? Your Windows build log shows

  Restored D:\a\1\s\ClassLibrary1\ClassLibrary1\ClassLibrary1.csproj (in 170 ms).
  Test1= true" Test2=true
  ClassLibrary1 -> D:\a\1\s\ClassLibrary1\ClassLibrary1\bin\Debug\net8.0\ClassLibrary1.dll
  Test1= true" Test2=true

from msbuild.

Varorbc avatar Varorbc commented on June 18, 2024

https://learn.microsoft.com/en-us/azure/devops/pipelines/process/set-variables-scripts?view=azure-devops&tabs=powershell

from msbuild.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.