Code Monkey home page Code Monkey logo

automaticpackagerestoremigrationscript's Introduction

Owen's bag of nuget related scripts!

migateToAutomaticPackageRestore.ps1

In short, it reverses "Enable Nuget Package Restore", allowing the newer package restore method to work.

In Visual Studio 2013, automatic package restore part of the IDE (and the TFS build process). This method is more reliable than the older, msbuild integrated package restore. It does not require you to have nuget.exe checked in to each solution and does not require and additional msbuild targets. However, if you have the files related to the old package restore method in your project, Visual Studio will skip automatic package restore. (This behavior is likely to change soon, hopefully it does).

You can use this script to remove nuget.exe, nuget.targets, and all project and solution references to nuget.targets so you can take advantage of Automatic Package Restore. It more or less automates the process described here

It will recurse through the directory you run the script from and do it to any solutions that may be in there somewhere. Be careful and have fun! (not responsible for anything that breaks)

FixHintPaths.ps1

There are some intersting scenarios where you might end up with troubles related to incorrect hintpaths in the project files which reference nuget packages that were installed while the project was loaded as part of a different solution. You might see something like <HintPath>C:\Users\SomeOtherUserName\My Documents\... or <HintPath>..\..\SomeOtherSolution\packages\... . This could be caused by a bug in nuget, or more likely, a strange organization of your folder structure. This script is a quick fix for those situations. It replaces the incorrect paths with a reference to the $(SolutionDir)\packages, which is almost always where Automatic Package Restore puts restored packages. If you find yourself needing this script often, it may be a smell indicating that you may have problems with how your source code is organized.

Again, this script will recurse down and do this to all project files it finds.

clean.ps1

This will quickly recurse from the current directory to search for and delete bin, obj, and other junk. It's like doing a "Clean Solution" on a bunch of solutions. I use it to diagnose issues where something might build fine for a developer in visual studio, but is missing something on when it gets built on a continous integration server. I left it in this repository because I use it to diagnose nuget problems (or rule out nuget as the culprit).

Like the other two, it just recurses through the current directory.

automaticpackagerestoremigrationscript's People

Contributors

omidkrad avatar owen2 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.