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

Allow external Nuget if already in path? #38

Open
paschott opened this Issue Sep 25, 2018 · 11 comments

Comments

Projects
None yet
2 participants
@paschott
Contributor

paschott commented Sep 25, 2018

We have a deployment server that's locked down to prevent downloading a copy of nuget to the working path. Nuget is already in the path. Would it be possible to override the functionality that tries to download Nuget to allow for using one already in the system path?

@RichieBzzzt

This comment has been minimized.

Show comment
Hide comment
@RichieBzzzt

RichieBzzzt Sep 26, 2018

Owner

You mentioned system path but just to confirm: the path stored as a system environment variable, as opposed to a user environment variable?
image

Owner

RichieBzzzt commented Sep 26, 2018

You mentioned system path but just to confirm: the path stored as a system environment variable, as opposed to a user environment variable?
image

@paschott

This comment has been minimized.

Show comment
Hide comment
@paschott

paschott Sep 26, 2018

Contributor
Contributor

paschott commented Sep 26, 2018

@RichieBzzzt

This comment has been minimized.

Show comment
Hide comment
@RichieBzzzt

RichieBzzzt Sep 26, 2018

Owner

Ok this is 2 separate things:

  1. w/r/t nuget in environment path var - this is doable. Had a little play around earlier in PowerShell. I'd need to write a new function and test, so I reckon I can get this done, maybe tomorrow evening.
    2)check your sqlproj file. Read this post

https://bzzzt.io/post/2016-03-08-how-to-compile-sqlproj-files-using-cmdline-msbuild----errors-included-/

You may need to open up your sqlproj file and do some editing: altering where it finds the .targets file. This is form a recent project. Is your database project particularly old? Older projects don't work well with the Microsoft.Data.Tools.MSBuild because the path was different.

 <PropertyGroup>
    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">11.0</VisualStudioVersion>
    <!-- Default to the v11.0 targets path if the targets file for the current VS version is not found -->
    <SSDTExists Condition="Exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets')">True</SSDTExists>
    <VisualStudioVersion Condition="'$(SSDTExists)' == ''">11.0</VisualStudioVersion>
  </PropertyGroup>
  <Import Condition="'$(SQLDBExtensionsRefPath)' != ''" Project="$(SQLDBExtensionsRefPath)\Microsoft.Data.Tools.Schema.SqlTasks.targets" />
  <Import Condition="'$(SQLDBExtensionsRefPath)' == ''" Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" />

The targets file is by defauly packaged in the Microsoft.Data.Tools.MSBuild nuget package, hence why it is used when building a project -

https://github.com/RichieBzzzt/PoshSSDTBuildDeploy/blob/master/PoshSSDTBuildDeploy/Functions/InvokeMSBuildSSDT.ps1#L38

Owner

RichieBzzzt commented Sep 26, 2018

Ok this is 2 separate things:

  1. w/r/t nuget in environment path var - this is doable. Had a little play around earlier in PowerShell. I'd need to write a new function and test, so I reckon I can get this done, maybe tomorrow evening.
    2)check your sqlproj file. Read this post

https://bzzzt.io/post/2016-03-08-how-to-compile-sqlproj-files-using-cmdline-msbuild----errors-included-/

You may need to open up your sqlproj file and do some editing: altering where it finds the .targets file. This is form a recent project. Is your database project particularly old? Older projects don't work well with the Microsoft.Data.Tools.MSBuild because the path was different.

 <PropertyGroup>
    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">11.0</VisualStudioVersion>
    <!-- Default to the v11.0 targets path if the targets file for the current VS version is not found -->
    <SSDTExists Condition="Exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets')">True</SSDTExists>
    <VisualStudioVersion Condition="'$(SSDTExists)' == ''">11.0</VisualStudioVersion>
  </PropertyGroup>
  <Import Condition="'$(SQLDBExtensionsRefPath)' != ''" Project="$(SQLDBExtensionsRefPath)\Microsoft.Data.Tools.Schema.SqlTasks.targets" />
  <Import Condition="'$(SQLDBExtensionsRefPath)' == ''" Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" />

The targets file is by defauly packaged in the Microsoft.Data.Tools.MSBuild nuget package, hence why it is used when building a project -

https://github.com/RichieBzzzt/PoshSSDTBuildDeploy/blob/master/PoshSSDTBuildDeploy/Functions/InvokeMSBuildSSDT.ps1#L38

@paschott

This comment has been minimized.

Show comment
Hide comment
@paschott

paschott Sep 26, 2018

Contributor
Contributor

paschott commented Sep 26, 2018

@RichieBzzzt

This comment has been minimized.

Show comment
Hide comment
@RichieBzzzt

RichieBzzzt Sep 26, 2018

Owner

No worries. Once the new function is in you won't need to download nuget from the web.

BTW, how will you download msbuild.data.tools if you have no internet connection? Or is it just no connection to download nuget?

Owner

RichieBzzzt commented Sep 26, 2018

No worries. Once the new function is in you won't need to download nuget from the web.

BTW, how will you download msbuild.data.tools if you have no internet connection? Or is it just no connection to download nuget?

@paschott

This comment has been minimized.

Show comment
Hide comment
@paschott

paschott Sep 26, 2018

Contributor
Contributor

paschott commented Sep 26, 2018

@RichieBzzzt

This comment has been minimized.

Show comment
Hide comment
@RichieBzzzt

RichieBzzzt Sep 26, 2018

Owner

OK gotcha no worries.

Owner

RichieBzzzt commented Sep 26, 2018

OK gotcha no worries.

@RichieBzzzt

This comment has been minimized.

Show comment
Hide comment
@RichieBzzzt

RichieBzzzt Sep 27, 2018

Owner

Ok I’ve made a start and checked in a branch with a quick change to allow path to nuget to be added. But now my daughter’s sick and my tests are failing so I won’t get to finish tonight!

2nd phase is to add a switch to check user/system path, but am worried that might end up a bit flakey. Time will tell......

Hopefully over the weekend I can steal some time to complete.

Owner

RichieBzzzt commented Sep 27, 2018

Ok I’ve made a start and checked in a branch with a quick change to allow path to nuget to be added. But now my daughter’s sick and my tests are failing so I won’t get to finish tonight!

2nd phase is to add a switch to check user/system path, but am worried that might end up a bit flakey. Time will tell......

Hopefully over the weekend I can steal some time to complete.

@paschott

This comment has been minimized.

Show comment
Hide comment
@paschott

paschott Sep 27, 2018

Contributor
Contributor

paschott commented Sep 27, 2018

@RichieBzzzt

This comment has been minimized.

Show comment
Hide comment
@RichieBzzzt

RichieBzzzt Sep 30, 2018

Owner

OK ability to specify nuget location added and merged in and latest available on GitHub/NuGet. PowerShell Gallery is proving impossible to update, due to it whinging about something.

Now available on PSGallery.

Owner

RichieBzzzt commented Sep 30, 2018

OK ability to specify nuget location added and merged in and latest available on GitHub/NuGet. PowerShell Gallery is proving impossible to update, due to it whinging about something.

Now available on PSGallery.

@paschott

This comment has been minimized.

Show comment
Hide comment
@paschott

paschott Oct 2, 2018

Contributor
Contributor

paschott commented Oct 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment