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] MSBuild properties not supported for build and nx graph #835

Open
Tantol opened this issue Mar 4, 2024 · 1 comment
Open

[BUG] MSBuild properties not supported for build and nx graph #835

Tantol opened this issue Mar 4, 2024 · 1 comment
Labels
bug Something isn't working needs-triage This issue has yet to be looked over by a core team member

Comments

@Tantol
Copy link

Tantol commented Mar 4, 2024

Current Behavior

MSBuild properties are not supported for nx.

Example:
If in .csproj i use relative path:

(...) 
<ProjectReference Include="..\..\..\..\libs\x\x.csproj" />

Build with "--no-dependencies" works and nx graph show everything as expected.

But when i use MSBuild properties like this:
Directory.Build.props:

    <RepoRoot>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)'))</RepoRoot>

.csproj:

(...) 
<ProjectReference Include="$(RepoRoot)\libs\x\x.csproj" />

nx graph show no connection with my x library and build with "--no-dependencies" throw CSC : error CS0006: Metadata file

Expected Behavior

nx graph and build with --no-dependencies should work with below configuration:

Directory.Build.props:

    <RepoRoot>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)'))</RepoRoot>

.csproj:

(...) 
<ProjectReference Include="$(RepoRoot)\libs\x\x.csproj" />

Github Repo

No response

Steps to Reproduce

Nx Report

.

nx.json

.

Failure Logs

CSC : error CS0006: Metadata file

Additional Information

No response

@Tantol Tantol added bug Something isn't working needs-triage This issue has yet to be looked over by a core team member labels Mar 4, 2024
@jvskriubakken
Copy link

jvskriubakken commented Mar 5, 2024

Hi, have you followed this guide?

https://nx.dev/showcase/example-repos/add-dotnet

I had to add the following config to Directory.build.props
<DefaultItemExcludes>$(DefaultItemExcludes);obj/**</DefaultItemExcludes>

to get it to work properly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage This issue has yet to be looked over by a core team member
Projects
None yet
Development

No branches or pull requests

2 participants