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

"PostBuildScripts" folder is not created when installing project #6

Open
arteny opened this issue Jan 31, 2021 · 4 comments
Open

"PostBuildScripts" folder is not created when installing project #6

arteny opened this issue Jan 31, 2021 · 4 comments
Labels

Comments

@arteny
Copy link

arteny commented Jan 31, 2021

As a result, no actions when publish for changing MinimumRequred version.
VS2019 is used (with Reference typed dependencies)

@deadlydog
Copy link
Owner

When using reference typed NuGet dependencies (i.e. they're added to the .csproj file instead of a separate packages.config file), NuGet does not allow running custom scripts during the NuGet package install. The NuGet package relied on using a custom script to create the PostBuildScripts directory and copy the AutoUpdateProjectsMinimumRequiredClickOnceVersion.ps1 into it, as well as updating the .csproj file to call the PowerShell script after a build finishes.

So in your case, I believe you'll need to manually copy the directory and file into your project, and add the code to the .csproj file.

Let me know if that does the trick or not, and sorry for taking so long to give a response.

@deadlydog
Copy link
Owner

I've updated the ReadMe page to include documentation on how to manually install the script when using .NET Core projects, as well as updated the script (v1.7.0) to find and update project Publish Profiles. I believe that should address this issue. If not, please reopen it with more information.

@arteny
Copy link
Author

arteny commented Dec 30, 2022

@deadlydog
Even manually add scripts following your new instructions, it doesn't work:
1> Get-Item : Cannot find path 'C:\Projects\MyProject\Properties\PublishProfiles' because it does not
1> exist.
1> At C:\Projects\MyProject\PostBuildScripts\AutoUpdateProjectsMinimumRequiredClickOnceVersion.ps1:379
1> char:3
1> + Get-Item "$projectDirectory\Properties\PublishProfiles*" -In ...
1> + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1> + CategoryInfo : ObjectNotFound: (C:\Projects\My...PublishProfiles:String) [Get-Item], ItemNotFoundExcep
1> tion
1> + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetItemCommand

@deadlydog
Copy link
Owner

deadlydog commented Mar 4, 2023

Thanks, that error message looks like the script is failing because the PublishProfiles directory does not exist in the project yet. I'll need to get that fixed up to simply ignore trying to look in that directory if it does not exist.

@deadlydog deadlydog reopened this Mar 4, 2023
@deadlydog deadlydog added the bug label Mar 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants