Skip to main content

Posts

Showing posts from August, 2019

Access SQL LocalDB by an application hosted in local IIS

Introduction:SQL server express LocalDB is a developer's database, which is a lightweight edition of Microsoft SQL. It works as same as SQL with fewer features.

LocalDB can be created and managed by VisualStudio or SQL management studio. Using visual studio we can create database LocalDB either from "SQL Server Object Explorer" or by using code first approach using any asp.net web application.

To configure LocalDB to an application hosted in local IIS, we need to set up a few additional settings. Here we are going to discuss the common problems and solutions while configuring.

Create ASP.NET Core MVC Sample Application: Create asp.net MVC Dotnet core application. In VisualStudio, while selecting an MVC application template we can select the authentication option, in that select individual login option.

After the project creates initially run the application using IIS Express server which is a prebuilt server in VisualStudio.



We can observe a sample application with few pa…

Ionic 4: Ionic DevApp

Introduction:
The Ionic DevApp mobileapplication, which helps to test and run our ionic application on mobile device at the time of development.
It is the most comfortable and fast way to test application when compared to traditional approaches like either run on emulators or connecting the real device to the application test machine.
Ionic DevApp free mobile application which is available on Google Play Store and Apple App Store.

How It Works:
1. Both development machine and mobile enable and connect  to the same WIFI
2. Run the application using the command"ionic serve --devapp", after that application get build
3. mobile get detects our application and starts running.

Step 1:
Download "Ionic DevApp" from google play store on to your mobile as below


Step 2:
Open Ionic Dev App, on the first time it shows up login form just sign up with your account. After login, you can see where application tries to search for an ionic application running on a machine which connected…

Ionic 4: Test mobile contacts at the local browser at development time using the mock plugin ( Part - 2)

Introduction: In part -1 we have written code to create contacts, now using the mock-up plugin API "Cordova-Plugin-Contacts-Mock" access user mobile contact to our application listing contacts page.  Click here to read part - 1


Install Contact Mock Plugin:
Install below mock plug-in
"npm install cordava-plugin-contacts-mock --save-dev"
for more go to this mock plugin link

Configure Mock Plugin Script To Our Application: Now add the below js file path to "Scripts" array property in the angular.json file.

"node_modules/cordova-plugin-contacts-mock/build/contacts-mock.js"

after adding js file path rebuild the project again.

Mock Contacts To Chrome Browser Local Storage: Run the application and go to the second tab in the sample project which is created to add new contacts. Using that code creates few dummy contacts which are going to be accessed as mobile contact to test "Cordova-plugin-contacts" API.

All the contacts that are added will be st…

Ionic 4: Test mobile contacts at the local browser at development time using the mock plugin ( Part - 1 )

Introduction: In Ionic 4 had been provided with native API "Cordova-plugin-Contacts" to access mobile contacts. At development to test, accessing mobile contacts either we need to configure mobile emulators, or we need to connect the real device which bit complex approach.

"Cordova-Plugin-Contacts-Mock" a third party plugin helps to mock the contacts and access them in the browser and test on the browser like do on mobile. So testing on the browser is the fastest and comfortable approach to test user contacts

"Cordova-Plugin-Contact-Mock" API helps mock the contacts in our local browser (Developer Tools => Application => Local Storage) which helps to test all the features that are originally provided by Ionic 4 native API  "Cordova-Plugin-Contacts".

"Note: Mocking of contact only works with chrome browser".
About Platform :
1.Ionic 4
2.Angular 8.0v

Create Ionic4 Application: Create an Ionic 4 application, in this sample, I'm usin…

Dotnet Core: Tranform web.config

Introduction:
In dotnet core 2.2  or above, transformations of the web.config can be done with the following ways:
1. Build Configuration
2. Profile
3. Environment
4. Custom
Any of the processes can be utilized in your project deployment pipeline.

"In Dotnet core  2.2  and above transformation works directly with the core platform. In Dotnet core 2.1 or below transformation won't work directly for that please go through this link here."

Build Configuration:
To create a Dotnet core MVC project, click here for  Dotnet core Mvc get started. Now by default web.config file will not be created. Now add the web.config file to the project and change the file as below.


<configuration> <system .webserver=""> <handlers> <remove name="aspNetCore"> <add modules="AspNetCoreModule" name="aspNetCore" path="*" resourcetype="Unspecified" verb="*"> </add></remove…

Dotnet Core Application Hosting And Debugging Using Local IIS Server

Introduction: Dotnet core application can run by using hosting servers like
1. IIS EXPRESS(built-in  server in visual studio)
2. KESTREL
3. IIS SERVER
and so on many other servers.

The most commonly used server at development time is IIS EXPRESS. But we can do debugging the application by hosting it on Local IIS Server also. Using Local IIS helps to test any server-level configuration locally before going to the production server.
About Platform: The platform using for this sample below
1. IIS Server 7 or above,
2. Dotnet Core Framework 2.2v+
3. Dotnet Core MVC
4. Visual Studio 2017 or above (editor)
Getting Started:  Now we are going host a sample ASP.NET Core MVC application in our local IIS Server and then we are going debug our application in visual studio using Local IIS Server.
Download And Install DOTNET Core SDK And Runtime: Go to the Microsft Dotnet Core downloads and download and install dotnet core SDK and Runtime. SDK is the Software Development Kit, provides libraries to de…

Asp.Net Route Constraint: Single Url To Load Desktop Page Or Mobile Page By Device Request

Introduction: In modern web development every application targeting all devices, like desktop, mobile, and tablet, etc. For that, everyone follows the most common approaches like:
1. Design a Single page with responsiveness for all devices.
2. Maintaining multiple domains for devices like for desktop (https://example.com) and for mobile devices (https://m.example.com)

Existing Approach Problems:

In the first approach, a single page with responsiveness for all devices needs to write a lot of CSS and HTML code. This may result in affecting page load time with heavy CSS leads problems like CSS Render Blocking.
In the second approach, with multiple domains targets different pages for each domain like for desktop requests one page and mobile request another page gets loaded. With this approach, there is no unnecessary loading of CSS and Html gets loaded. But the problem in this approach needs to maintain different domains.

Solution (Asp.net Route Constraint):

Asp.net Route Constraint provid…