fsprojects / FAKE

FAKE - F# Make
https://fake.build
Other
1.28k stars 582 forks source link

MSBuild.build adds a bad string at the end of properties #2738

Closed akhansari closed 8 months ago

akhansari commented 1 year ago

Description

MSBuild.build adds always a bad string at the end of properties.

Like: /p:foo=bar<fun:quoteString@686>

Repro steps

path
|> MSBuild.build (fun o ->
    { o with
        Properties = [
            "Configuration", "Release"
            "DeployOnBuild", "True"
            "DeployDefaultTarget", "WebPublish"
            "WebPublishMethod", "FileSystem"
            "PublishUrl", __SOURCE_DIRECTORY__ </> "publish" </> name
            "Version", version
        ]
    })

Expected behavior

"C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\MSBuild.exe" MyProject.csproj /m /nodeReuse:False /p:RestorePackages=False /p:Configuration=Release /p:DeployOnBuild=True /p:DeployDefaultTarget=WebPublish /p:WebPublishMethod=FileSystem /p:PublishUrl=publish%5CMyProject /p:Version=1.1.0-beta

Actual behavior

"C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\MSBuild.exe" MyProject.csproj /m /nodeReuse:False /p:RestorePackages=False /p:Configuration=Release /p:DeployOnBuild=True /p:DeployDefaultTarget=WebPublish /p:WebPublishMethod=FileSystem /p:PublishUrl=publish%5CMyProject /p:Version=1.1.0-beta<fun:quoteString@686>

Known workarounds

Add a dummy property at the end.

Related information

0x53A commented 1 year ago

The issue is here:

https://github.com/fsprojects/FAKE/blob/4c22f110105018f85c359c179007c402e4d9d1a1/src/app/Fake.DotNet.MSBuild/MSBuild.fs#L684-L687

because appendQuotedIfNotNull works differently than expected. The first parameter gets passed "Some" as a function, which doesn't make any sense.

image

plainionist commented 11 months ago

This issue is open since months, without fix (which is even available as PR) MsBuild module is effectively unusable. can one pls merge the PR and release a "hot fix"? thx

DanielRowe1 commented 5 months ago

Is there going to be a release which includes this fix?

voronoipotato commented 1 month ago

@xperiandri @Numpsy are we going to see a release? It would be really helpful if we could get one.

xperiandri commented 1 month ago

Do we have the release notes file updated? https://fake.build/guide/contributing.html#Release-Process If so I'm ready to release.

Numpsy commented 1 month ago

Do we have the release notes file updated? https://fake.build/guide/contributing.html#Release-Process If so I'm ready to release.

Does the shortHash function added in #2752 / #2770 need adding to the relase note?

voronoipotato commented 1 month ago

@xperiandri @Numpsy If its between working code and having notes, I'd say I'd prefer to have a release. Right now my team is pretty confused why they can't use msbuild without some dummy field. If we can update the notes too that sounds neat but we shouldn't let that block us. Let me know if I can help

xperiandri commented 1 month ago

@Numpsy Let's add that and I release