Skip to content

Script generation task fails with new net8.0 Artifacts output #1707

@DorianGreen

Description

@DorianGreen

Describe the bug

Description

When using Artifacts output layout in net8.0+ the script generation task fails the build as it cant find the output directory

Expected behavior

When using Artifacts layout, the script generation task should respect the new artifact directories for obj, bin, and publish

Actual behavior

The script generation task prefixes the output path with the project dir - even though the output path is a absolute path and not a relative one.

Versions

Tested with 8.x, but would apply to all versions that can be used in net8.0+ projects.

Steps to reproduce

Enable Artifacts output as described in: https://learn.microsoft.com/en-us/dotnet/core/sdk/artifacts-output

Relevant log output

Additional Information

Workarounds

Disabling script generation

Possible solutions

In the target file, you can check if the paths are relative before appending $(ProjectDir)

<SqlPersistenceScriptBuilderTask
AssemblyPath="$(ProjectDir)@(IntermediateAssembly)"
IntermediateDirectory="$(ProjectDir)$(IntermediateOutputPath)"
ProjectDirectory="$(ProjectDir)"
SolutionDirectory="$(SqlPersistenceSolutionDir)" />

Additional information

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions