Difficulty with Adding a Reference in Visual Studio (Windows Azure StorageClient) - visual-studio

I've been following alone with this tutorial. Everything is going great, until I get to this part:
Set a reference to the StorageClient
library. You can either add the
sample project to the solution and add
a project reference or you can add a
reference to the compiled dll. I am
going to add the StorageClient project
to the solution and add a project
reference.
I am not able to find the StorageClient project. I have SDK v1.2, and it has samples-cs.zip. StorageClient is not there.
The SDK does have ref/Microsoft.WindowsAzure.StorageClient.dll. I tried adding a reference to it in my ASP project, but it's not working. VS does not recognize the type TableStorageEntity, nor the namespace Microsoft.Samples.ServiceHosting.StorageClient.
What am I doing wrong? Can I just find the StorageClient somewhere and use that? If it was taken out of the SDK, does it mean that it's not supported any more? If so, why have the DLL?

The problem is that the tutorial you're looking at is from mid-2009, when the storage client library was an add-on that was distributed as a sample with the SDK.
With the latest SDK (which I see you're using), the Azure storage support is now officially part of the SDK. The reference you're looking for is Microsoft.WindowsAzure.StorageClient.
Take a look at the Azure platform training kit - they should have updated samples.
Also: when you create a new cloud project with v1.2, you'll see that you automatically get references to the Azure dll's and don't need to manually add them. This includes:
Microsoft.WindowsAzure.Diagnostics
Microsoft.WindowsAzure.ServiceRuntime
Microsoft.WindowsAzure.StorageClient

Related

Shared Project option totally gone from the Xamarin.Forms project menu in Visual Studio 2019?

I work with Xamarin.Forms in Visual Studio since a few years, and updated my IDE recently (VS v. 16.3.7). Now I realized something is missing: the Shared Project option.
When i go through the Wizard to create a new project the question if I want to use Shared Project or PCL(or NetStandard) is now missing (see screenshot below from VS 2017)
I do know that you can still create a Shared Project and add an iOS and an Android project manually, but this is just too cumbersome. My question really is: Is there a reason why Microsoft went on to push the PCL/NetStandard above the Shared Project strategy?
I am specially confused about this decision since already back in 2016 #miguel.de.icaza declared his favorite option (for most cases) was the Shared Project strategy:
https://tirania.org/blog/archive/2016/Jan-22.html
For me, the PCL is just too cumbersome for most uses. It is like using a canon to kill a fly. It imposes too many limitations (limited API surface), forces you to jump through hoops to achieve some very basic tasks.
I have installed VS 2017 15.9.14, on this version, Portable Class Libraries (PCLs) are deprecated. You could use .NET Standard instead. On VS 2019, the default is .NET Standard.
On Microsoft document, MS recommend .NET Standard 2.0 libraries over Portable Class Libraries.
For more, please refer to the MS docs. https://learn.microsoft.com/en-us/xamarin/cross-platform/app-fundamentals/code-sharing
My question really is: Is there a reason why Microsoft went on to push the PCL above the Shared Project strategy?
For MS announcement, PCL is deprecated, you could not find that when you create the project.
You could create the Shared project by File > New > Project > Shared Project template.
For more details, you could check the link below. https://learn.microsoft.com/en-us/xamarin/cross-platform/app-fundamentals/shared-projects?tabs=windows
Updated:
Is there a reason why Microsoft went on to push the >NetStandard< above the Shared Project strategy?".
For the old version of VS 2017, .Net Standard is an option of Shared Project strategy.For the latest version of VS, MS use .Net Standard as the default for Sharing Strategy.
Is there any doc where MS states why Shared Project is now deprecated/not available in the Xamarin.Forms project wizard?
PCL is deprecated. Shared Project is still in use, in my answer, I provide the second link about how to create the shared project.
Summarizing and adding to the answer by #WendyZang-MSFT:
I started a project using the Shared Project strategy around 4 years ago, and until now i have not found any issue/problem specific to it that would make me consider moving to .Net Standard.
Recently i went into the trouble of localization, and even that was possible using Shared Project without much hassle.
As mentioned above, after i saw that the latest version of Visual Studio 2019 was not offering the possibility of creating a Xamarin.Forms App as a Shared Project i got a bit worried thinking that i should migrate my solution. But the time hast passed by, and i just realized that MS encourages the use of .Net Standard, but Shared Project remains also a valid approach.

Is it possible to share code between Xamarin.Forms projects?

My team has built a Xamarin.Forms application using VS2017. We are using a Shared project because one of our core functionalities requires ESRI mapping, and ArcGIS Runtime for Xamarin does not support anything but Shared projects at this time.
The next app that my boss wants should be fairly quick to develop if I can use the existing code we've already written for the first app. However, I don't see any way that I can reference that code from another project. I have tried adding a new UWP project to the existing one, but then I have to add all the same NuGet packages, 90% of which are unnecessary to this new project. On top of that, it won't actually compile correctly since the App.xaml is different.
I've searched all over trying to find a solution to this, and haven't come up with anything. PCL is not an option, nor is .NET Standard. Is there any way to accomplish this?

Adding System.Data.SQLite through NuGet doesn't add a reference to the project

I'm trying to make a very simple Xamarin.Forms test application to explore some features of the System.Data.SQLite package (namely encryption). However, I can't seem to get Visual Studio 2012 to add a reference to the package to the project.
Here are the steps I am taking:
Created a new Xamarin.Forms Portable blank app.
Right-click on TestApp (core project) and select Manage NuGet Packages
Search for "sqlite"
Install the "System.Data.SQLite (x86/x64)" package. (This package is version 1.0.97.0 and it is described as "the official SQLite database engine for both x86 and x64 along with the ADO.NET provider.")
According to NuGet, the package was successfully installed.
However, I cannot see the reference added under my project's "References" folder, and I also cannot write "using System.Data.SQLite" without errors ("cannot resolve symbol 'Data'"). Does anyone have any idea why this is happening?
On a side note, I can follow the exact same process described above except instead of creating a Xamarin.Forms Portable blank app, I choose a regular C# console app. This allows me to install the NuGet package fine and it shows up in references as expected.
Posting an update to share what I've learned.
So as Jason sort of alluded to in his answer, the reason I was not able to reference the package in my Xamarin.Forms project is because Xamarin.Forms is, by definition, a PCL project. It's meant to work on all platforms. The package I was referring to in my question is not a PCL, which means that anything in the package that is platform dependent is inaccessable (which is basically the entire package). The SQLite.Net-PCL package is basically the same thing as System.Data.SQLite, but in PCL form, which means it is compatible for use in a Xamarin.Forms project.
Following this logic, it makes sense that I was able to access System.Data.SQLite from a console project, since a console project is not a PCL project and it targets a specific platform.
For PCL projects, use SQLite.Net-PCL.

How to add Phonegap plugins for windows phone in visual Studio 2010

I am trying to add a barcode scanner plugin to my phonegap/cordova project for windows phone. I searched a lot but couldnt find any docs on adding external plugins to visual studio. I am using 'Visual studio 2010 Express for Windows Phone'. I got the phonegap plugin from here. Even thought the plugin is depreciated, I had success in using it in eclipse for building the android version.
Maybe check this out or this
Application developers use the CLI's plugin add command (discussed in The Command-Line Interface) to apply a plugin to a project. The argument to that command is the URL for a git repository containing the plugin code.
PhoneGap-WP7 maintains the plugability of other platforms via a command pattern, to allow developers to add functionality with minimal fuss, simply define your C# class in the WP7GapClassLib.PhoneGap.Commands namespace and derive your class from BaseCommand.
For .cs file you just need to add it to your VS project
For .js file you need to add it to correct folder (to be a part of VS project), for example to 'www' and THEN add reference to this .js file in your html page (this step seems to be missed in your case).
Optional. For some libraries you will also need to add additional dlls, but you can't miss this step since there will be compilation issues.
Hope this help u

Why I am not getting WCF Web API Objects in Visual Studio 2010

I have installed WCF Web API Preview 5 using NuGet Visual Studio extension (WebApi.All). I am trying to implement some simple examples on the internet, but it seems like they have different Assemblies to the ones I installed. For example, I cannot get HttpHostConfiguration, DelegatingChannel, HttpMessageChannel, etc.
I have made sure my target framework is set to ".NET Framework 4". Am I missing something, or has anyone else experienced a similar issue. Btw, my project is an MVC3 project.
Thanks for your help.
It sounds like the sample code you are trying to use is from preview 4 or before. A number of breaking changes where made in preview 5.
To get the Http server configuration you can use the GetDefaultHttpConfiguration() extension method on the RouteCollection. The DelegatingChannel has been renamed to DelegatingHandler.
See the release notes here or this blog post from Howard Dierking for more info.
You need to add a reference to the dll that contains those classes. They are probably not referenced by default in a MVC3 project.

Resources