-
Notifications
You must be signed in to change notification settings - Fork 249
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
Init.ps1 does not run unless package manager window has been opened #2428
Comments
@zwaap - please confirm. This is a problem that occurred in v3.3 (and perhaps before, and likely still with v3.4.1 which just shipped this week)? |
@zwaap that's the design, init.ps1 is not intended to make ANY changes to the projects, it is intended to setup the powershell console to run commands. What does your init.ps1 do? |
@rrelyea confirmed this is still the behavior with v3.4.1.807. Here is a trivial NuGet package to repro: Esri.InitScriptTest.0.0.0.1.nupkg.zip The package contains an Init.ps1 script that creates an empty file in the solution directory on execute. @yishaigalatzer what is the Init.ps1 intended for from a user perspective? We are using it to re-hydrate required static libraries if they are missing. The most common case for this is when the package needs to be restored, but it can also occur if the user otherwise removes these files. |
That's not the intent of init.ps1, and we will not enable it. NuGet is not an automation entry point into visual studio, and please do not use it as such. If you need anything that rehydrates stuff, please add msbuild targets so they can run on build also outside of visual studio |
@yishaigalatzer : msbuildtargets are not helpful in any cases. For instance: You will share an SharePoint Project between several SharePoint Target Versions. In this case, you have to Change the msproj-file BEFORE build, because a build isnt possible until you have the correct Office Version set into Project file. |
@yishaigalatzer: Related to what @breti169 mentioned, some things need to be configured in the PackageManager console on solution open that are specific to that solution and not other solutions. For instance, right now my developers need to add environment variables to allow LOCAL-ONLY changes that dont apply to the build server and beyond. being able to run a script in Package Manager Console at solution open is a desired result so they dont have to manually type them every time they start their day. |
The Init.ps1 script will only run if the NuGet Package Manager Console window has been opened prior to opening a solution. While this behavior is documented here, the behavior is nonetheless a real stumbling block for users of packages that rely on this script. I spoke with team members about the behavior at the Build conference and they suggested that I log an issue for further evaluation.
The text was updated successfully, but these errors were encountered: