Using Nuget in Visual Studio 2005 & 2008
2016-03-11 14:00
549 查看
NuGet is a Visual Studio extension that makes it easy to install and update third-party libraries and tools in Visual Studio. NuGet is not mandatory for using the PayPal SDKs but makes managing dependencies in your application a lot simpler.
Visual Studio 2005 and 2008 do not have out of the box support for NuGet. However you can follow the instructions given here to get NuGet working in your IDE.
NuGet.exe - Download the NuGet command line executable from https://dist.nuget.org/index.html
Make sure NuGet.exe is available in the PATH environment variable.
Check if .NET Framework 4.0 or higher is installed in the Computer from Control Panel -> Get programs
Or else
Run the following command from Windows Command Prompt >:
Please wait for the command to execute, it may take more than a minute to execute
Running the aforesaid command should list the .NET Framework versions installed as in this particular case
[Please note the command might take a while to execute]
Running the aforesaid command should list the .NET Framework versions installed similar to the following:
If V4.X is not installed, then download and install
.NET Framework 4 (Standalone Installer) – (free to download): http://www.microsoft.com/en-in/download/details.aspx?id=17718 OR
.NET Framework 4 (Web Installer) – (free to download): http://www.microsoft.com/en-in/download/details.aspx?id=17851
Select External Tools…
Select 'Add'.
Enter the following:
Click Apply
Click OK
On Clicking Apply and OK, NuGet Install will be added (as External Command) to Menu --> Tools
Menu --> Tools, clicking NuGet Install will pop up for NuGet Install Arguments and Command Line
Also, NuGet Toolbar can be added, right-click on Visual Studio Menu and select Customize…
Customize by clicking New…
Enter Toolbar name: NuGet and click OK
Check NuGet Checkbox in the Toolbars tab for NuGet Toolbar to pop up
Click Commands tab and select Tools and External Command 6 (Having added NuGet Install as External Command 6*)
*Note: The External Command number may differ depending on the particular Visual Studio installation
Drag and drop External Command 6 to NuGet Toolbar
Right-click NuGet Toolbar
Enter Name: Install Package
Right-click Change Button Image and select an image
Close Customize
Drag and drop NuGet Toolbar to the Menu
Clicking on the NuGet Toolbar Install Package will pop up for NuGet Install Arguments and Command Line
Example NuGet Install:
Enter Arguments:
install PayPalCoreSDK -excludeversion -outputDirectory .\Packages
On clicking OK, the output window should display:
Menu View --> Output (Ctrl+Alt+O)
The 'PayPalCoreSDK' Package including the dependencies will be downloaded to the 'Packages' folder root directory of the Solution (.sln) file.
Select 'Packages' folder by clicking it and then click 'Show All Files' in the Solution Explorer
Note: If 'Packages' folder was not included in the Solution Explorer, click 'Show All Files' before clicking 'Refresh'
Add the references to the dependent files downloaded to 'Packages' folder:
Note: By default, the root directory of Nuget Installation is the same as that of the Solution (.sln) file.
In case of a direct installation using Visual Studio without loading any solution:
The typical location for Visual Studio 2005:
'C:\Program Files (x86)\Microsoft Visual Studio 8\Common7\IDE\'
The typical Installation location for Visual Studio 2008:
'C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\'
from https://segmentfault.com/a/1190000004584894
Visual Studio 2005 and 2008 do not have out of the box support for NuGet. However you can follow the instructions given here to get NuGet working in your IDE.
Prerequisites
.NET Framework 4.0 - You must have .NET framework 4.0 installed on your machine.NuGet.exe - Download the NuGet command line executable from https://dist.nuget.org/index.html
Make sure NuGet.exe is available in the PATH environment variable.
Check if .NET Framework 4.0 or higher is installed in the Computer from Control Panel -> Get programs
Or else
Run the following command from Windows Command Prompt >:
wmic product where "Name like 'Microsoft .Net%'" get Name, Version
Please wait for the command to execute, it may take more than a minute to execute
Running the aforesaid command should list the .NET Framework versions installed as in this particular case
[Please note the command might take a while to execute]
Running the aforesaid command should list the .NET Framework versions installed similar to the following:
Name Version Microsoft .NET Compact Framework 1.0 SP3 Developer 1.0.4292 Microsoft .NET Framework 4.5 4.5.50709 Microsoft .NET Framework 4.5 Multi-Targeting Pack 4.5.50709 Microsoft .NET Framework 2.0 SDK (x64) - ENU 2.0.50727 Microsoft .NET Framework 4 Multi-Targeting Pack 4.0.30319 Microsoft .NET Framework 4.5 SDK 4.5.50709 Microsoft .NET Compact Framework 2.0 SP2 2.0.7045 Microsoft .NET Compact Framework 3.5 3.5.7283 Microsoft .NET Framework 1.1 1.1.4322 Microsoft .NET Compact Framework 1.0 SP3 1.0.4294
If V4.X is not installed, then download and install
.NET Framework 4 (Standalone Installer) – (free to download): http://www.microsoft.com/en-in/download/details.aspx?id=17718 OR
.NET Framework 4 (Web Installer) – (free to download): http://www.microsoft.com/en-in/download/details.aspx?id=17851
Installation
Go to Visual Studio Menu --> ToolsSelect External Tools…
Select 'Add'.
Enter the following:
Title: NuGet Install Command (Having in Environment Variables Path): NuGet.exe Arguments: install your.package.name -excludeversion -outputDirectory .\Packages Initial directory: $(SolutionDir) Use Output window: Check Prompt for arguments: Check
Click Apply
Click OK
On Clicking Apply and OK, NuGet Install will be added (as External Command) to Menu --> Tools
Menu --> Tools, clicking NuGet Install will pop up for NuGet Install Arguments and Command Line
Also, NuGet Toolbar can be added, right-click on Visual Studio Menu and select Customize…
Customize by clicking New…
Enter Toolbar name: NuGet and click OK
Check NuGet Checkbox in the Toolbars tab for NuGet Toolbar to pop up
Click Commands tab and select Tools and External Command 6 (Having added NuGet Install as External Command 6*)
*Note: The External Command number may differ depending on the particular Visual Studio installation
Drag and drop External Command 6 to NuGet Toolbar
Right-click NuGet Toolbar
Enter Name: Install Package
Right-click Change Button Image and select an image
Close Customize
Drag and drop NuGet Toolbar to the Menu
Using NuGet
Click the NuGet Toolbar Install PackageClicking on the NuGet Toolbar Install Package will pop up for NuGet Install Arguments and Command Line
Example NuGet Install:
Enter Arguments:
install PayPalCoreSDK -excludeversion -outputDirectory .\Packages
On clicking OK, the output window should display:
Attempting to resolve dependency 'PayPalCoreSDK'. Attempting to resolve dependency 'log4net (ò 1.2.10)'. Successfully installed 'log4net 1.2.10'. Successfully installed 'PayPalCoreSDK 1.0.0'.
Menu View --> Output (Ctrl+Alt+O)
The 'PayPalCoreSDK' Package including the dependencies will be downloaded to the 'Packages' folder root directory of the Solution (.sln) file.
Select 'Packages' folder by clicking it and then click 'Show All Files' in the Solution Explorer
Note: If 'Packages' folder was not included in the Solution Explorer, click 'Show All Files' before clicking 'Refresh'
Add the references to the dependent files downloaded to 'Packages' folder:
Note: By default, the root directory of Nuget Installation is the same as that of the Solution (.sln) file.
In case of a direct installation using Visual Studio without loading any solution:
The typical location for Visual Studio 2005:
'C:\Program Files (x86)\Microsoft Visual Studio 8\Common7\IDE\'
The typical Installation location for Visual Studio 2008:
'C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\'
from https://segmentfault.com/a/1190000004584894
相关文章推荐
- ActiveMQ消息的可靠性机制(转)
- 使用move_base导航 ---13
- 复杂链表的复制
- Android Root的一些理解
- android模拟器和本机tomcat之间模拟从后台取数据
- SpringMVC日期类型转换问题三大处理方法归纳
- ubuntu dsl设置
- 详解Spring MVC 4之ViewResolver视图解析器
- /dev/mapper/vg_rac1_lv_root: unexpected inconsistency:Run fsck manually [FAILED]
- test
- Android--SpannableString使用
- laravel 在nginx配置
- ruby学习-运行和语法
- 使用Kiwi CatTools 实现交换机自动备份
- 使用Kiwi CatTools 实现交换机自动备份
- The type java.lang.Object cannot be resolved It is indirectly referenced ...
- 软件测试的自我修养之新手入门01
- Oracle客户端库时引发BadImageFomatException
- How to use udev for Oracle ASM in Oracle Linux 6 怎样使用udev在linux 6系统上使用asm
- 计算机视觉、机器学习相关领域论文和源代码大集合--持续更新