Showing posts with label NuGet. Show all posts
Showing posts with label NuGet. Show all posts

Tuesday, October 25, 2016

Configuring NuGet for Telerik's Private NuGet feed

If you are a licensed user of Telerik's products, you can configure NuGet on your system to authenticate to Telerik's private NuGet feed using the instructions provided here: http://docs.telerik.com/kendo-ui/aspnet-mvc/nuget-install

Unfortunately, since you cannot configure authentication credentials via the Visual Studio User Interface, you will have to do this through the command line.

Alternatively, you can also set up your own Private NuGet feed following the instructions provided here: http://www.telerik.com/blogs/power-your-projects-with-telerik---now-with-the-convenience-of-nuget

If you follow this option, you simply download the NuGet packages from your downloads available in your Telerik account and then upload them to your private NuGet feed in order to make them available to all of your developers.

That is all there is to making Telerik packages readily available via NuGet!

Friday, August 19, 2016

Managing NuGet packages for your solution

When you have multiple projects in a solution, you may find it difficult to ensure that all of the NuGet packages in the solution are all using the same NuGet package versions.

Fortunately, you can manage all of these various NuGet package versions at the solution level!


  1. Right click on your solution and select "Manage NuGet Packages for Solution"
  2. You will then be presented with a dialog which allows you to see all of the NuGet packages that are being used in your solution
  3. In addition, if there are differing version numbers of NuGet packages in different projects, you also have the option to "Consolidate" to ensure that all of your projects are using the same NuGet package version numbers!



Tuesday, June 28, 2016

Sharing Telerik Kendo UI assemblies with your development team

One of the problem with using many 3rd party products such as Kendo UI in the past was ensuring that EACH and EVERY developer had the same version of the product installed on their machines!!

If you can just imagine dealing with the administration nightmares with such a product that has multiple releases and hotfixes several times a year!!

Well, thankfully, the Telerik development team has provided a nice resolution to this problem of the past through our all-too-familiar process of NuGet!!

Yes, you heard correctly!  You can now distribute your Telerik references such as Kendo UI through pre-built NuGet packages!  Woo hoo!

All you have to do is set up your own NuGet Server on your own network by following an article such as this one: https://docs.nuget.org/create/hosting-your-own-nuget-feeds

Then, once that is complete, you can go into your Telerik account and download the appropriate NuGet packages that are available for your various products and drop them onto your NuGet server packages directory.




Then once that is complete, you will get a dialog similar to the following when you browse your NuGet server for packages:



You can get more details about setting up Telerik references on your NuGet server here: http://www.telerik.com/blogs/power-your-projects-with-telerik---now-with-the-convenience-of-nuget


Thursday, June 16, 2016

Resolving NuGet Assembly Reference errors in Jetbrains TeamCity

If you have ever encountered an error similar to the one below in Jetbrains TeamCity, then you have a problem with NuGet Assembly References:


Thankfully, this is easily resolved using the NuGet Restore feature available as a Build Step within TeamCity.  You simply add a new Build Step using the NuGet Installer Build Runner:



Next, when you order the Build Steps, you just need to make sure that you run the NuGet Restore Build Step prior to building your actual Visual Studio solution as follows:


It is easy as that to resolve your NuGet Assembly Reference errors in TeamCity!  

Thursday, January 21, 2016

What are the NuGet v. 2 and v. 3 Urls?

I have found myself recently having to bounce back and forth between Visual Studio 2013 and Visual Studio 2015 and if you have not already discovered this for yourself, they use different versions of NuGet as well as different NuGet Urls!

Therefore, when I am setting up Autobuilds in a CI Build Server such as Jetbrains TeamCity, I usually need to configure the appropriate NuGet Server Urls in order to ensure all of the correct NuGet packages are downloaded at build time.

So I needed to know the different NuGet Urls used by the different versions of NuGet!

Well, for NuGet v. 2.x, the Url is the following:
https://www.nuget.org/api/v2/

If you are using NuGet v. 3.x, the Url is slightly different as follows:
https://api.nuget.org/v3/index.json

You can then configure these respective Urls in Visual Studio and your CI Build Server to ensure that all of the NuGet packages are downloaded and restored correctly!

Wednesday, November 25, 2015

Setting up and deploying your own NuGet server Step-by-Step

You may have read this article about how to set up your own NuGet Server: https://docs.nuget.org/create/hosting-your-own-nuget-feeds

However, this article leaves out several critical elements required to set up, configure and deploy your own NuGet Server.

Before you get started, though, you will need to make sure your systems are set up with the necessary prerequisites:

  1. Make sure you install .NET Framework v. 4.5 (or later) on your target web server
  2. Make sure you install Web Deploy for IIS on your target web server (http://www.iis.net/downloads/microsoft/web-deploy)
  3. I am using Visual Studio 2015 for this example, so make sure you have either Visual Studio 2013 or Visual Studio 2015 in order to build and publish the NuGet Server web deployment package.
  4. From the Tools menu in Visual Studio, you can select "Create GUID" to generate the GUID that you will need for your NuGet Server API Key.  You will need to generate the GUID in "Registry Format" and then remove the curly braces ({}) from the GUID before entering it into your NuGet Server's Web.config file.
  5. From Visual Studio, you will need to Publish your Web Application as a Web Deploy package.
  6. On the target web server, you will need to select the option for "Import Application" to begin the process of importing the Web Deploy package. 
  7. If you have done everything correctly, when you browse to http://myserver/NuGet, you will get the NuGet page shown below!
 

Below are the steps needed to create and deploy your very own NuGet Server:




























Tuesday, November 17, 2015

Where can I find the System.Web.Http assembly?

Visual Studio 2015 now informs you of "Potential fixes" when you have forgotten to reference a particular assembly in your project, however, if the assembly is part of a NuGet package, it offers no insight into which NuGet package reference you have to add to your project!  You are still left on your own to figure out which NuGet package is required!

Well, in the case of the System.Web.Http assembly, this belongs to the Microsoft.AspNet.WebApi.Core NuGet package.



Once you add this reference to your project via NuGet Package Manager, your assembly reference error message should disappear!

Wednesday, October 7, 2015

Excluding NuGet Packages from Team Foundation Version Control

In the past, if you want to exclude NuGet packages from Team Foundation Server Version Control, you would need to make use of the NuGet.config file.

However, you now also have the option of using a .tfignore file as outlined in this NuGet article:  https://docs.nuget.org/consume/package-restore

This MSDN article further outlines how to structure and use a .tfignore file when adding files to Team Foundation Version Control: https://msdn.microsoft.com/en-us/library/ms245454.aspx

Tuesday, September 22, 2015

Adding NuGet Package Dependencies

If you are publishing your own NuGet Packages, you will first need to download a copy of NuGet Package Explorer: https://npe.codeplex.com/

Once you have that downloaded and installed, you can then begin adding Dependencies to your NuGet Package!

  1. Create a new Package in Package Explorer
  2. Begin editing the Package Metadata
  3. Click on the button for "Edit dependencies"
  4. Click on the + sign to create a new group
  5. Click on the icon in the bottom left hand corner for "Select dependency from NuGet feed"
  6. Make sure you type in the Url of your NuGet server or the Official NuGet server Url: https://nuget.org/api/v2/
  7. Select a package that you want to use as your dependency and click the "Open" hyperlink
  8. Click on the + icon to "Add new dependency"
  9. Once all of your dependencies have been added, you can click on the OK button
  10. You will now be able to view your package dependencies as part of your Package Metadata!






NuGet Package Sources for Visual Studio 2013 and Visual Studio 2015

If you haven't already noticed, there is a major change in NuGet between Visual Studio 2013 and Visual Studio 2015 which is undocumented on the NuGet site!

If you read this article: https://docs.nuget.org/consume/nuget-config-file#package-sources

You will see that the NuGet official package source is listed as: https://nuget.org/api/v2/

This is the same Url that is listed in Visual Studio 2013 as the NuGet official package source.

However, Visual Studio 2015 is using a newer version of NuGet and therefore has the following Url: https://api.nuget.org/v3/index.json


Friday, September 18, 2015

Resolving NuGet Package Reference problems

If you have numerous NuGet Package References in your project or solution, at one point or another, you will inevitably run into NuGet Package Reference problems.

One of the most common problems with NuGet Packages is ensuring that your NuGet Package References are restored at build time.

This can be corrected by making sure you have this setting in Visual Studio Tools-->Options-->NuGet Package Manager:



The second problem you might run into is that NuGet Package References may differ across your entire solution!  For example, if you have numerous projects in your solution, there is a good chance that they may be using different NuGet Package Reference Assembly Versions!  So how do you manage these discrepancies?

You right click on the solution and select "Manage NuGet Packages for Solution":



This will show you all of the projects in your solution that have NuGet Package References along with their associated installed assembly versions.

 If you are still having problems with differing assembly versions, then you will need to check the packages.config file for each of the different projects:

In the packages.config file you will find all of the various NuGet Package References along with their respective versions.  You will have to compare all of these versions across all of your Visual Studio projects to ensure that they have matching versions.

Lastly, if you are still encountering issues with building packages with NuGet references, then you should close your Visual Studio solution and delete the packages  directory from the root of the solution in Windows Explorer.





Now, you can go ahead and try re-building your Visual Studio solution to restore all missing NuGet Packages to see if your NuGet Package Reference issues are now resolved!

If you are having problems with NuGet Package Versions and you need to re-install a NuGet Package Reference, in Visual Studio 2013 (especially if that NuGet Package has other dependencies), you will have to MANUALLY REMOVE the references from Visual Studio and the referring lines in packages.config.

Then, in NuGet Package Manager in Visual Studio 2013, you can re-install the NuGet packages.

If you are using Visual Studio 2015, however, you have a new option to remove or uninstall the NuGet Packages called "Force uninstall, even if there are dependencies on it":


This removes many of the obstacles present while working with NuGet Package References in Visual Studio 2013 and allows you to effortlessly uninstall and reinstall any NuGet Package References that you need!





Wednesday, September 9, 2015

Upgrading ASP.NET MVC via NuGet does not update Web.config files

I was recently upgrading a sample project from ASP.NET MVC 4 to ASP.NET MVC 5 via NuGet and when I examined my Web.config files, I noticed that none of the Web.config entries had been updated to match the newer version of ASP.NET MVC!
 
This was my original Web.config file at the root of the project:
 
<?xml version="1.0" encoding="utf-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <appSettings>
    <add key="webpages:Version" value="2.0.0.0" />
    <add key="webpages:Enabled" value="false" />
    <add key="PreserveLoginUrl" value="true" />
    <add key="ClientValidationEnabled" value="true" />
    <add key="UnobtrusiveJavaScriptEnabled" value="true" />
  </appSettings>
  <system.web>
    <httpRuntime targetFramework="4.5" />
    <compilation debug="true" targetFramework="4.5">
      <assemblies>
        <add assembly="TXTextControl.Web, Version=22.0.200.500, Culture=neutral, PublicKeyToken=6B83FE9A75CFB638" />
        <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
      </assemblies>
    </compilation>
    <pages>
      <namespaces>
        <add namespace="System.Web.Helpers" />
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing" />
        <add namespace="System.Web.WebPages" />
      </namespaces>
    </pages>
  </system.web>
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <handlers>
      
      
      
      
      
      
      <add name="TXWebSocketHandler" verb="*" path="TXWebSocketHandler.ashx" type="TXTextControl.Web.WebSocketHandler, TXTextControl.Web, Version=22.0.200.500, Culture=neutral, PublicKeyToken=6B83FE9A75CFB638" />
      <add name="TXPrintHandler" verb="*" path="TXPrintHandler.ashx" type="TXTextControl.Web.TXPrintHandler, TXTextControl.Web, Version=22.0.200.500, Culture=neutral, PublicKeyToken=6B83FE9A75CFB638" />
    <remove name="ExtensionlessUrlHandler-Integrated-4.0" /><remove name="OPTIONSVerbHandler" /><remove name="TRACEVerbHandler" /><add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" /></handlers>
  </system.webServer>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

This was my original Web.config file at the root of the Views folder:

 


<?xml version="1.0"?>
 
<configuration>
  <configSections>
    <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
      <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
    </sectionGroup>
  </configSections>
 
  <system.web.webPages.razor>
    <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <pages pageBaseType="System.Web.Mvc.WebViewPage">
      <namespaces>
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing" />
      </namespaces>
    </pages>
  </system.web.webPages.razor>
 
  <appSettings>
    <add key="webpages:Enabled" value="false" />
  </appSettings>
 
  <system.web>
    <httpHandlers>
      <add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/>
    </httpHandlers>
 
    <!--
        Enabling request validation in view pages would cause validation to occur
        after the input has already been processed by the controller. By default
        MVC performs request validation before a controller processes the input.
        To change this behavior apply the ValidateInputAttribute to a
        controller or action.
    -->
    <pages
        validateRequest="false"
        pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
        pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
        userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <controls>
        <add assembly="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />
      </controls>
    </pages>
  </system.web>
 
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
 
    <handlers>
      <remove name="BlockViewHandler"/>
      <add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
    </handlers>
  </system.webServer>
</configuration>

 

After I manually upgraded the Web.config files, this was the resultant root Web.config file:

 


<?xml version="1.0" encoding="utf-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <appSettings>
    <add key="webpages:Version" value="3.0.0.0" />
    <add key="webpages:Enabled" value="false" />
    <add key="PreserveLoginUrl" value="true" />
    <add key="ClientValidationEnabled" value="true" />
    <add key="UnobtrusiveJavaScriptEnabled" value="true" />
  </appSettings>
  <system.web>
    <httpRuntime targetFramework="4.5" />
    <compilation debug="true" targetFramework="4.5">
      <assemblies>
        <add assembly="TXTextControl.Web, Version=22.0.200.500, Culture=neutral, PublicKeyToken=6B83FE9A75CFB638" />
        <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
      </assemblies>
    </compilation>
    <pages>
      <namespaces>
        <add namespace="System.Web.Helpers" />
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing" />
        <add namespace="System.Web.WebPages" />
      </namespaces>
    </pages>
  </system.web>
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <handlers>
      <add name="TXWebSocketHandler" verb="*" path="TXWebSocketHandler.ashx" type="TXTextControl.Web.WebSocketHandler, TXTextControl.Web, Version=22.0.200.500, Culture=neutral, PublicKeyToken=6B83FE9A75CFB638" />
      <add name="TXPrintHandler" verb="*" path="TXPrintHandler.ashx" type="TXTextControl.Web.TXPrintHandler, TXTextControl.Web, Version=22.0.200.500, Culture=neutral, PublicKeyToken=6B83FE9A75CFB638" />
      <remove name="ExtensionlessUrlHandler-Integrated-4.0" /><remove name="OPTIONSVerbHandler" />
      <remove name="TRACEVerbHandler" />
      <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
    </handlers>
  </system.webServer>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

This was the Web.config file in the root of the Views folder:



<?xml version="1.0"?>
 
<configuration>
  <configSections>
    <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
      <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
    </sectionGroup>
  </configSections>
 
  <system.web.webPages.razor>
    <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <pages pageBaseType="System.Web.Mvc.WebViewPage">
      <namespaces>
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing" />
      </namespaces>
    </pages>
  </system.web.webPages.razor>
 
  <appSettings>
    <add key="webpages:Enabled" value="false" />
  </appSettings>
 
  <system.web>
    <httpHandlers>
      <add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/>
    </httpHandlers>
 
    <!--
        Enabling request validation in view pages would cause validation to occur
        after the input has already been processed by the controller. By default
        MVC performs request validation before a controller processes the input.
        To change this behavior apply the ValidateInputAttribute to a
        controller or action.
    -->
    <pages
        validateRequest="false"
        pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
        pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
        userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <controls>
        <add assembly="System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />
      </controls>
    </pages>
  </system.web>
 
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
 
    <handlers>
      <remove name="BlockViewHandler"/>
      <add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
    </handlers>
  </system.webServer>
</configuration>

 


 




 

Thursday, September 3, 2015

NuGet Package Management coming to Visual Studio Online!

If you currently have a Visual Studio Online account, you will be excited to know that NuGet Package Management will soon be coming to Visual Studio Online!

In the past, you would have had to host your own local NuGet Server or pay for an external NuGet service such as ProGet or MyGet, but now Visual Studio Online will be offering that same service as part of your Visual Studio Online service!

How cool is that??

http://blogs.msdn.com/b/visualstudioalm/archive/2015/08/27/announcing-package-management-for-vso-tfs.aspx

No refresh button for NuGet Package Manager

I was just working with my own local NuGet server recently and published a few new packages to my NuGet server.

When I then looked at the NuGet Package Manager window in the Visual Studio IDE, I noticed that there was absolutely NO OPTION to refresh the list of packages in the NuGet Package Manager window!!!



NuGet Package Manager window should definitely offer a Refresh icon to be able to re-load the packages from a NuGet server (particularly a local NuGet server). 

The only option to reload NuGet packages from a server right now is to simply close the NuGet Package Manager window and re-open it

If you think that Microsoft should add a Refresh button to the NuGet Package Manager window, you should definitely vote for this UserVoice item here: http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/9609888-provide-a-refresh-button-for-nuget-package-manager

Wednesday, September 2, 2015

Unable to publish NuGet packages to local NuGet server

I recently set up my own NuGet server based on this article: https://docs.nuget.org/create/hosting-your-own-nuget-feeds

However, once I attempted to publish my NuGet packages, I received one error after the other:






After changing the Url slightly, I got this new error message:





When I ran the NuGet push command, I got a different error message:





In the end, I could not get the NuGet publish feature to work no matter what I tried, but fortunately I came across this article:  http://stackoverflow.com/questions/20228184/pushing-to-private-nuget-feed-prompts-for-credentials

As it turns out, I needed to do 2 things:

  1. Make sure that my Url was in the following format: https://localhost/nuget (removing the extra /nuget from the end of the Url)
  2. I also needed to make sure I added security privileges to the NuGet folder!

To add security privileges, I did the following:

  1. Opened up IIS Manager and right-clicked on the NuGet application
  2. Opened up the Edit Permissions dialog
  3. Clicked on the Security tab
  4. Granted Modify/Full Control to both IUSR and IIS_IUSRS
  5. Clicked OK



That did the trick for me and I was able to successfully push my NuGet packages to my server!