Skip to content

PowerShell script is not executed BeforeBuild anymore #63060

@vsfeedback

Description

@vsfeedback

This issue has been moved from a ticket on Developer Community.


[severity:It's more difficult to complete my work] [regression] [worked-in:17.13]
It is a Blazor Wasm PWA with AOT.
I created a PowerShell script that is executed before build when it is during publish:

My *.csproj contains:

	<!--Before a build but only when it is during publish, execute a PowerShell script, that ...-->
	<Target Name="PrePublishScript" BeforeTargets="BeforeBuild" Condition="'$(IsPublishing)' == 'True'">
		<Exec Command="powershell -ExecutionPolicy Bypass -File myScript.ps1" />
	</Target>

It worked with 17.13 and does not work after the update to 17.14.


Original Comments

Philipp Rollmann on 5/27/2025, 11:46 AM:

I just found out, deleting Condition="'$(IsPublishing)' == 'True'" makes the script run, but of course during every build and not only publish builds.
I want to run the script only during a publish build.

Feedback Bot on 5/28/2025, 05:25 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

Philipp Rollmann on 7/28/2025, 03:08 PM:

I just tested it with 17.14.8 and it is still not working.
Any news on this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Author: Migration Bot 🤖The issue was created by a issue mover bot. The author may not be the actual author.NativeAOTNeeds: Author FeedbackThe author of this issue needs to respond in order for us to continue investigating this issue.needs-area-labelUsed by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions