Xamarin Android Class Library project template - xamarin.android

I recently updated Visual Studio 2019 to 16.9.1 and when I'm trying to add a new Xamarin Android Class Library, I can't find it under the templates. All I get is this:
There used to be a project template for "Android Class Library" and it no longer seems to be in the list. Am I missing something? Is this expected? I've tried using "Class library" (the one highlighted in the attached image) but it's missing a reference to "Mono.Android" and I'm unable to add it. Has the "Android Class Library" intentionally been removed or have I ruined my Visual Studio configuration somehow?
I believe I'm using the correct "workload" in Visual Studio Installer:

Related

Error : SpecFlow designer codebehind generation is not compatible with MSBuild codebehind generation

I am using visual studio 2019 in mac to setup my test automation framework in c# & Specflow . When i build my test automation framework in VS i am getting below error :
SpecFlow designer codebehind generation is not compatible with MSBuild codebehind generation. The custom tool must be removed from the file
On searching through forums, people recommending to remove the custom tool selected as "SpecFlowSingleFileGenerator". But when i check the same in VS 2019 for Mac it is not enabled for me to remove.
attaching the screenshotn. Can anyone help me with this issue ?
I'm not familiar with Visual Studio for Mac, but presumably the settings are the same or similar to Windows.
Check the SpecFlow options in Visual Studio. Make sure Enable SpecFlowSingleFileGenerator CustomTool is set to False. If Visual Studio for Mac is anything like windows, go to Tools > Options > SpecFlow, then look under the Legacy section.
A screenshot from Windows is below, showing the setting in question:

How to make a solution template for visual studio for Mac

I want to make a solution template for visual studio for Mac. IN window work for me but I would like to know how to do it for visual studio for mac
Currently you would need to create an extension for Visual Studio for Mac to add a new project template.
Then there are two options for how to create the project template. You can use the old templating engine which is documented on the MonoDevelop website.
Or you can use the new .NET Core templating engine to create a NuGet package. Then add some metadata to your extension's addin.xml file to get Visual Studio for Mac to use that project template.
<Extension path="/MonoDevelop/Ide/Templates">
<Template
id="Microsoft.Common.Console.CSharp"
_overrideName="Console Application"
_overrideDescription="Creates a new .NET Core console project."
path="Templates/Microsoft.DotNet.Common.ProjectTemplates.1.x.1.0.0-beta2-20170430-208.nupkg"
icon="md-netcore-console-project"
imageId="md-netcore-console-project"
category="netcore/app/general" />
</Extension>
I am also working on simplifying this for project templates you use locally with an template creator extension which is not yet published. This would allow you to right click an existing project or solution and then select Create Template and then it would be available in the New Project dialog for you to use.

cannot be opened. The project type is not supported by this installation

.cs project file
The project was created using Visual Studio 2010 and I am trying to open it in Visual Studio 2010 itself but still I am facing this problem.
I have opened this project in VS 2012 and worked for few days but it has created in Visual studio 2010. Is there anything which preserve the project details on local machine?
This is the specific project section in my solution file:
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Project Name", "Project Name\project name.csproj", "{48C1190E-7700-461B-ADCD-B5E0F1ECAD21}"
ProjectSection(ProjectDependencies) = postProject
{1F5440B3-9FD8-4FE2-B621-8697489ABDC4} = {1F5440B3-9FD8-4FE2-B621-8697489ABDC4}
EndProjectSection
EndProject
In Visual Studio it is possible to add Project Types, e.g. for creating an MSI, by installing an Add-On to the development machine. It appears that in the past this was done, and then that new Project Type was used to add a Project to the Solution. But now you are opening the Solution on a machine that does not have that new Project Type.
Look for the GUID of the missing Project Type, it should be part of the error you are getting. Then google "project type {the-guid}" to see which Add-On you need to install on your development machine.
It is also possible that a new Project Type was used in the Solution that simply can not work with VS 2010. In that case your options are either to keep using VS2012, or to start over with a new Solution in VS2010 and migrate the projects into it that are compatible (which may be a bit tricky or hard to do if VS2012 saved them).
Would it be too difficult to just recreate the project and include all the necessary files and references? Once the project was saved from VS 2012, the format may have broken compatibility with 2010. Sometimes this is fixable just by updating the version number in the project file, but I don't see it in your image.

this template attempted to load component assembly Microsoft.VisualStudio.Web.Project

I just installed Visual Studio 2013 Ultimate trial version for completing the MVC5 tutorial by Rick Anderson, which worht doing it.
The tutorial: http://www.asp.net/mvc/tutorials/mvc-5/introduction/getting-started.
However, I created a blank solution first and then try to add an ASP.Net Application project, which is going to be my MVC5 tutorial project. And I got this weird message:
Error: this template attempted to load component assembly
'Microsoft.VisualStudio.Web.Project, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a'. For more information on this problem
and how to enable this template, please see documentation on
Customizing Project Templates.
But I´m not customizing, I´m just creating a project out of a built in template.
Do you know how can I solve it?
Here is the solution:
In Visual Studio 2013, select Tools > Extensions and Updates
Check for updates. You should have the Azure SDK update available.
Download and install the Azure SDK. After this, everything should work fine.
If your updates are not turned on, enable your auto detection of updates in Tools > Options > Environment > Extensions.
If you have unspecified error related to E_fail(code), try this:
When creating a new MVC 5 application, change the framework version from 4.5.1 to 4.5, if that did not work change it to 4. Check the below image if it is not clear.
Another approach:
This is really important if you are installing Visual Studio 2013 on un-updated Windows 7.
there reason i am calling out "not updated is",
The reason that 'un-updated' matters is because Visual studio 2013 does not update the powershell that is required by VS2013 for most of the stuff.
The simple solution is to update Powershell to the latest version.
If you are not sure how to update powershell, you can use this tutorial.
So I stumbled upon this issue as well and would like to share how I was able to resolve this problem.
Tools -> Extensions and Updates -> Online -> NGet Package Manager: Click the download button once you have the NGet Package Manager selected. Make sure to restart your Visual Studio after you have downloaded the Manager.
This should do the trick
Close Visual Studio, run the VS executable with the command line option as shown below (you will likely have to supply the full path), and relaunch VS normally. This should re-initialize the templates, including the one that you are having problems with.
devenv.exe /installvstemplates
So I faced the same problem with Visual Studio 2013, and I don't know what's the problem but it appears that it only occurs when creating a new project, and choosing "Web" from the panel.
What I did was simply clicking on "Visual Studio 2012" just below it, and it worked !

Cannot add System.Net.Http reference to Xamarin.iOS Library project

I am using Xamarin's Visual Studio pluggin. I have a Xamarin iOS Library project and it needs to use System.Net.Http in order to compile. However, I cannot seem to add it as a reference. I have updated my Xamarin Studio to the Alpha version, but still cannot see System.Net.Http in the Assemblies list when attempting to Add Reference.
Any help here would be GREATLY appreciated as I am inches away from getting this thing implemented, but am stuck on this one reference.
Is this available in Visual Studio (with Xamarin Pluggin installed), or is it only in Xamarin Studio?
Thanks in advance for your help !!
WOW !! What a work around.
Ok, here's the solution. Looks like the Visual Studio pluggin does NOT get updated when you update Xamarin Studio on your windows box. HOWEVER, when you go to your mac build server and update Xamarin to the Alpha version, then open a Xamarin Project in Visual Studio, it will prompt you that the build server and Pluggin are different versions and will allow you to upgrade. When you upgrade, after closing visual studio, then open visual studio again, VOILA!!! The System.Net.Http reference is now available under Assemblies when adding a reference.
So, the solution is to update your MAC Xamarin Studio to the Alpha version and then Visual Studio will prompt you for an update. Update it and you're golden !!
Seems like there should be an easier way, but this one worked.
i think you cant add The System.Net.Http reference.you should try this RestSharp
A simple REST client for consuming HTTP APIs..
RestSharp makes it easy to consume the wide array of services on the web over HTTP, like: Amazon, Facebook, or even Twitter...
http://components.xamarin.com/view/restsharp

Resources