fsprojects / Paket.VisualStudio

Manage your Paket (http://fsprojects.github.io/Paket/) dependencies from Visual Studio!
MIT License
147 stars 51 forks source link

always generates load scripts? #175

Open ntwilson opened 5 years ago

ntwilson commented 5 years ago

Description

Whenever I restore from Visual Studio, it always generates a ".paket/load" folder with load scripts. I have tried putting generate_load_scripts: false in my paket.dependencies file, as well as just removing any mention of generate_load_scripts. This is only an issue because sometimes I use VS Code as well, and OmniSharp (the plugin for C# in VS Code) will crash VS Code entirely if I open a folder that contains load scripts.

Repro steps

Please provide the steps required to reproduce the problem

  1. Create a solution containing C# projects that uses paket.

  2. Add generate_load_scripts: false to the top of the paket.dependencies file.

  3. Set the VS setting to "Automatically restore packages during build in Visual"

  4. Build the solution in VS

Expected behavior

The .paket folder would only contain paket.exe, paket.Restore.targets, and paket.targets

Actual behavior

The .paket folder also contains a "load" folder with load scripts.

Known workarounds

Delete the load folder manually each time you open VS Code.

Related information

forki commented 5 years ago

Could you please upload a zip with the repro?

nathan wilson notifications@github.com schrieb am Di., 2. Apr. 2019, 17:55:

Description

Whenever I restore from Visual Studio, it always generates a ".paket/load" folder with load scripts. I have tried putting generate_load_scripts: false in my paket.dependencies file, as well as just removing any mention of generate_load_scripts. This is only an issue because sometimes I use VS Code as well, and OmniSharp (the plugin for C# in VS Code) will crash VS Code entirely if I open a folder that contains load scripts. Repro steps

Please provide the steps required to reproduce the problem

1.

Create a solution containing C# projects that uses paket. 2.

Add generate_load_scripts: false to the top of the paket.dependencies file. 3.

Set the VS setting to "Automatically restore packages during build in Visual" 4.

Build the solution in VS

Expected behavior

The .paket folder would only contain paket.exe, paket.Restore.targets, and paket.targets Actual behavior

The .paket folder also contains a "load" folder with load scripts. Known workarounds

Delete the load folder manually each time you open VS Code. Related information

  • Operating system: Win 10
  • Branch: Installed from the extension marketplace
  • .NET Runtime Version: ? Of my solution? net471
  • Performance information, links to performance testing scripts: none

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/fsprojects/Paket.VisualStudio/issues/175, or mute the thread https://github.com/notifications/unsubscribe-auth/AADgNLduSLlpNRRkjhBbTfWevlHfXMgmks5vc31zgaJpZM4cYcVD .

ntwilson commented 5 years ago

Okay, I had some trouble reproducing it from scratch, and learned more about the problem. Apparently it happens when your paket.dependencies file and paket.lock file are out-of-sync. Using the CLI, paket.dependencies wins (if you say generate_load_scripts: false in paket.dependencies, it doesn't matter what's in the paket.lock). Using the VS extension, the paket.lock file wins (if you have GENERATE-LOAD-SCRIPTS: ON at the top of your lock file, it doesn't matter what's in paket.dependencies). That's what threw me off. I have that situation replicated in the zip file attached. If you look in paket.dependencies, it says generate_load_scripts: false, but if you open the .sln file in VS and build, it will produce a .paket/load folder.
Now that I know the cause and the fix, it's quite easy for me to workaround, so I guess this issue is just FYI. Feel free to close if you want.

vs-paket-trouble.zip