Tag: CSharp
All the articles with the tag "CSharp".
-
ASP.NET MVC Framework - Basic sample application
You might have noticed that I'm quite enhousiast about the new ASP.NET MVC framework. Basically, this new ASP.NET MVC framework is an alternative to standard ASP.NET webforms, with some advantages: For more information and a step-by-step tutorial, check Scott Guthrie's blog: For an article I'm working on, I am writing a sample application using this framework. This sample application is a very basic photo album website, listing some albums and photo's. Anyone who's interested in a sample MVC application (no data entry yet!) can download it.
-
ASP.NET 3.5 Extensions CTP preview released
Just over the weekend, Microsoft has released the ASP.NET 3.5 Extensions CTP. This download includes several additions to ASP.NET 3.5: I'll be doing some testing during the week, and keep you all informed.
-
LINQ to filesystem
The past few hours, I've been experimenting with LINQ. As a sample application, I'm trying to create a small photo album website, which shows me all images in a specific folder on my webserver. What does LINQ have to do with that? Everyone has used a loop over all files in a folder, and I decided to try LINQ for that matter. Here's how: [code:c#]
-
ASP.NET MVC framework preview to be released next week
Half the world has been focussing on the release of the new Visual Studio 2008 and .NET 3.5 last week. That is good, as .NET 3.5 offers lots of nice new features and improvements. In the blogosphere, I haven't read much about an extension I've been waiting for anxiously: the new ASP.NET MVC framework. Luckily, Scott Guthrie posted some examples on it, and I can't wait for a preview to be released next week. I'll keep you informed!
-
ASP.NET load balancing and ASP.NET state server (aspnet_state)
At one of our clients, we used to have only one server for ASP.NET applications (including web services). Since this machine is actually business-critical and load is constantly growing, the need for a second machine is higher than ever. This morning I was asked to set up a simple demo of a load-balanced ASP.NET environment. I already did this in PHP a couple of times, but in ASP.NET, this question was totally new to me. Things should not be very different, I thought. And this thought proved right! A bit later, we had a load balancer in front of 2 web server machines. We got everything configured, fired up our webbrowser and saw a different page on each refresh (stating the server's hostname). Load balancing mission succeeded!
-
Advanced ASP.NET caching events
Currently, I'm giving an ASP.NET classroom training at our company, which actually is quite good for me: I needed to refresh all ASP.NET concepts, as those all fade away slowly when you don't use them for a while... Now, one of those refreshed concepts is ASP.NET's caching. ASP.NET offers a flexible built-in caching mechanism, providing you with a global "Cache" object in which you can get and put data which needs to be cached for a while. One of the cool things about ASP.NET caching is that it actually listens to what you want: if you need the cache to expire after 10 minutes, it does so. Also, when memory is needed for other actions on the webserver, ASP.NET will gently clean the cache depeding on cache item priorities.
-
Enabling HTTP proxy for .NET webservice client
Have you ever written code that makes external (Soap) webservice calls? Tried that same code on your company network? Most of the time, this does not work very well due to a proxy server sitting in between, requiring authentication etc. You can start tweaking your Web.config file to set this proxy the right way, or you can override the generated web service class and include the following code snippet: [code:c#] using System; using System.Net; public class SomethingProxyEnabledService : com.example.service.something { protected override System.Net.WebRequest GetWebRequest(Uri uri) { WebRequest request = base.GetWebRequest(uri); request.Proxy = WebRequest.DefaultWebProxy; request.Proxy.Credentials = CredentialCache.DefaultNetworkCredentials;
-
Remove unnecessary HTTP modules from the ASP.NET pipeline
Trying to speed up some things in a demo ASP.NET application for a customer, I found a really simple and effective way to remove some HTTP modules from the ASP.NET pipeline. When you are not using WindowsAuthentication or PassportAuthentication or ..., you can easily disable those modules. This decreases ASP.NET bootstrapping time as there are fewer object creations to do every page load... Now, how to do this? Very easy! Fire up your Visual Studio, and open Web.config. In the HttpModules section, add some "remove" elements, one for every module you whish to disable. If HttpModules section is not present, you can add it yourself. [code:xml]
-
Creating Office2007 documents in C#
-
Automatically generate SandCastle documentation using CruiseControl.NET or VSTS Team Build
Earlier this week, I was playing around with SandCastle, and found that the SandCastle Help File Builder (SHFB) was a great tool to quickly create SandCastle documentation. No more XML writing, just a few clicks and documentation is compiled into a HTML Help file or as a MSDN-style website. Next to the GUI being quite handy, there's also a command-line tool in the download of SHFB... Now wouldn't it be nice if you could just create a configuration file using SHFB, and automatically compile documentation on your build server every weekend? Here's a short how-to, for both CruiseControl.NET (ccnet) and VSTS Team Build! First of all, download and install the right tools on your build machine: This should not be difficult, right?