Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Ouput path absolute only for OSX? #10764

Closed
GustavEikaas opened this issue Oct 8, 2024 · 5 comments
Closed

[Bug]: Ouput path absolute only for OSX? #10764

GustavEikaas opened this issue Oct 8, 2024 · 5 comments
Assignees
Labels
author-responded Author responded, needs response from dev team. bug Priority:2 Work that is important, but not critical for the release

Comments

@GustavEikaas
Copy link

Issue Description

Description

I got an issue in my vim plugin for dotnet development saying that the output path was incorrect. After some digging we found out that seemingly only on OSX the OutputPath msbuild variable is absolute

OSX

❯ dotnet msbuild ./ -getProperty:OutputPath -getProperty:TargetExt -getProperty:AssemblyName -getProperty:TargetFramework
{
  "Properties": {
    "OutputPath": "/Users/alex/GitHub/redacted/channel-notif-preferences/services/channel-notif-preferences/src/../bin/ChannelNotifPreferences/Debug/net8.0/",
    "TargetExt": ".dll",
    "AssemblyName": "ChannelNotifPreferences",
    "TargetFramework": "net8.0"
  }
}

Windows

MSBuild version 17.11.3+0c8610977 for .NET
17.11.3.35201

❯ dotnet msbuild ./ -getProperty:OutputPath -getProperty:TargetExt -getProperty:AssemblyName -getProperty:TargetFramework
{
  "Properties": {
    "OutputPath": "bin\\Debug\\net8.0\\",
    "TargetExt": ".dll",
    "AssemblyName": "NeovimDebugProject.Api",
    "TargetFramework": "net8.0"
  }
}

Ubuntu WSL

MSBuild version 17.8.5+b5265ef37 for .NET
17.8.5.5502

❯ dotnet msbuild ./ -getProperty:OutputPath -getProperty:TargetExt -getProperty:AssemblyName -getProperty:TargetFramework
{
  "Properties": {
    "OutputPath": "bin/Debug/net8.0/",
    "TargetExt": ".dll",
    "AssemblyName": "dotnet-api",
    "TargetFramework": "net8.0"
  }
}

I guess my question is if this is intentional or not. In my code im querying this variable to be able to construct a path to the final build dll.

Link to issue:
GustavEikaas/easy-dotnet.nvim#143

Steps to Reproduce

Use a machine running OSX

  1. Create a console app dotnet project
  2. Run dotnet msbuild ./ -getProperty:OutputPath -getProperty:TargetExt -getProperty:AssemblyName -getProperty:TargetFramework
  3. Inspect the OutputPath

Expected Behavior

I guess I would expect OSX to behave like this

❯ dotnet msbuild ./ -getProperty:OutputPath -getProperty:TargetExt -getProperty:AssemblyName -getProperty:TargetFramework
{
  "Properties": {
    "OutputPath": "/bin/Debug/net8.0/",
    "TargetExt": ".dll",
    "AssemblyName": "ChannelNotifPreferences",
    "TargetFramework": "net8.0"
  }
}

Actual Behavior

❯ dotnet msbuild ./ -getProperty:OutputPath -getProperty:TargetExt -getProperty:AssemblyName -getProperty:TargetFramework
{
  "Properties": {
    "OutputPath": "/Users/alex/GitHub/redacted/channel-notif-preferences/services/channel-notif-preferences/src/../bin/ChannelNotifPreferences/Debug/net8.0/",
    "TargetExt": ".dll",
    "AssemblyName": "ChannelNotifPreferences",
    "TargetFramework": "net8.0"
  }
}

Analysis

No response

Versions & Configurations

No response

@maridematte maridematte added the Priority:2 Work that is important, but not critical for the release label Oct 8, 2024
@GustavEikaas
Copy link
Author

Seems likely this is caused by user config or MSBuild variables, im currently investigating but its likely not a bug in msbuild. Sorry for the trouble

@JanKrivanek
Copy link
Member

JanKrivanek commented Oct 9, 2024

We recommend attaching a binlog so we can conduct further research.
Details on sharing binary logs
More information on binary logs
NOTE: Binary logs capture environment information. Ensure it does not include any information you don't want to be public before you attach one.
If you want to share one just with Microsoft, you can report a problem through Visual Studio and share it privately with Microsoft.

@JanKrivanek
Copy link
Member

That being said - you can try to use MSBuild Binary Log Viewer to search for all reassignments of OutputPath property - that should reveal quickly if customisations are culprit.

@JanKrivanek JanKrivanek added the needs-more-info Issues that need more info to continue investigation. label Oct 9, 2024
@GustavEikaas
Copy link
Author

Issue resolved it was user configuration messing up the path

@GustavEikaas GustavEikaas closed this as not planned Won't fix, can't repro, duplicate, stale Oct 9, 2024
@dotnet-policy-service dotnet-policy-service bot added author-responded Author responded, needs response from dev team. and removed triaged needs-more-info Issues that need more info to continue investigation. labels Oct 9, 2024
@JanKrivanek JanKrivanek self-assigned this Oct 9, 2024
@JanKrivanek
Copy link
Member

Thank you for comming quickly back to us with the results!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author-responded Author responded, needs response from dev team. bug Priority:2 Work that is important, but not critical for the release
Projects
None yet
Development

No branches or pull requests

3 participants