Context
I would like to use AutoRest generated client for a webapi service by using "Add"/"REST API Client..." in visual studio 2017.
However, it gives the following error:
[Info]AutoRest Core 0.16.0.0
...
[Fatal]Error generating client model: Collection format "multi" is not supported (in parameter 'xxx').
The older version of AutoRest (e.g. 0.16.0) does not support "multi" collection format. So I installed the latest version AutoRest 0.17.3. using Nuget. But when I use "Add"/"REST API Client...", it still uses 0.16.0 version AutoRest and gives me the same error. It seems visual studio 2017 has a built-in AutoRest version 0.16 assembly.
Question
How do I get the latest version of AutoRest and integrate it in Visual studio 2017?
I also had this problem so I built a tool for it called REST API Client Code Generator. I worked in teams where we used tools like AutoRest, NSwag, and Swagger Codegen to generate our REST API Clients and it always annoyed me that the "Add New - REST API Client..." tooling in Visual Studio didn't always work and was very troublesome when it was time to re-generate the client
The REST API Client Code Generator piggy backs on top of AutoRest, NSwag, and the Java SDK for Swagger Codegen CLI and OpenAPI Codegen CLI. So to be able to use AutoRest you will need Node.js to be installed and then you need to manually install AutoRest using NPM
npm install -g autorest
Using the tool will add the Swagger.json file to the C# project and set a custom tool to it so every time the changes are made to the Swagger.json file, the API Client code is re-generated. You will have to manually update the Swagger.json file though if you use Auto, NSwag, Swagger Codegen, OpenAPI Codegen though. But if you chose to use NSwag Studio to generate code then you can just re-generate the code directly from the .nswag file from the C# project
Related
Is there some way I can configure Visual Studio 2022 to use a specific version of the Azure Functions Core Tools and stop it from keep auto-updating the version?
Update
So I've managed to run some earlier versions of func.exe with earlier working builds of my code but I just keep getting error:
A host error has occurred during startup operation '00e57aab-bb85-42eb-8b4a-13e0c279b8ef'.
[2022-04-13T12:17:34.919Z] Microsoft.Azure.WebJobs.Extensions.DurableTask: Unable to find an Azure Storage connection string to use for this binding.
[2022-04-13T12:17:34.928Z] Using the default storage provider: AzureStorage.
Value cannot be null. (Parameter 'provider')
An update to VS2022 must have blown something low-level up in my local environment.
You can pin to the specific version of Azure Functions core tools in the Visual Studio 2022. It will not let you auto update.
Whatever the recent version you installed, that will be picked by VS.
Example:
Here when you select .NET 6, it will create project on AFCT Version 4, if .NET 3, it will create project on AFCT Version 3 (v3).
But it will not update automatically. You can run .NET 3.1 project on v3 until there are any specific bindings or code requires update of AFCT Version 4.
It will just notify you there are some updates on Azure Functions Core Tools Package in your project/solution.
Note: AFCT - Azure Functions Core Tools
Whereas in VS Code, even though there are multiple versions of Azure Functions core Tools installed. At the beginning of project creation, you can select/pin the Specific Version of Azure Functions Core tools.
Later, it will notify there is an update on Azure Functions Core Tools Package that either you can accept update or ignore if you want to work on specified version.
I need to generate the swagger client SDK for my rest api in .net core project. The option "New REST API Client" is not in the context menu for the project under Add. How do I get it (or otherwise generate the SDK for my project so I can write simple tests)?
Currently, generate new REST API client option is not available for .NET Core projects. You can use tools like NSwagStudio or autorest or Open API Generator to generate clients.
I'm using very latest (16.4.2, dated 8th Jan 2020) Visual Studio 2019.
When I tried to create a Blazor WebAssembly solution, although the description for 'blazor app' included the words 'server or webassembly', when I got to the create page, only Server option was available and it successfully creates Core 3.1 application.
I assumed latest version would be there, so I went to the Visual Studio marketplace website and there were no Blazor extensions to be found, so looking on the internet I found running this command:
dotnet new -i
Microsoft.AspNetCore.Blazor.Templates::3.1.0-preview2.19528.8
(found via Missing visual studio 2019 blazor webassembly app template)
And it worked, I got web assembly option. However, when I look at my project created using WebAssembly it is using .net Core 2.0 and the options only go as far as 2.1. I presumed by the '3.1.0' section in the name it would be the latest.
Any idea how I get the latest template rather than random searching and use .net core 3.1?
If there is a better way, can anyone let me know how to uninstall templates as I failed to find out how.
Run the following in a CLI or in Tools -> Nuget package Manager -> Package Manager Console:
dotnet new --install Microsoft.AspNetCore.Components.WebAssembly.Templates::3.2.0-preview3.20168.3
The NuGet package for above is here.
Get started with ASP.NET Core Blazor here.
Update
The latest release is now an RC and can be installed with the following:
dotnet new -i Microsoft.AspNetCore.Components.WebAssembly.Templates::3.2.0-rc1.20223.4
The latest preview release as of April 30th can now be installed with the following:
dotnet new -i Microsoft.AspNetCore.Components.WebAssembly.Templates::3.2.0-preview5.20216.8
This requires the latest dotnet core SDK 3.1.201.
To check for the latest preview you can check the ASP.NET blog.
I am playing with the new Apache Cordova blank template in Visual Studio 2015 RC. I noticed the taco.json file in the project.
Besides defining the version of Apache Cordova you are using does it serves any other purpose?
Is it something like bower to define other frameworks like angular or bootstrap in there?
Geert,
taco.json file is currently used by Visual Studio to define Cordova CLI version used to build the project with. If you open up config.xml designer, under the platforms tab you will see the Cordova CLI version specified.
When you build/run your app for iOS, the remote agent uses the CLI version defined in your taco.json file to ensure that the remote machine uses the correct version of Cordova to build your app.
Currently, taco.json file is only used by Visual Studio and Visual Studio CLI (like vs-mda-remote) and does not define bower packages.
A bit of extra information... "taco" is an acronym for "Tools for Apache Cordova". In the RC release of Visual Studio, taco.json only includes a single key-value pair declaring the version of Cordova used in the project. For example:
{
"cordova-cli": "4.3.0"
}
If you want to use a different version of Cordova (greater than 4.3), just change the value on the right side of the colon.
Geert,
I have not used this feature, but based on the existing documentation, taco.json is used for continuous integration servers.
Documentation with details can be found here:
https://github.com/Microsoft/cordova-docs/blob/master/tutorial-gulp/gulp-ci.md
https://github.com/Microsoft/cordova-docs/blob/master/tutorial-team-build/README.md
To add to an older question:
Since TACO v1.0.0 was officially release on Thursday (1 October 2015), Here's the new official site: taco.tools.
I found this site to be a great place to get started and extra info on TACO.
Does anyone know if there is a portable class library (PCL) version of the RabbitMQ client libraries that could be used in the developmentof a Xamarin mobile application?
If nor does anyone know of a similar AMPQ client as a PCL
Thanks in advance
While using Xamarin, you can communicate (send/receive push-notifications) with rabbitMQ using Rabbitmq-web-STOMP plugin activated on broker end, and use socket-io at Xamarin (using web sockets).For details regarding how to do it in xamarin see here. Use the example code that gets generated after you install the stomp and stomp examples on rabbitServer by :
rabbitmq-plugins enable rabbitmq_web_stomp
rabbitmq-plugins enable rabbitmq_web_stomp_examples
for rabbitly-details have a look here, and into the source of "echo" example .
Well, RabbitMQ.Client requires .NET Standard 1.5, and Xamarin.Andorid and Xamarin.iOS provide.NET Standard 1.6: https://github.com/dotnet/standard/blob/master/docs/versions.md
P.S. make sure to convert your projects to package.json structure instead of "old" nuget packages.config. dotnet build tools are also a must (Visual Studio 2015 Update 3?)