Skip to main content

Posts

Showing posts with the label General

How to set Swagger as the default start page for API hosted on the Azure web app?

I created an Asp.Net Core 2.x Web API and configured Swagger on it, below is the code added in Configure method under Startup.cs file, for full swagger configuration, check here //Add swagger configuration app.UseSwagger(); app.UseSwaggerUI(c => {     c.SwaggerEndpoint( "../swagger/v1/swagger.json" , "Test API V1" ); }); On my local machine when I run the API it is automatically redirected to the Swagger page. However, when I hosted this API as an Azure web app it is not redirecting directly to the Swagger and to access the swagger, I had to append /swagger in the URL, for example, https://testapi.azurewebsites.net/swagger/ Solution: Set RoutePrefix to string.Empty under app.UseSwaggerUI like below: app.UseSwaggerUI(c => {     c.SwaggerEndpoint( "../swagger/v1/swagger.json" , "Test API V1" );      c.RoutePrefix = string .Empty; // Set Swagger UI at apps root }); And that’s it, now when you b...

Resolved: Error ‘Microsoft.VisualStudio.Editor.Implementation.EditorPackage’ package did not load correctly.

After installing Visual Studio 2015, I got the dialogue box with error “‘Microsoft.VisualStudio.Editor.Implementation.EditorPackage’ package did not load correctly.” , when I opened the application which is running on Visual Studio 2012.  This error can also happen after updating VS 2012. Solution: Close the Visual Studio and then remove the folder “%LOCALAPPDATA%\Microsoft\VisualStudio\11.0\ComponentModelCache” . Once you are done then restart the Visual Studio and it should work fine then.

How to fix 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine error

While creating OleDB Connection through Visual Studio (to connect with Access DB or import data from excel or CSV), you may get the error read as: 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine. Solutions: There are several possible solutions for this error; you can try any one of mentioned below solution: ·          Try to install MicrosoftAccess Database Engine 2010 Redistributable. ·          If that doesn’t solve your problem try to install 2007Office System Driver: Data Connectivity Components. ·          Or you can try by changing Solution Platform from "Any CPU" to "x86". For this right click on the Solution File(in Solution Explorer) -> Configuration Manager -> Active Platform Drop down -> If x86 is already there then select that, else Click on New -> Select x86 from the new platform dropdown -> Compi...

No exports were found that match the constraint: ContractName Microsoft.VisualStudio

Today morning when I opened one of my projects in Visual Studio 2012, I got mentioned below error: “No exports were found that match the constraint: ContractName Microsoft.VisualStudio.Utilities.IContentTypeRegistryService RequiredTypeIdentity Microsoft.VisualStudio.Utilities.IContentTypeRegistryServicePlease correct before proceeding. (You might rename the current web.config and add a new one).” Reason: It seems error occur when the .NET 4.5 framework is updated via recent windows 7 updates. Solution: I resolved this issue by removing the files inside the Visual Studio Component Model Cache folder at this specific location for Visual Studio 2012. C:\Users\{username}\AppData\Local\Microsoft\VisualStudio\11.0\ComponentModelCache If you facing this issue with Visual Studio 2010 then the relevant location is: C:\Users\{username}\AppData\Local\Microsoft\VisualStudio\10.0\ComponentModelCache Or if you facing this issue with Visual Studio 2013 then the relevant lo...

Failed to find or load the registered .net framework data provider for sqlite

While using “sqlite” one can encounter error “failed to find or load the registered .net framework data provider.” We can solve the issue by taking care of following things: Fix your DbProviderFactories entry in the config file (i.e. web.config or app.config) to reference the full (version and public key information) assembly name instead of the partial assembly name. A full reference allows .NET to search the GAC for SQLite. Here's a "full" reference example: < DbProviderFactories >   < add name = " SQLite Data Provider " invariant = " System.Data.SQLite "        description = " .Net Framework Data Provider for SQLite "        type = " System.Data.SQLite.SQLiteFactory, System.Data.SQLite, Version=1.0.27.1, Culture=neutral,PublicKeyToken=db937bc2d44ff139 " /> </ DbProviderFactories > However, if you're deploying to a production machine without access to th...

Anchor tag not working in IE

While working with Anchor tag, you may face a weird issue, where it's working fine with Firefox, Chrome, Safari and all other browsers but may not work in IE. For example your anchor is: < a id ="top"></ a > or < a name ="top"></ a > Although all browsers should be able to find an anchor tag like < a id ="top"></ a > , but IE can't find it if it's empty tag (i.e. no character content between the tags). Fix: To fix the issue simply add non-breaking space between the tags like this: < a id ="top"> &nbsp; </ a > or < a name ="top"> &nbsp; </ a > And it’ll work fine then, for more details you can check W3C recommendation for anchors.

Hosting application with Uhuru AppCloud

While hosting your application, you can found numerous hosting options, some provide great features while other provides flexibility in money and in feature you want to use. I have gone through and found Uhuru AppCloud is a very nice option you can try for hosting your application and it provide flexibility to host application written on different platforms (i.e. .Net, Java, PHP, Ruby etc) .  Here I am writing some steps for naive users to start with Uruhucloud. Steps to use Uruhucloud:- 1.   Create Account        a.    Open the site  http://www.uhurucloud.com   and click on “Sign Up” button (If you have promo code then enter, no issue if you have none).       b.     Select any one OpenID Authentication ex. Google, Microsoft or Facebook.       c.     Your account will be created and redirected to Dashboard. 2.     Download ...

Bom Sabado flooding on Orkut

On Orkut, you might have noticed something fishy going on over the past few hours. A large number of users are randomly flooding their friend’s scrapbooks (Orkut’s equivalent of Facebook Wall) with the following message: It doesn’t take a genius to figure out that the “Bom Sabado!” messages are automatically generated by a script. However, it is not clear if this is simply a script exploiting a  vulnerability in Orkut, or have the accounts sending the automated scraps have been compromised. If you are amongst those affected, it’s highly recommended that you follow the steps highlighted below: Switch to the “older version” of Orkut. Log out of Orkut. Clean your browser’s cache and cookies. Log in and change your password and security question. If you haven’t been affected yet, it is strongly advised that you avoid Orkut until the issue has been resolved. I managed to trigger the same exploit while researching this article. Recently other high-profile websites like Twitter...