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

NuGet integration - Docu #62

Closed
Tip77 opened this issue May 20, 2020 · 6 comments
Closed

NuGet integration - Docu #62

Tip77 opened this issue May 20, 2020 · 6 comments
Labels

Comments

@Tip77
Copy link

Tip77 commented May 20, 2020

Hi,

sorry if this is the wrong place to post a question. The main page referenced the Wiki where I didn't find a link to a forum or aslike.

What I am looking for is "How to setup NuGet package so that I don't have to install the VisualStudio Extension".

Many thanks
Martin

@3F
Copy link
Owner

3F commented May 20, 2020

Don't worry, this is a correct place to ask anything related to vsSolutionBuildEvent since Disqus is disabled now.

What I am looking for is "How to setup NuGet package so that I don't have to install the VisualStudio Extension".

Unfortunately part of the documentation contains outdated information but you need to look at this:

Please note the following changes starting with v1.14:

Therefore you can simply try like this:

gnt /p:ngpackages="vsSolutionBuildEvent"
( old packages still can be found here: https://www.nuget.org/packages/vsSBE.CI.MSBuild/ )

So, for example, Conari used this bootstrap to activate modern vsSolutionBuildEvent:

Here is result for CI (without VisualStudio Extension): https://ci.appveyor.com/project/3Fs/conari-wkygr/builds/30509246

@3F 3F added the question label May 20, 2020
@Tip77
Copy link
Author

Tip77 commented May 20, 2020

Thanks for the quick response. I manually installed the NuGet packages (via VisualStudio). How do I now setup the VisualStudio solution so that the script in .vssbe is executed?

@3F
Copy link
Owner

3F commented May 20, 2020

I manually installed the NuGet packages (via VisualStudio).

Please be careful, this is not supported at least officially because of NuGet/Home#1521 (we do not follow any possible nuget solution for this, so I can't guarantee anything)

I recommend https://github.com/3F/GetNuTool

How do I now setup the VisualStudio solution so that the script in .vssbe is executed?

You don't need to do anything. Initially you need just to:

  1. Choose the way of receiving NuGet package that supports solution level. Any ways. I recommend GetNuTool because it can be even integrated into batch scripts and does not require any dependencies.
  2. Just activate plugin as you're prefer (doc)

That's all.

Modern versions provides cim.cmd wrapper (located in packages\vsSolutionBuildEvent\cim.cmd by default)

I hope you understand that for interaction with vsSolutionBuildEvent inside IDE you need of course VisualStudio plugin. For other cases you can simply activate it such from my example above:

packages\vsSolutionBuildEvent\cim.cmd "YourSolutionFile.sln"

@3F
Copy link
Owner

3F commented May 20, 2020

(not tested) More like it could be probably also activated even without VisualStudio plugin through VisualStudio IDE project Properties - Build Events or manually in your project files (VisualStudio):

  <Target Name="ActivateVSSBE" BeforeTargets="Build"> 
    <!-- or better to try with BeforeBuild or _CheckForInvalidConfigurationAndPlatform or AssignProjectConfiguration or _PrepareForBuild etc -->
    <Exec Command="packages\vsSolutionBuildEvent\cim.cmd $(SolutionPath)" WorkingDirectory="$(SolutionDir)" />
  </Target>

That's obviously strange, but if you need, you can try this.

Let me know what problem are you trying to solve.

@Tip77 Tip77 closed this as completed May 20, 2020
@Tip77
Copy link
Author

Tip77 commented May 20, 2020

My intention was to include versioning without forcing everyone to install the VisualStudio plug-in. That makes onboarding easier.

@3F
Copy link
Owner

3F commented May 20, 2020

My intention was to include versioning without forcing everyone to install the VisualStudio plug-in.

You do not need forcing everyone to install the any plugin or some package.
Because all this will work without it. For any build. And I already gave you link to CI above to prove it.

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