Welcome to MSDN Blogs Sign in | Join | Help

Here is a cross-post from my personal site with a possible fix for folks who may have upgraded their web server to IIS7 and had content break. My specific issue is around a web gallery generated by Lightroom that generates the images into a 'bin' directory and IIS7 by blocks by default to prevent people from downloading assemblies directly (ASP.NET places assemblies in bin directories by default).

http://scottholden.name/archive/2008/03/19/lightroom-web-galleries-and-iis7.aspx

Scott.

This posting is provided "AS IS" with no warranties, and confers no rights.

0 Comments
Filed under: ,

Last week I was down in Las Vegas to attend two conferences: MIX and MEDC. Both gave me a chance to show off what the team has been working on and talk to customers and partners. It was a great week for me!

For MEDC, we showed off a lot of the work that you can get in the Visual Studio Code Name "Orcas" Beta 1 which contains Beta 1 of .NET Compact Framework 3.5. This includes LINQ, Windows Communication Foundation, sound APIs, diagnostic tools and more. There were 6 presentations plus hands-on-labs that the team did (here is the list). If you would like to learn more about the content, just drop me an email and I will put you in touch with appropriate folks on the team.

For both conferences, we demonstrated an early prototype of Silverlight running on Windows Mobile. We still have a lot of details to figure out yet...so keep your eyes posted here. But until then, here is a podcast of the demo that we showed at MIX:

Regards,

Scott.

This posting is provided "AS IS" with no warranties, and confers no rights.

The Mobile & Embedded DevCon for 2007 is set to happen starting April 30th. Visit http://medc2007.com/public/home.aspx for more details.

My team has been working hard to get together fresh content on what we have been working on over the last year or two.

I put together a list of interesting session and hand-on labs that are related to the .NET Compact Framework. There are way too many sessions to go to here :)

Break-out Sessions presented by the .NET Compact Framework Team

Tuesday, May 1 11:30am
APP214 - What's New in .NET Compact Framework v3.5
David Kline

Tuesday, May 1 1:45pm
ILL317 - Building an Application using Windows Communication Foundation (WCF) and Store and Forward Transports in the .NET Compact Framework
Anthony Wong

Tuesday, May 1 3:15pm
APP 325 - Using WCF to build Distributed Applications using Smart Devices
Mark Prentice and Sergey Kuryata

Tuesday, May 1 4:45pm
APP324 - Using LINQ with the .NET Compact Framework
Ilya Tumanov

Wednesday, May 2 11:30am
APP403 - Building High-Performance Apps Using the .NET Compact Framework
Ryan Chapman

Wednesday, May 2 3:45pm
APP206 - Panel Discussion with .NET Compact Framework Team, OpenNETCF Smart Device Framework Team and Other Industry Insiders
Richard Greenberg and  Scott Holden

Wednesday, May 2 5:15pm
APP322 - New and Improved .NET Compact Framework Diagnostic Tools
Steven Pratschner

Thursday, May 3 8:30am
APP323 - Real World Testing of Managed Smart Device Applications
David Kline

Thursday, May 3 2:00pm
APP206 - Panel Discussion with .NET Compact Framework Team, OpenNETCF Smart Device Framework Team and Other Industry Insiders
Richard Greenberg and  Scott Holden

Break-out Sessions presented by MVPs

Wed, May 2 - 3:45 PM
.NET Compact Framework Asynchronous Programming Techniques
Maarten Struys

Wed, May 2 - 1:45 PM
Bluetooth Communication in Windows® Embedded CE and Windows Mobile©
Douglas Boling

Tue, May 1 - 1:45 PM
Building Mobile Applications with the patterns & practices Mobile Application Blocks
Andy Wigley

Wed, May 2 - 8:30 AM
Compact Framework Memory Management
Chris Tacke

Hands-on Labs

HOL301 - Building an Application using Windows Communication Foundation (WCF) and Store and Forward Transports in the .NET Compact Framework

HOL302 - Improving Application Performance Step-by-Step featuring Diagnostic Tools in .NET Compact Framework 3.5

HOL305 - Incorporating COM Objects into Your .NET Compact Framework Application

HOL310 - Building a Device Client Application Consuming a Windows Communication Foundation (WCF) Service over HTTP and HTTPS

HOL312 - Exploring Compact LINQ

HOL313 - Tips, Tricks and Techniques for Debugging .NET Compact Framework Applications

Break-out Sesssions Visual Studio for Devices / Tools

Tue, May 1 - 3:15 PM 
Building Mobile Windows Forms Applications: Tips, Tricks and Guidelines
Daniel Moth

Tue, May 1 - 1:45 PM
What's New for Device Developers in Visual Studio® "Orcas"
Amit Chopra

Wed, May 2 - 11:30 AM
Unit Testing for Devices in Visual Studio® "Orcas"
Sadagopan Rajaram

Other Break-out Sessions

Thu, May 3 - 8:30 AM
Developing Windows Live™ Search for mobile - Lessons Learned
Ashley Feniello, Steve Garrity, Gram Wheeler

Thu, May 3 8:30 AM
Accelerating Windows Mobile© Line of Business Development
Rob Tiffany

Thu, May 3 3:30 PM
Time to Call a CAB: Building Smart Device Deployment Projects in Visual Studio® 2005
Nickolas Landry

Tue, May 1 6:15 PM
Building Windows Mobile© Applications for Large Scale Deployment
Jay Hennings

Thu, May 3 - 11:45 AM
Adapt Your App: Building Windows Mobile© Applications that Seamlessly Run on Any Device
Jim Wilson

---------------

So I hope to see you all there. I will be hanging around at a lot of these sessions and be participating directly in a couple of panel discussion with OpenNETCF members and industry insiders. I will also be hanging around the .NET CF product booth. You can send me email by clicking on the email link above if you would like to try to set up a time to meet at MEDC.

Regards,

Scott.

This posting is provided "AS IS" with no warranties, and confers no rights.

http://www.satter.org/2007/03/thank_god_for_c.html

I am always happy to see positive feedback from the releases that we do. I am glad that we were able to productize and get out such a useful tool -- even though it took us longer than expected

See Steven's article on using this sweet tool:

http://blogs.msdn.com/stevenpr/archive/2007/03/08/finding-managed-memory-leaks-using-the-net-cf-remote-performance-monitor.aspx

And don't worry. We are working on more tools to diagnose performance (speed and memory) issues in your applications for .NET CF 3.5.

Scott.

This posting is provided "AS IS" with no warranties, and confers no rights.

This is a plug for my personal website and blog: http://scottholden.name (blog) and http://airjockeys.com (photos, videos). You can go to http://photos.airjockeys.com for a better list of all photo albums. I am still in the middle of updating the site for better navigation and flow.

Regards,

Scott.

This posting is provided "AS IS" with no warranties, and confers no rights.

http://blogs.msdn.com/xna/archive/2007/01/09/video-getting-started-with-the-xna-creators-club.aspx

This is a great video talking about XNA and how to get started using the XNA Creators Club.


Video: Getting Started with the XNA Creators Club

Scott.

This posting is provided "AS IS" with no warranties, and confers no rights.

http://blog.markarteaga.com/MicrosoftWindowsMobile50AppDevCoursePromotion.aspx

Check out the promotion being run by Microsoft Learning and OpenNETCF and all you have to do is ask questions. The promotion runs until the end of this week.

 regards,

Scott.

This posting is provided "AS IS" with no warranties, and confers no rights.

http://blogs.msdn.com/xna/archive/2006/12/11/xna-game-studio-express-has-been-released.aspx

This is an exciting release for us. It's great to see the excitement out there in the community and the developers who have been writing games on the betas. You can now get your subscription for the Xbox 360 XNA environment! Party on.

Scott.

This posting is provided "AS IS" with no warranties, and confers no rights.

0 Comments
Filed under:

Rico has been posting performance quizzes for a couple of years now. These are always interesting and useful.

 

He just posted another (#11) which is about dense data structures and I am sure to be useful for those XNA game writers out there!

 

The question:

http://blogs.msdn.com/ricom/archive/2006/08/31/733887.aspx

 

Answer:

http://blogs.msdn.com/ricom/archive/2006/09/07/745085.aspx

 

 

Enjoy,

Scott.

This posting is provided "AS IS" with no warranties, and confers no rights.

This is pretty cool. The top 5 MEDC 2006 hand-on labs have been converted to Virtual Labs which you can now take. You can download the manuals and walk-through the lab at your own pace.

 

http://msdn.microsoft.com/virtuallabs/windowsmobile/

 

Check out the .NET Compact Framework related labs!

 

Developing a SQL Mobile Application with Visual Studio 2005 and SQL Server 2005

 

In this lab you will learn to:

·         Synchronize data between a Windows Mobile®–based device and a SQL Server 2005 backend database

·         Create a SQL Mobile database, set up, and configure SQL Server 2005 and Internet Information Services (IIS) for merge replication.

·         Create a Microsoft .NET Compact Framework application to maintain SQL Mobile data and synchronize it with SQL Server data

·         Synchronize SQL Mobile data with any backend data store using a Web service

 

Developing Multithreaded Applications with the .NET Compact Framework 2.0

 

In this lab you will learn to:

·         Create and terminate threads

·         Deal with the challenges of updating user interface controls from inside worker threads

·         Use the multithreading capabilities of the .NET Compact Framework 2.0

 

Windows Mobile 5.0: Developing Managed Applications for Pocket PC and Smartphone Devices

 

In this lab you will learn to:

·         Describe the Windows Mobile 5.0 Platform

·         Create managed applications for Windows Mobile 5.0 Devices

·         Use the new Windows Mobile 5.0 APIs

·         Understand how to use the Device Emulators

 

Scott.

This posting is provided "AS IS" with no warranties, and confers no rights.

Here is the information on the XNA team blog about how to participate in the beta and send feedback. 

http://blogs.msdn.com/xna/archive/2006/08/30/731941.aspx

 

 

There is also a more detailed article describing the XNA Framework.

http://blogs.msdn.com/xna/archive/2006/08/25/724607.aspx

 

Have fun writing games!

 

Scott.

This posting is provided "AS IS" with no warranties, and confers no rights.

Rico posted an article Taming The CLR: How to Write Real-Time Managed Code with the contents of a talk that he presented at MS Gamefest! Great information here!

 

Here are the links to .NET CF GC architecture/information.

http://blogs.msdn.com/stevenpr/archive/category/6497.aspx

http://blogs.msdn.com/scottholden/archive/2004/12/28/339733.aspx

 

Scott.

 

Chris Tacke, one of our MVPs, also wrote up an article on Bitmap allocation and GC interaction.

http://blog.opennetcf.org/ctacke/PermaLink,guid,987041fc-2e13-4bab-930a-f79021225b74.aspx

This has good correlation to the article that I wrote.

Scott.

This posting is provided "AS IS" with no warranties, and confers no rights.

One of the fun parts of my job is talking to customers. However, this means that I sometimes I get asked tough questions…some of them issues in the .NET Compact Framework and sometimes we just need more information for our customers. So here is some information that I gleaned recently from talking to one of the .NET CF MVPs and David Wrighton – who is a developer on my team.

 

So the question is “Do bitmaps leak memory?” No, but without careful coding it could appear that they do.

 

The Issue

 

while(true)

{

    Bitmap b = new Bitmap(stream);

    // Use the bitmap

 

    // continue

}

 

In this small piece of code, you would expect that you would never get an OutOfMemoryException (OOM) because the “application” isn’t keeping any long-lived references to the Bitmap objects it is creating. However, it is allocating a lot of native memory as well as the managed memory for the Bitmaps. Because the Bitmaps aren’t disposed, when the application runs out of memory, the .NET CF CLR will invoke a garbage collection. However the Bitmap objects need to be moved to the finalizer queue before they are freed. Therefore, it’s possible that no memory is freed immediately causing the next Bitmap allocation to fail.

 

[See background posts on the GC and Finalizers by Steven Pratschner and myself]

 

The Best Fix

 

while(true)

{

    Bitmap b = new Bitmap(stream);

    // Use the bitmap

 

    // Release bitmap

    b.Dispose();

 

    // continue

}

 

The best way to prevent the OOM is to dispose of the bitmap when done using the object. This will cause the underlying native memory to be freed immediately and will prevent the non-determinism of the finalizer.

 

The Alternate ‘Fix’

 

This ‘fix’ is really used to help understand the inner workings of the .NET CF CLR a little more. I strongly suggest using the Dispose pattern as shown above.

 

while(true)

{

    Bitmap b;

 

    try {

        b = new Bitmap(stream);

    } catch (OutOfMemoryException) {

        GC.WaitForPendingFinalizers();

        b = new Bitmap(stream);

    }

 

    // Use the bitmap

 

    // continue

}

 

In this example, I put a try/catch surrounding the Bitmap constructor. If any part of the allocation fails, the CLR will attempt to perform a GC to reclaim memory. But, as noted above, all the Bitmap objects are placed on the finalizer queue. So we need the application to wait for all finalizers to complete before trying to allocate the object again. Of course, this could have some serious latency issues depending on the number of objects on the finalizer queue and the work each finalizer is required to do to complete.

 

Deeper information about Bitmap constructors

 

Here is a little deeper information on the way Bitmaps may be allocated. There are two major paths for allocation which may affect where the memory is allocated, but in the end have the same issues as indicated above.

 

  1. Bitmap constructor that takes a stream as a parameter
    • This will construct a DIB
    • DIBs are allocated out of the application process virtual memory (VM) address space
  2. Bitmap constructor that takes a height/width as parameters
    • This will construct a DDB
    • DDBs are allocated by the driver, typically, in the gwes.exe or possibly in dedicated video RAM. This will actually use physical and virtual memory that is not in the process VM space.

 

Directly from David Wrighton:

In short, we have 2 different types of Bitmap in our runtime with varying performance and allocation characteristics. DDBs are generally faster to manipulate and draw to the screen than DIBs, but they are constructed in an external memory space that can cause allocation confusion and cause the performance of calls to LockBits or Save to be slower. If a DIB is desired and you wish to construct it based on width and height, we provide a function that constructs a Bitmap with a width, height, and pixelformat specified. This function will construct a DIB instead of a DDB.

 

Hopefully this clears some confusion around the memory allocations surrounding bitmaps and how to “prevent leaks”.

 

Scott.

This posting is provided "AS IS" with no warranties, and confers no rights.

 

It’s been a little over a year since my team has been working on bringing the .NET development environment to Xbox 360 by developing a custom Common Language Runtime (CLR) for the Xbox 360 console. The CLR is a piece of the recently announced XNA Game Studio Express which will enable developers to write games on their retail Xbox 360. Even better, the XNA platform is supported on Windows as well and will enable developers to easily write a game that can run on both Xbox 360 and Windows! Since XNA Game Studio Express is based on Visual Studio Express and .NET, developers familiar with the writing managed code can easily harness the power of our gaming platforms.

 

For me, I have always thought it would be cool to be able to write a game. Most of it has been in the logic and physics aspects though and not the art – because frankly I can’t draw. My artistic streak is in the form of photography (shameless plug: My Photo Gallery). To date, I have spent most of my career in the “plumbing” of software development…operating systems, network protocols and the .NET CF CLR. I am very excited to help build a platform that developers can write cool games on and for me to get out of the plumbing and try to create a game.

 

For more information, take a look at the XNA Team Blog. Also, here is a link to sign up for the public beta of the XNA Game Studio Express (for Windows) at the end of this month or early September.

 

Scott.

This posting is provided "AS IS" with no warranties, and confers no rights.

1 Comments
Filed under:
More Posts Next page »
 
Page view tracker