I was browsing over at the Official Microsoft ASP.NET site and came across a link to an interesting codeproject article with some great tips: 10 ASP.NET Performance and Scalability Secrets.
Uncategorized
Perth .NET Community of Practice: First Meeting of 2008
The Perth .NET Community of Practice user group’s first meeting of 2008 got the year off to a great start, with a session on ASP.NET MVC presented by Michael Minutillo. It was well received, and we will endeavour to get Mike back for a further session on this hot topic. Thanks to everyone who attended and especially to everyone who helped out.
There were over 50+ people on the night, despite a clash with another event (‘Meet the Team’) being run by Change Corporation, and the fact that the announcement that we were going to have beer and pizza went out quite late!
Bill Poole from Change Corporation gave a brief introduction to Change Corporation’s involvement with .NET development and reaffirmed their ongoing commitment to support the Perth .NET community. We are indebted for their support. Bill has also kindly offered to present an upcoming talk on Service Oriented Architecture. More details soon.
Thanks go to Talent International for arranging and supplying the refreshments. And last but not least, a mention of all our sponsors: Change Corporation, Excom, Talent International, SoftTeq, JetBrains, Power Business Systems, Microsoft and all the publishers who are contributing to the User Group Library: O’Reilly, Apress, Pearson IT, Peachpit.
Microsoft launches ASP.NET Wiki
Scott Guthrie’s ASP.NET team have released an ASP.NET wiki (currently in beta).
[Personally, I think it definitely looks like a Beta and could do with better navigation and layout but I’m sure that will come.]
Thanks to Mike Minutillo for the heads up.
For a Few How to’s more… Windows CE .NET 4.2 and Pocket PC Resources
Microsoft Windows CE .NET 4.2 Alphabetical List of How-to Topics: http://msdn2.microsoft.com/en-us/library/ms918395.aspx
Articles about .NET Compact Framework at Pocket PC Developer Network: http://www.windowsmobiledn.com/sections/dotnet.html. Many of these articles are quite old, but they do contain the odd useful snippet.
Optimise Your .NET Compact Framework 2.0 Development
Optimize Your Pocket PC Development with the .NET Compact Framework
This MSDN webcast covers quite a few topics, and most will be familiar, but it’s a good, commonsense refresher: Optimizing Your .NET Compact Framework 2.0 Applications for Performance (Level 200)
There is a large collection of Mobility Webcasts here.
.NET Compact Framework version 2.0 Performance and Memory Working Set FAQ.
Thinking of using the Compact Framework for ‘real’-time applications? Chris Tacke’s January 2008 article, “Performance Implications of Crossing the P/Invoke Boundary” is an interesting read.
Using Log4Net with the .NET Compact Framework 2.0 SP2
Log4Net is a simple and effective logging solution for .Net applications. If you want to use it with the .NET Compact Framework, you just need to recompile the source code that is part of the standard 1.2.10 (zip) download package. Open the solution file (.sln), make sure build is set to Release, and compile with symbols NETCF and NETCF_1_0 defined in the log4net project properties [don’t forget to update the assembly references to point to the Compact Framework 2.0 SP2 DLLs, rather than the standard framework ones]
(Note: although we are compiling for CF 2.0 there is no NETCF_2_0 symbol to define)
What are the differences between the Compact and Standard versions? http://logging.apache.org/log4net/release/framework-support.html
SitePoint CSS Reference
If you haven’t already seen it, the good folks at SitePoint have put together a CSS Reference and made it publicly accessible here.
“In this free online reference, the entire CSS language is clearly and concisely explained, including browser compatibility, working examples, and easy-to-read descriptions.
The reference has been written by two of the world’s most renowned CSS experts — Tommy Olsson and Paul O’Brien — so you know it’s accurate, up to date, and best practice.”
Its other nice feature is the ability to accept user contributed notes.
C# Code Snippet: Download a File Over HTTP
This code snippet was adapted from one of Jim Wilson’s excellent “How Do I?” tutorials. It works with .NET Framework 2.0 (including the .NET Compact Framework CF 2.0 SP2), and I’ve successfully tested it on a Windows CE 4.2 device. You will probably want to add a bit more error handling:
///
/// Download a file from a URL to a local folder on a windows mobile device
/// Note: Don't forget that mobile folders do not start with a drive letter.
///
/// e.g. http://www.someaddress/downloads/
/// e.g. filetodownload.exe
/// e.g. \temp\
///
public static long FromHttp(string uri, string filename, string localFolder)
{
long totalBytesRead = 0;
const int blockSize = 4096;
Byte[] buffer = new Byte[blockSize];
if (!Directory.Exists(localFolder))
{
Directory.CreateDirectory(localFolder);
}
try
{
HttpWebRequest httpRequest =
(HttpWebRequest)WebRequest.Create(Path.Combine(uri, filename));
httpRequest.Method = "GET";
// if the URI doesn't exist, an exception will be thrown here...
using (HttpWebResponse httpResponse = (HttpWebResponse)httpRequest.GetResponse())
{
using (Stream responseStream = httpResponse.GetResponseStream())
{
using (FileStream localFileStream =
new FileStream(Path.Combine(localFolder, filename), FileMode.Create))
{
int bytesRead;
while ((bytesRead = responseStream.Read(buffer, 0, buffer.Length)) > 0)
{
totalBytesRead += bytesRead;
localFileStream.Write(buffer, 0, bytesRead);
}
}
}
}
}
catch (Exception ex)
{
// You might want to handle some specific errors : Just pass on up for now...
throw;
}
return totalBytesRead;
}
Comments welcome.
A Few Useful Links for .NET Compact Framework Targeted Mobile Development
OpenNETCF have a free community edition of their extension library:
http://www.opennetcf.com/Home/tabid/36/Default.aspx
(among other things, contains a useful FileSystemWatcher which is missing from CF 2.0 SP2)
This Microsoft site has a few great tip and tricks:
http://msdn2.microsoft.com/en-us/netframework/bb495180.aspx
.NET Compact Framework Team
http://blogs.msdn.com/netcfteam/
Chris Tacke’s SDF Samples
http://blog.opennetcf.org/ctacke/CategoryView,category,SDF%20Samples.aspx
Neil Cowburn’s blog:
http://blog.opennetcf.com/ncowburn/
Jim Wilson’s Blog
http://www.pluralsight.com/blogs/jimw/
Peter Foot’s Blog:
http://www.peterfoot.net/CategoryView,category,NETCF.aspx
Mike Hall’s Blog:
http://blogs.msdn.com/mikehall/
Also, Issue 14 of the Architecture Journal has a mobile device focus:
http://www.msarchitecturejournal.com/pdf/Journal14.pdf
Make: The Best of: 75 projects from the pages of MAKE
- Tools
- Electronics
- Microcontrollers
- Toys & Games
- Robots
- Music
- Flight & Projectiles
- Photography & Video
- Cars & Engines
http://www.oreilly.com/catalog/9780596514280/