I have swagger-ui.js version 2.1.2 which is working with handlebars v2.0.0
I upgraded handlebars to 4.7.7 now my swagger-ui is not working with error:
Template was precompiled with an older version of Handlebars than the current runtime.
I am not familiar with swagger UI I just need to upgrade this library due to vulnerability issue. Anyone knows which swagger-ui.js version is compatible with which handlebars.js version? Or can point me to documentation that I can read regarding this.
Related
I have upgraded my project from 3.1 to .netcore 5.0. After doing that tag helpers asp-action and asp-controller not rendering while they were working on 3.1, I have checked the viewimport file it has reference to #addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers and my project also has this included in the framework but still not sure why it is not working.
Rendered HTML code
Tag helper in .cshtml
taghelper reference in viewimport
Solved the issue it was Multitenancy that was conflicting with the mvc.
You can try the following operations may be useful to you.
1.Close all instances of Visual Studio.
2.Download and install the latest .NET Core SDK.
3.Open "Apps & features" (Add or remove programs)
4.Search for ".NET Core SDK" and uninstall all except the latest version (x64 and/or x86).
5.Reopen Visual Studio.
If it does not work, it may be a problem with Microsoft.AspNetCore.Razor.Tools, please run in the terminal:
dotnet add package Microsoft.AspNetCore.Razor.Tools --prerelease
If it doesn't solve, delete your .vscode folder inside your user folder and install C# and other extensions again.After restart VS Code, everything works again.
Currently have a project in which swagger is setup using swashbuckle in asp.net. I would like to incorporate the new Swagger UI https://swagger.io/swagger-ui/. Is there an easy way of doing that?
Thanks
Yes you can use Swagger-Net (I'm the owner of that project)
Swagger-Net is a fork of swashbuckle and we get the latest swagger-ui and other dependencies.
If you already have swash-buckle installed in your project and are using default Swagger UI,
Uninstall the packages from your project.
Search for Swagger-Net in your nuget package manager and install it.
Replace all using swash-buckle statements with Swagger.Net.
You are good to go !!
Github Wiki
I'm working in Visual Studio 2015 Update 3 and .NET Core 1.0. I have a Web API project which is of type .NETCoreApp v1.0. When I add a .NET Core class library, it is of type .NETStandard v1.6. I can add this library to the Web API project as a reference, but it is not recognised when I try to add using statements.
If I create another project of type .NETCoreApp, I can reference it and use the classes without a problem.
How do I make use of a .NET Core class library from my .NET Core App?
Edit/Update:
This appears only to be an editor/Intellisense issue, because despite the editor warnings, the .NETCoreApp does build and run, calling into the class library.
I am running Resharper, which I see is blamed for similar problems with other types of projects: I have checked that I have the latest version and have cleared the Resharper cache and restarted VS2105.
This is a Resharper issue. At this time Resharper (v2016.1.2) does not support .NET Core 1.0.
There are 2 possible solutions:
Uninstall Resharper, and the Visual Studio native intellisense works.
Install the Resharper 2016.2 EAP (Early Access Program) version. I've done this and it's working. Obviously it comes with the caveats of any EAP/beta product.
Here is a link to the Jetbrains forum post where I was told .NET Core 1 was not yet supported and pointed to the EAP version.
Once you've built a library that targets netstandard1.X, you can either:
Produce a NuGet package with dotnet pack and host it locally or on NuGet. Then, install it in your netcoreapp project as any other dependency.
If your library and application are part of the same solution, make a local reference:
project.json
"dependencies":{
"MyLibrary.Core": {
"version": "1.0.0",
"target": "project"
}
}
target: project tells dotnet to look in the current solution for the dependency, instead of using your NuGet feeds. Again, this only works if you are developing the library and application in the same solution.
I have a problem in a SBT project where there are two different versions of Apache HttpClient 4.1.3 and 4.3.1.
I made a small sbt project to reproduce the issue - https://github.com/eirslett/sbt-httpclient-problem
Does anybody know how this can be resolved? How can I have a sbt plugin that uses version 4.3.1, and still do HTTP requests from my build?
I read about Web API having its own TraceWriter implementation with 2012.2, for example here, among other sources.
I am now using VS2013 with .NET 4.5.1 and the EnableSystemDiagnosticsTracing is nowhere to be found. It's meant to be defined in the HttpConfigurationTracingExtensions class which resides in the System.Web.Http.Tracing.dll. However, this assembly is nowhere to be found - not in list of assemblies in the Add Reference dialog, not in GAC.
Where is this assembly supposed to come from? Docs say it's part of .NET Framework 4, which I have installed. Also installed the ASP.NET Web API 2 Tracing 5.0.0 NuGet package. Is there some update? Should I re-install .NET Framework?
I know it's not a big deal to implement ITraceWriter myself but it bothers me not to know what happened with the built-in implementation.
Just install needed NuGet Package
Install-Package Microsoft.AspNet.WebApi.Tracing -Version 5.0.0
It's a little bit strange, but it is the right package
http://www.nuget.org/packages/microsoft.aspnet.webapi.tracing
If you installed the Tracing 5.0.0 NuGet package, it should be correctly included in your project. The moment it is installed, I believe a separate text file should open in VS showing the code you should include in your WebApiConfig.cs file.
I haven't created a Web API 2 project from scratch (only upgraded from pre-5.0 to 5.0 projects), but this is the code that should reside in your WebApiConfig.cs file:
// To disable tracing in your application, please comment out or remove the following line of code
// For more information, refer to: http://www.asp.net/web-api
config.EnableSystemDiagnosticsTracing();
And that should be it, if the package is installed correctly, tracing should now be used in your project.