Make NuGet WebApi.HelpPage package go away - visual-studio-2012

I did this in the NuGet console to try out the Web Api help package:
Install-Package Microsoft.AspNet.WebApi.HelpPage
Now everytime I create a MVC Web Api project I get Areas\HelpPage.
I tried:
PM> Uninstall-Package Microsoft.AspNet.WebApi.HelpPage
Skipping 'Areas\HelpPage\Views\_ViewStart.cshtml' because it was modified.
Skipping 'Areas\HelpPage\Views\_ViewStart.cshtml' because it was modified.
Skipping 'Areas\HelpPage\Views\_ViewStart.cshtml' because it was modified.
Skipping 'Areas\HelpPage\Views\_ViewStart.cshtml' because it was modified.
Successfully removed 'Microsoft.AspNet.WebApi.HelpPage 4.0.0' from MvcApplication16.
Successfully uninstalled 'Microsoft.AspNet.WebApi.HelpPage 4.0.0'.
PM>
I decided not to use the HelpPage pacakge.
How can I make that HelpPage and its Area go away and not be in every project I create?

It's actually a feature in VS2012.2 update (or webtools 2012.2 release). It's not due to that you installed that package once or not. If you don't like it, you have 2 options:
1. remove the package everytime you after creating a new webapi project
2. Create a customized webapi template (search on asp.net on how to do that) that only installs the packages that you'd like

Related

Azure feed: nuget package is not found

I have 2 solutions (2 .NET Core projects), the first one represents just the models and some simple services for public use, like email service, etc.
It's uploaded to Azure as nuget package and there is a feed which is used by the other projects.
So the link to it is something like https://pkgs.dev.azure.com/something/_packaging/MyFeed1/nuget/v3/index.json
The second one is the major project which consumes the project1 via this nuget package.
So for this purpose, I set up in VS the package source to the link above and then installed the nuget package :
Install-Package MyService -version 1.0.0-CI-XXXXXX-XXXXX
And initially it worked fine. But then I had to update Project1 (nuget package) and although after this, I consequently updated all the references for Project2 (Install-Package MyService -version 1.0.0-CI-YYYYYY-YYYYY - the package version was automatically changed) Project2 is not really working:
I can perfectly compile it locally and locally it works, but when I deploy it to Azure it does not pass the Build and I get the error message saying that it can't find MyService (from nuget package)
I double checked all the references and pipeline - it's fine. The references are updated and the pipeline just uses the feed name, not a particular version of nuget.
Please advise.
This could be the result of caching, which can be fixed by clearing the Nuget caches.
Go to Tools -> Options -> Nuget -> General and click the "Clear All Nuget Cache(s)" button to clear the Nuget caches.

Azure Mobile Services - System.PlatformNotSupportedException

i'm working on a xamarin forms app with azure however when I load my initial page it crashes on the line:
public static MobileServiceClient MobileService =
new MobileServiceClient(
"https://myapp.azurewebsites.net");
with exception:
System.PlatformNotSupportedException "The empty PCL implementation for
Microsoft Azure Mobile Services was loaded. Ensure you have added
nuget package to each of your platform projects."
How do I fix this?
It might mean that the NuGet packages did not install correctly in one of your platforms. I would suggest doing a force-reinstall of all NuGet packages using the Package Manager Console (Tools/NuGet Package Manager/Package Manager Console).
Update-Package -reinstall
Do this for all projects in your solution. Once done, close and reopen Visual Studio, open your solution and click Build in the top menu and do Clean Solution.
Now look into each of your platform projects in turn to see if you have a Microsoft.Azure.Mobile.Client reference there:
If it is not there, install the Microsoft.Azure.Mobile.Client package again in that given project.
Then you should proceed as described in any tutorial on Azure Mobile Services. Even if you use the Shared Project strategy in you Xamarin.Forms app, it should work as expected once the platform project has Microsoft.Azure.Mobile.Client installed.
If it does not help, as the last resort I would suggest trying to update all NuGet packages to their last version (right-click solution, Manage NuGet Packages for Solution...)
Make sure that you add the initialization code in the respective AppDelegate/MainActivity
CurrentPlatform.Init();
And that in the iOS, Android and PCL projects there is the reference to the Microsoft.Azure.Mobile.Client package.
Example
It instantiates the MobileServiceClient in the TodoItemManager class.

Force NuGet to delete package content files before a new update

I am forced to use an asp.net project wrapped up in a NuGet package. I am very aware that this is not what's NuGet for and it isn't the best solution, but as I said I am forced to be using it.
Since whenever the project files are deleted or renamed from the NuGet project, and I update the main project that is referencing the NuGet project, NuGet wouldn't delete previously installed files that are now changed, my question is:
Is there a way to force NuGet to delete the files from the previous version, before installing a new one?

ServiceStack set up packages

I'm trying on ServiceStack but getting stuck in the installation. Can I ask what's the correct packages to install? For a very simple tutorial on Pluralsight.
It doesn't seem to allow me to enable using ServiceStack.Interfaces or using ServiceStack.ServiceInterface in my application. Even though those are right there in the References.
I have installed ServiceStrack, ServiceStack.Host.MVC, ServiceStack.Host.AspNet and more.
Assuming you want to build just minimal web-service, you do not need to install Host.MVC or Host.AspNet, just install the minimal package using NuGet Package Manager like this:
Install-Package ServiceStack
After that you can use this guide to configure your newly ServiceStack Web-Service.
The easiest way to install ServiceStack is with ServiceStackVS VS.NET Extension which will download the right packages for each project type. See this guide on Creating your first project with ServiceStackVS.
If you want to add packages manually to a normal ASP.NET Web Application please see Creating a Service from Scratch.

Visual Studio 2012 Nuget Update Packages keep redownloading

Using: Visual Studio 2012 ultimate with Update 4
Problem: Every time I use update-package, it redownloads the same version.
Scenario:
1. I fire up VS2012, make new project Asp.NET MVC4 Web Application -> Internet Application.
2. I type 'update-package' in package manager console. Downloads every package update. I save the solution. Exit.
3. I create a new project Asp.NET MVC4 Web Application -> Internet Application.
4. Since packages are not updated, I type 'update-package' again.
But when I do, it will DOWNLOAD again the SAME version that I already downloaded during my first project.
My problem is, I am not always connected to the internet so do I have to find internet connection everytime I 'update-package' to update the template.
Is there a way I can save the package updates locally so when I do 'update-package' I dont have to be connected to the internet to update all the packages?
You can create folder for nuget packages, for example D:\NugetLocalSource\, and add specify it as package source in nuget settings. Tools -> Nuget Package Manager -> Packages Manager Settings -> Package Sources -> Add.
When you updated packages first time they were downloaded to solution_folder\packages\. You can copy *.nupkg files from packages folder to you local source and then will you be able use them offline for other solutions.
Or you can pre-download packages from nuget.org another way.
One more place where you can find downloaded packages locally - it's nuget cache. It's placed in C:\Users\<user>\AppData\Local\NuGet\Cache. Here is nice article about how to use it

Resources