ASP.NET 4.5 and ASP.NET Core 1 Hosting BLOG

Tutorial and Articles about ASP.NET 4.0 and the latest ASP.NET 4.5 Hosting

ASP.NET Hosting - ASPHostPortal :: Difference between appSettings and Connection Strings in ASP.NET web.config

clock October 22, 2012 08:59 by author Jervis

Now I will explain differences between appsettings and connection strings in web.config using asp.net.

In web.config file we can store the connection strings in two ways those are
appSettings and connectionStrings

AppSettings in web.config

The AppSettings section in web.config is used to store connection strings, server names, file paths, and other miscellaneous settings needed by an application.


Connection String in web.config

The connection string in web.config is a collection of database connection strings only.

Actually in previous versions of ASP.NET all connection string values are storing in appsettings only. In ASP.NET 2.0 + version new features has introduced such as Session, Membership, Personalization, and Role Manager these will depend on connection strings and stored in the connectionStrings element only.

Difference

The main difference is in appsettings section we can store any data string values including database connection strings also but in connectionStrings section only database connection strings can store those are our application connection strings and new features (Membership, Personalization and Role Manager) connection strings only.

Instead of this there is no much difference between appsettings and connectionStrings.

Reasons why you must trust ASPHostPortal.com

Every provider will tell you how they treat their support, uptime, expertise, guarantees, etc., are. Take a close look. What they’re really offering you is nothing close to what ASPHostPortal does. You will be treated with respect and provided the courtesy and service you would expect from a world-class web hosting business.


You’ll have highly trained, skilled professional technical support people ready, willing, and wanting to help you 24 hours a day. Your web hosting account servers are monitored from three monitoring points, with two alert points, every minute, 24 hours a day, 7 days a week, 365 days a year. The followings are the list of other added- benefits you can find when hosting with us:

- DELL Hardware
Dell hardware is engineered to keep critical enterprise applications running around the clock with clustered solutions fully tested and certified by Dell and other leading operating system and application providers.
- Recovery Systems
Recovery becomes easy and seamless with our fully managed backup services. We monitor your server to ensure your data is properly backed up and recoverable so when the time comes, you can easily repair or recover your data.

- Control Panel
We provide one of the most comprehensive customer control panels available. Providing maximum control and ease of use, our Control Panel serves as the central management point for your ASPHostPortal account. You’ll use a flexible, powerful hosting control panel that will give you direct control over your web hosting account. Our control panel and systems configuration is fully automated and this means your settings are configured automatically and instantly.

- Excellent Expertise in Technology
The reason we can provide you with a great amount of power, flexibility, and simplicity at such a discounted price is due to incredible efficiencies within our business. We have not just been providing hosting for many clients for years, we have also been researching, developing, and innovating every aspect of our operations, systems, procedures, strategy, management, and teams. Our operations are based on a continual improvement program where we review thousands of systems, operational and management metrics in real-time, to fine-tune every aspect of our operation and activities. We continually train and retrain all people in our teams. We provide all people in our teams with the time, space, and inspiration to research, understand, and explore the Internet in search of greater knowledge. We do this while providing you with the best hosting services for the lowest possible price.

- Data Center

ASPHostPortal modular Tier-3 data center was specifically designed to be a world-class web hosting facility totally dedicated to uncompromised performance and security
- Monitoring Services
From the moment your server is connected to our network it is monitored for connectivity, disk, memory and CPU utilization – as well as hardware failures. Our engineers are alerted to potential issues before they become critical.

- Network
ASPHostPortal has architected its network like no other hosting company. Every facet of our network infrastructure scales to gigabit speeds with no single point of failure.

- Security
Network security and the security of your server are ASPHostPortal’s top priorities. Our security team is constantly monitoring the entire network for unusual or suspicious behavior so that when it is detected we can address the issue before our network or your server is affected.

- Support Services
Engineers staff our data center 24 hours a day, 7 days a week, 365 days a year to manage the network infrastructure and oversee top-of-the-line servers that host our clients’ critical sites and services.

 



ASP.NET 4.5 Hosting - ASPHostPortal :: Supporting Asynchronous IO Operations with .NET Framework 4.5

clock October 11, 2012 07:30 by author Jervis

In the earlier versions of .NET framework, writing code to perform asynchronous IO operations was not possible and hence the IO operations had to be synchronous. The problems that the developers were encountering with the synchronous approach were:

1. Unresponsiveness of UI - if the application is a thick client and had to perform file IO operations based on the user actions.

2. Performance issue - In case of back ground process, where it has to process large files.

In .NET Framework 4.0 asynchronous IO provisions were given for classes like StreamReader, StreamWriter, etc. through the methods BeginRead, BeginWrite, etc., involving callbacks. Though it provided a way to write asynchronous code there was yet another drawback--the code complexity!


In .NET Framework 4.5 the IO classes are packed with new Async methods using await and async keywords, which can be used to write straight-forward and clean asynchronous IO code. Below are the advantages of using these new async IO methods.


1. Responsive UI - In Windows apps, the user will be able to perform other operations while the IO operation is in progress.

2. Optimized performance due to concurrent work.
3. Less complexity - as simple as synchronous code.

In this article we look at a few examples of async IO operations in .NET Framework 4.5.


StreamReader and StreamWriter

StreamReader and StreamWriter are the widely used file IO classes in order to process flat files (text, csv, etc). The 4.5 version of .NET Framework provides many async methods in these classes. Below are some of them.


1.ReadToEndAsync
2.ReadAsync
3.ReadLineAsync
4.FlushAsync – Reader
5.WriteAsync
6.WriteLineAsync
7.FlushAsync – Writer

The code below reads the content from a given list of files asynchronously.

namespace AsyncIOSamples
{
class Program
{
static void Main(string[] args)
{
List<string> fileList = new List<string>()
{
"DataFlatFile1.txt",
"DataFlatFile2.txt"
};
foreach (var file in fileList)
{
ReadFileAsync(file);
}
Console.ReadLine();
}
private static async void ReadFileAsync(string file)
{
using (StreamReader reader = new StreamReader(file))
{
//Does not block the main thread
string content = await reader.ReadToEndAsync();
//Gets called after the async call is done.
Console.WriteLine(content);
}
}
}
}


Now let us try with the ReadLineAsync and read the content from a single file asynchronously.

namespace AsyncIOSamples
{
class Program
{
static void Main(string[] args)
{
ReadFileLineByLineAsync("DataFlatFile1.txt");
Console.WriteLine("Continue with some other process!");
Console.ReadLine();
}
private static async void ReadFileLineByLineAsync(string file)
{
using (StreamReader reader = new StreamReader(file))
{
string line;
while (!String.IsNullOrEmpty(line = await reader.ReadLineAsync()))
{
Console.WriteLine(line);
}
}
}
}
}


In these examples the main point to note is that these asynchronous operations do not block the main thread and are able to utilize the concurrency factor.

A similar example holds good for StreamWriter as well. Here is the sample code, which reads the content from a list of files and writes it to the output files without blocking the main thread execution.

namespace AsyncIOSamples
{
class Program
{
static void Main(string[] args)
{
ProcessFilesAsync();
//Main thread is not blocked during the read/write operations in the above method
Console.WriteLine("Do something else in the main thread mean while!!!");
Console.ReadLine();
}
private static async Task ProcessFilesAsync()
{
List<string> fileList = new List<string>()
{
"DataFlatFile1.txt",
"DataFlatFile2.txt"
};
foreach (var fileName in fileList)
{
string content = await ReadFileAsync(fileName);
WriteFileAsync(content, "Output" + fileName);
}
}
private static async void WriteFileAsync(string content, string outputFileName)
{
using (StreamWriter writer = new StreamWriter(outputFileName))
{
await writer.WriteAsync(content);
}
}
private static async Task<string> ReadFileAsync(string fileName)
{
using (StreamReader reader = new StreamReader(fileName))
{
return await reader.ReadToEndAsync();
}
}
}
}


WebClient

This class is used for data request operations over protocols like HTTP, FTP, etc. This class is also bundled with a bunch of Async methods like DownloadStringTaskAsync, DownloadDataTaskAsync and more.

It doesn't end here but extends to classes like XmlReader, TextReader and many more. I will leave it to the readers to explore them.

Happy reading!

 



ASPHostPortal.com Announces Newest Service Windows Server 2012 Hosting

clock October 10, 2012 07:26 by author Jervis

ASPHostPortal is a premiere web hosting company that specialized in Windows and ASP.NET-based hosting, proudly announces new Microsoft product, Windows Server 2012 hosting to all new and existing customers. The newly released server operating system offers a number of features that can be utilized to benefit developers, resellers and businesses.

Windows Server 2012 offers new and improved features which enable multi-user infrastructure where storage resources, networking and compute are completely remote from other users. There are a number of key features that customers will find useful, including support for asp.net 4.5, Internet Information Services 8.0 (IIS), compatibility with Visual Studio 2012, Visual Studio Express 2012, support for ASP.NET MVC 4, and Entity Framework 5. Other key new features include dynamic IP restriction to help prevent DoS attacks, support WebSockets and node.js, and also CPU Throttling to ensure isolated each client's server usage and Application Initialization to improve user experience of first requests.

“We have always had a great appreciation for the products that Microsoft Offers. With the launched of Windows Server 2012 hosting services, entrepreneurs and organization will be able to build their impressive website to be on the top of the competition.” Said Dean Thomas, Manager at ASPHostPortal. “Within Windows Server 2012 hosting packages, users will have the ability to use Hyper-V in assorted configurations, improved isolation and security, fortified access controls to files and processes and the capability of managing servers as a group.”

ASPHostPortal is one of the Microsoft recommended hosting partner that provide most stable and reliable web hosting platform. With the new launch of Windows Server 2012 into its feature, it will continue to keep ASPHostPortal as one of the front runners in the web hosting market. For more information about new Windows Server 2012 hosting, please visit http://www.asphostportal.com.

About ASPHostPortal.com:

ASPHostPortal.com is a hosting company that best support in Windows and ASP.NET-based hosting. Services include shared hosting, reseller hosting, and sharepoint hosting, with specialty in ASP.NET, SQL Server, and architecting highly scalable solutions. As a leading small to mid-sized business web hosting provider, ASPHostPortal strive to offer the most technologically advanced hosting solutions available to all customers across the world. Security, reliability, and performance are at the core of hosting operations to ensure each site and/or application hosted is highly secured and performs at optimum level.



ASP.NET Hosting - ASPHostPortal :: How to Speed up Your Development Time

clock October 9, 2012 08:41 by author Jervis

In this article we will learn that how you can speed up your development time if you have many projects in your solution. It is very simple.

Introduction

Suppose we have many projects in our solution and we want to build only one project at a time so that our development time will be minimised. You all will think that it can be done simply by making one of your project as the start project. But my friends you cannot do it by that. This article is based on to show "How to speed up build time".


Procedure

Suppose you have two Projects in our Solution Explorer.



First we will configure Visual Studio to set one of the two project as "Start Project" as the Current Selection in the "Solution Explorer" window using the properties of one of your projects.




Now if you will build it then both the project will be builded like....




Here in the above picture you can see that both of your project is going to build. Now you can imagine the time it will take if you have hundreds of project in your one solution.


In your Visual Studio just click on "Tools" then "Options". In that click on "Projects and Solutions" and then click on "Build and Run".Like the picture given below....




You just have to check the checkBox "Only build startup projects and dependencies on Run." Now if you will return to your application and then start the startup project you will get like this




Hope this helps

 

 



Cheap ASP.NET 4.5 Hosting

We’re a company that works differently to most. Value is what we output and help our customers achieve, not how much money we put in the bank. It’s not because we are altruistic. It’s based on an even simpler principle. "Do good things, and good things will come to you".

Success for us is something that is continually experienced, not something that is reached. For us it is all about the experience – more than the journey. Life is a continual experience. We see the Internet as being an incredible amplifier to the experience of life for all of us. It can help humanity come together to explode in knowledge exploration and discussion. It is continual enlightenment of new ideas, experiences, and passions


Author Link


 

Corporate Address (Location)

ASPHostPortal
170 W 56th Street, Suite 121
New York, NY 10019
United States

Tag cloud

Sign in