How to run a website built with ASP.NET Core on a Windows machine with IIS and create a self-certificate to test your application properly
Search Results for: iis
Using an in-memory repository. Keys will not be persisted to storage. – ASP.NET Core under IIS
One of the main benefits of building a new .NET project using .NET Core is cross platform deployment, however, IIS will still be a common home for ASP.NET Core web applications.
Introducing the IIS Administration API
The IIS team has been working on a new RESTful API to manage your IIS configuration. While still under development, the team was eager to share a preview of the new API. The API allows configuration of IIS resources such as authorization rules, modules, and applications. The API has been built with Hypertext Application Language (HAL) to allows APIs to have built-in discoverability. Starting at the root of the API, you can browse the entire API surface. In addition to the API, the IIS team has also built an API…
IIS rewrite rules
This post describes some of the tips and tricks that one may find useful when solving URL-based problems for their web server or web site. Each tip/trick has a description of a problem and then an example of how it can be solved with IIS 7 URL Rewrite Module. 1. Add or Remove Trailing Slash Many web applications use “virtual URLs†– that is the URLs that do not directly map to the file and directory layout on web server’s file system. An example of such application may be an…
IIS 7.5 error: Handler “PageHandlerFactory-Integrated†has a bad module “ManagedPipelineHandler†in its module list
Today I installed Clean Windows Web Server 2008 R2 64-bit with IIS 7.5. To my surprise opening .NET 4.0 application I received the following error: IIS 7.5 Detailed Error – 500.21 – Internal Server ErrorServer Error in Application “DEFAULT WEB SITE”Internet Information Services 7.5[Error Summary]HTTP Error 500.21 – Internal Server ErrorHandler “PageHandlerFactory-Integrated” has a bad module “ManagedPipelineHandler” in its module list[Detailed Error Information]Module IIS Web CoreNotification ExecuteRequestHandlerHandler PageHandlerFactory-IntegratedError Code 0x8007000dRequested URL https://localhost:80/default.aspxPhysical Path C:\inetpub\wwwroot\default.aspxLogon Method AnonymousLogon User Anonymous[Most likely causes:]•Managed handler is used; however, ASP.NET is not installed or is…
Methods not Allowed in ASP.NET Core
If you create APIs, you can face that same Methods not Allowed in with ASP.NET Core, NET6 or NET7.
Add Security Headers to Blazor WebAssembly
In this new post, I like to explain how to add security headers to Blazor WebAssembly to follow the recommendations from OWASP.
Add Security Header our website
In this new post, I’ll show you how to add security header to our website to be ready for a penetration test. Quick and easy to implement.
Deploy WordPress with Azure DevOps
In this new post, I show you how to deploy WordPress with Azure DevOps using an instance of WordPress app service created in the Azure
Copy folders excluding files in PowerShell
Here I will give you a script to copy folders excluding files in PowerShell. This is quite useful when you want to copy your deployment folder
Secure Blazor WebAssembly with IdentityServer4
I’m going to explain how to secure a Blazor WebAssemble application with IdentityServer4. Also, how to secure API calls
Creating a URL shortener using ASP.NET WepAPI and MVC: error handling
In the two previous post I discussed about the first step to creare this application and the implementation of the business logic. Now we can implement the error handling. We have two custom exception classes: ShorturlConflictException (when a segment already exists) and ShorturlNotFoundException (when a segment isn’t found in the database). There is also a third type: an unexpected exception, for example when there is no database connection. Normally, the user will see these errors. We have to build a mechanism where these exceptions are caught and a nice error…
Creating a URL shortener using ASP.NET WepAPI and MVC
In this tutorial, I use several techniques and tools. I use Microsoft Visual Studio 2015 and the latest version of all components. ASP.NET MVC: Microsoft’s modern web application framework. As the name says, it pushes you to use the MVC (model view controller) software design principle. ASP.NET Web API: Web API and MVC are used together in many applications. With MVC, the HTML of the web pages are rendered on the server, and with Web API you can, like the name says, create an API. Web API also uses the…
String to Hex – Hex to String Convert
You can convert a string to hex or vice-versa with this methods. Example for real world; You want set / get some data from URL, but if your data has some special chars (like ^$ %) it’ll be problem… In this case, you can use this methods and convert your data to hex. public string ConvertStringToHex(string asciiString) { string hex = ""; foreach (char c in asciiString) { int tmp = c; hex += String.Format("{0:x2}", (uint)System.Convert.ToUInt32(tmp.ToString())); } return hex; } public string ConvertHexToString(string HexValue) { string StrValue = ""; while…
MOBI Mime Type
How to setting IIS for .mobi extensions? Open IIS and click on its name Double click on MIME Then right click and in the menu click on Add. Then add as file name extension .mobi and as MIME type application/x-mobipocket-ebook
How to remove HTML tags from data with SQL
The purpose of this article is to provide a way of cleaning up of HTML tags within the data. When we use various styles or tabular format data in UI using Rich Text Editor/ Rad Grid etc, it will save data in database with HTML tags. When you save in database this kind of field you have: An HTML element starts with a start tag (<p>) and ends with end tag (<p/>) and everything between Start tag and End tag is HTML element. e.g. <b>Following are the popular databases: <br…
Track events for Google Analytics and Piwik
After my post of yesterday, I’ve worked for creating a script to integrate Google Analytics (new version with analytics.js) and Piwik (Piwik is the leading open-source analytics platform similar to Google Analytics. You can download it from its site or directly in your IIS with WebMatrix). With this code you have only one function to call in every part of your page. Automatically the function detects download, email, phone number, external links and tracks them. You can insert in an anchor a code like: <a href=”https://puresourcecode.com/” onclick=”TrackEvent(‘Link to my site’, ‘PSC’,…
ASP.NET: The data protection operation was unsuccessful
the data protection operation was unsuccessful. this may have been caused by not having the user profile loaded for the current thread’s user context, which may be the case when the thread is impersonating. If you receive this error from one of your application, you resolve the problem in this way: Open IIS Manager Select Applications Pools, and go ahead and select the App Pool used by your app Right-click on it, and select Advanced Settings, Go to the Process Model Section and Find the “Load User Profile” Option and…
Web.config: encryption and decryption
Introduction In this article I will explain how to encrypt or decrypt connection Strings in web.config file using asp.net. Description In Previous posts I explained lot of articles regarding Asp.net, Gridview, SQL Server, Ajax, JavaScript etc. In many of articles I used connection Strings section in web.config file to store database connection. The connection Strings section contains sensitive information of database connections including username and password of database. Is it secured to store the sensitive information of database connections in plain text files called web.config and machine.config files? If we…
Why Visual Studio Code?
Visual Studio Code provides developers with a new choice of developer tool that combines the simplicity and streamlined experience of a code editor with the best of what developers need for their core code-edit-debug cycle. Visual Studio Code is the first code editor, and first cross-platform development tool – supporting OSX, Linux, and Windows – in the Visual Studio family. At its heart, Visual Studio Code features a powerful, fast code editor great for day-to-day use. The Preview release of Code already has many of the features developers need in…
Microsoft announces Microsoft Edge
Today at Build 2015 in San Francisco, Microsoft announced its new Web browser called Microsoft Edge. This is the browser formerly known as Project Spartan. Microsoft Edge, the new default browser will ship on all Windows 10 devices including PCs, tablets, smartphones, and Microsoft’s own tablet, Surface. Microsoft Edge is the all-new Windows 10 browser built to give you a better web experience. Write directly on webpages and share your mark-ups with others. Read online articles free of distraction or use the offline reading feature for greater convenience. Microsoft Edge…
Exception Handling in ASP.NET MVC
Index 1. Introduction 2. HandleErrorAttribute 3. Limitations of HandleError 4. HandleError vs Application_Error 5. Extending HandleError 6. Returning views from Application_Error 7. ELMAH 8. Summary Introduction Exception handling is a serious matter in any application, whether it’s web or desktop. Implementing a proper exception handling is important in any application. In most cases once we catch the exception we have to log the exception details to database or text file and show a friendly message to the user. In ASP.NET applications, error handling is done mostly in two ways: at…
Introducing ASP.NET 5
The first preview release of ASP.NET 1.0 came out almost 15 years ago. Since then millions of developers have used it to build and run great web applications, and over the years we have added and evolved many, many capabilities to it. I’m excited today to post about a new release of ASP.NET that we are working on that we are calling ASP.NET 5. This new release is one of the most significant architectural updates we’ve done to ASP.NET. As part of this release we are making ASP.NET leaner, more…
Developing a REST Web Service using C# – A walkthrough
REST stands for Representational State Transfer. The term was introduced by Roy Fielding in his doctorial dissertation. REST is an architectural style for designing networked applications. It is an alternate to using complex mechanisms like COBRA, RPC, and SOAP to connect between client and server. REST makes communication between remote computers easy by using the simple HTTP protocol which support for CRUD (Create, Read, Update, and Delete) operations on the server. In a way, our World Wide Web is also based on the REST architecture. In a nutshell, REST is…
Setup FileZilla Server Passive Ports on Windows Server 2012
I prefer to use FileZilla FTP Server above the traditional IIS FTP module. FileZilla comes with a lite and lean GUI, great logging tools, connection (speed)limits and more. If you do not know FileZilla Server or the Filezilla Client I strongly encourage you to try them out at https://filezilla-project.org/ Setting up the FileZilla Server is straightforward, but after configuration the user/groups and directory you can have some trouble setting up the Windows Server 2012 Firewall. Traditional FTP uses port 21, you should open this on your Firewall (see below) but…