Tuesday, May 4, 2010

Slides and Code from my Silverlight 4 – MEF webcast

Slides and Code from my Silverlight 4 – MEF webcast


Slides and Code from my Silverlight 4 – MEF webcast

Posted: 04 May 2010 02:38 PM PDT

Here you can find the sample code and slides (in italian) from my webcast around Silverlight 4 and MEF for the local XEdotNET user group. The samples contain the following topics: Simple composition using the CompositionInitializer; Multiple Exports;...( read more )...(read more)

The one that got away [Simple workarounds for a visual problem when toggling a ContextMenu MenuItem's IsEnabled property directly]

Posted: 04 May 2010 10:46 AM PDT

A few days ago, Martin Naughton and Tiago Halm de Carvalho e Branco independently contacted me to report a problem they were having with the new ContextMenu control in the April '10 release of the Silverlight Toolkit . In both cases, they were toggling...( read more )...(read more)

Upcoming Script# Release and LIDNUG presentation

Posted: 04 May 2010 11:32 AM PDT

A quick heads up on a Script# presentation for the Linked.NET user group on LinkedIn, and some words (ummm... teasers) on the upcoming script# release... [ Full post continued here... ] Read More......(read more)

Silverlight Tip of the Day #12 – Getting an Images Source File Name

Posted: 04 May 2010 10:02 AM PDT

Once you have an image loaded how do you go back and get the original file name for the source file? This can be accomplished through the Uri property of the images Source. However, you must first typecast the images Source to be a BitmapImage. The Uri...( read more )...(read more)

Silverlight TV 23: MVP Q&A with WWW (Wildermuth, Wahlin and Ward)

Posted: 04 May 2010 10:01 AM PDT

John interviews a panel of 3 well known Silverlight leaders including Shawn Wildermuth, Dan Wahlin, and Ward Bell at the Silverlight 4 launch event. The guest panel answers questions sent in from Twitter about the features in Silverlight 4, thoughts on...( read more )...(read more)

Design-time Resources in Expression Blend 4 RC

Posted: 04 May 2010 08:24 AM PDT

When building Silverlight and WPF applications that are composited (e.g. using MEF) or written to support UI customization, resources are loaded dynamically at run-time. This is a great solution on the development side, but can be a challenge when working...( read more )...(read more)

Silverlight and WCF RIA Services (1 - Overview)

Posted: 04 May 2010 05:57 AM PDT

A big part of the Silverlight 4 release is the new WCF RIA Services framework. Its worth pointing out that WCF RIA Services doesn't only target Silverlight clients – it also targets AJAX clients but I'm sticking with the Silverlight side of the house...( read more )...(read more)

Visual Studio 2010 Extension Manager (and the new VS 2010 PowerCommands Extension)

Posted: 03 May 2010 10:34 PM PDT

This is the twenty-third in a series of blog posts I'm doing on the VS 2010 and .NET 4 release. Today's blog post covers some of the extensibility improvements made in VS 2010 – as well as a cool new "PowerCommands for Visual Studio 2010" extension that Microsoft just released (and which can be downloaded and used for free). [In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu ] Extensibility in VS 2010 VS 2010 provides a much richer extensibility model than previous releases.  Anyone can build extensions that add, customize, and light-up the Visual Studio 2010 IDE, Code Editors, Project System and associated Designers. VS 2010 Extensions can be created using...(read more)

Screen Scraping – When All You Have Is A Hammer…

Posted: 03 May 2010 08:08 PM PDT

        I had decided to create a list of what videos were already available on the Learning Pages of Silverlight.net.  When I clicked on the page for the entire list, however, I was quite daunted by the sheer number. I opened...( read more )...(read more)

Introduction to Sample Data

Posted: 03 May 2010 07:23 PM PDT

Learn how to use sample data to easily visualize and design data centric applications in Expression Blend....( read more )...(read more)

Try Out the New Microsoft Desktop Player

Posted: 03 May 2010 07:51 PM PDT

Microsoft Desktop Player allows developers to access technical content (such as videos, webcasts, podcasts, and white papers) and links to resources (including developer evangelists, local training opportunities, and local user groups) in your area. View it online or download the WPF application to view offline. Try it today!

Live Security Talk Webcast: Using Standards-Based Internet Explorer Features to Protect Apps (Level 200)

Posted: 03 May 2010 07:51 PM PDT

If you are building mashups and other web applications, what do you need to know to make sure that you are building secure applications that don't expose security vulnerabilities? What do you need to consider when building your applications using features from HTML 5, HTML 4.01, and important features of the browser? Attend this webcast to learn how to use standards-based Windows Internet Explorer features to protect the applications you develop.

Download .NET 4

Posted: 12 Apr 2010 10:00 AM PDT

The .NET Framework is Microsoft's comprehensive and consistent programming model for building applications that have visually stunning user experiences, seamless and secure communication, and more.

This posting includes an audio/video/photo media file: Download Now

What's New in the .NET Framework 4

Posted: 12 Apr 2010 10:00 AM PDT

The .NET Framework 4 is highly compatible with applications that are built with earlier .NET Framework versions, except for some changes that were made to improve security, standards compliance, correctness, reliability, and performance.

This posting includes an audio/video/photo media file: Download Now

A Developer's Introduction to Windows Workflow Foundation (WF) .NET 4

Posted: 12 Apr 2010 10:00 AM PDT

An overview of the most important new features and improvements in Workflow Foundation, with enough technical detail and code to help you as a developer understand how to use them.

This posting includes an audio/video/photo media file: Download Now

VS2010 and .NET 4 Training

Posted: 12 Apr 2010 10:00 AM PDT

Use videos and hands-on labs to help you learn how to use the Visual Studio 2010 features and a variety of framework technologies. We recommend this training for those familiar using previous versions of Visual Studio and .NET.

This posting includes an audio/video/photo media file: Download Now

Silverlight Unit Test Framework: New version in the April 2010 Silverlight Toolkit

Posted: 03 May 2010 03:26 PM PDT

The latest release of the Silverlight Toolkit contains the new Silverlight Unit Test Framework, with a new modern user interface, out-of-browser support, and performance improvements. Read More......(read more)

Silverlight Tip of the Day #11 – Deploying Silverlight Applications with WCF web services.

Posted: 03 May 2010 01:50 PM PDT

The purpose of this tip is to outline all the steps needed to deploy a Silverlight application that leverages a WCF web service to a server. There are a number of issues you could run into if you forget a step. The errors you receive are often ambiguous...( read more )...(read more)

Silverlight Unit Test Framework: New version in the April 2010 Silverlight Toolkit

Posted: 03 May 2010 03:26 PM PDT

The latest release of the Silverlight Toolkit contains the new Silverlight Unit Test Framework, with a new modern user interface, out-of-browser support, and performance improvements....( read more )...(read more)

Monday, May 3, 2010

Flexible Project-to-Project References

Flexible Project-to-Project References


Flexible Project-to-Project References

Posted: 03 May 2010 11:08 AM PDT

My name is Amit Mohindra and I am a Program Manager with the Visual C++ IDE team. In this post I would like to talk about project-to-project references. In VS2010 release we moved the C++ build and project system to be based on MSBuild. There is an excellent article written by Marian Luparu detailing the change and advantages of the new build/project system (http://blogs.msdn.com/vcblog/archive/2008/11/20/printf-hello-msbuild-n.aspx).

Project to Project references have existed ever since Visual Studio 6. However the term has evolved over the years. Native technologies used Project dependencies to define references prior to Visual Studio 8. With Visual Studio 8 native projects were able to define project to project references.

"Project to Project references" defines the mechanism in which Project A creates a reference to Project B, by which Project A consumes the output of Project B to deliver on its functionality.  This feature is consumed by users who have large source code bases, a solution with many large projects and input of one project is driven by the output of another project.

Traditionally, there are three variables that control how project references work:

·         Ignore Import Library (Set On the Referenced project)

Tells the linker not to try to link any .lib output generated from this build into any dependent project. This allows the project system to handle .dll files that do not produce a .lib file when built. If a project is dependent on another project that produces a DLL, the project system automatically will link the .lib file produced by that child project. This may not be needed by projects that are producing COM DLLs or resource-only DLLs; these DLLs do not have any meaningful exports. If a DLL has no exports, the linker will not generate a .lib file. If no export .lib file is present on the disk, and the project system tells the linker to link with this (missing) DLL, the link will fail.

Use "Ignore Import Library" to resolve this problem. When set to "Yes", the project system will ignore the presence or absence of that .lib file and cause any project that is dependent on this project to not link with the nonexistent .lib file.

·         Link Library Dependencies (Set On the Referencing project)

Gives you the choice of linking in the .lib files that are produced by dependent projects. Typically, you will want to link in the .lib file. If you don't want to consume the .lib file generated then just set this Linker setting to "False".

·         Use Library Dependency Inputs (Set On the Referencing project)

In a large project, when a dependent project produces a .lib file, incremental linking is disabled. If there are many dependent projects that produce .lib files, building the application can take a long time. When this property is set to Yes, the project system links in the .obj files for .libs produced by dependent projects, thus enabling incremental linking.

In this design however there were limitations and the design wasn't very flexible in allowing the project defining the reference to control the behavior. Consider the following very simple example:

 

-          Project A defines project-to-project references to Project B and Project C (both Project B and C create .lib outputs). Project A wants to only consume the library output of Project B and not for Project C.

o   In VS2008, this was achieved by creating references to Project A with "Link Library Dependency" property set to "Yes" for Project A and subsequently setting "Ignore Import Library" for Project B to "No".

§  This approach however had a disadvantage in that if there was another Project D referencing Project B it would be limited by the "Ignore Import Library" property being set to "No". The scenario shown in diagram above was not achievable in VS2008.

In VS2010 we have enabled the above scenario by supporting reference level metadata on the project references. Now you can set "Link Library Dependencies" and "Use Library Dependency Inputs" properties at the project reference level. To achieve the scenario above:

-          Project A will create a project reference to Project B and Project C

-          For the Project B set the "Link Library Dependencies" property to "False"

-          Project D will create a project reference to Project B and Project C. In this case the global defaults for the properties ("Link Library Dependencies" set to "True" and "Use Library Dependency Inputs" set to "False") will define the behavior.

To set these properties you can use the "Framework and References" tab in the property page of the parent project (Project A) as follows:

 

 

 

It looks like the following in Project A.vcxproj:

<ItemGroup>

    <ProjectReference Include="..\Project B\Project B.vcxproj">

      <Project>{fcefddd7-fc28-490a-a937-ee8ce39c43d7}</Project>

      <Private>true</Private>

      <ReferenceOutputAssembly>true</ReferenceOutputAssembly>

      <CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>

      <LinkLibraryDependencies>false</LinkLibraryDependencies>

      <UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>

    </ProjectReference>

    <ProjectReference Include="..\Project C\Project C.vcxproj">

      <Project>{687d125d-f004-4901-8654-725f65c93528}</Project>

    </ProjectReference>

</ItemGroup>

 

This results in the following command-line for Project A:

 

Similarly for Project D:

 

 

It looks like the following in Project D.vcxproj:

  <ItemGroup>

    <ProjectReference Include="..\Project B\Project B.vcxproj">

      <Project>{fcefddd7-fc28-490a-a937-ee8ce39c43d7}</Project>

    </ProjectReference>

    <ProjectReference Include="..\Project C\Project C.vcxproj">

      <Project>{687d125d-f004-4901-8654-725f65c93528}</Project>

    </ProjectReference>

  </ItemGroup>

 

This results in the following command-line for Project D:

 

 

 

Thanks,

Amit Mohindra

Ways to give feedback on Silverlight

Posted: 03 May 2010 10:58 AM PDT

There are a few ways to give feedback on Silverlight . I wanted to share my thoughts on them as some are obvious and some aren't. First and foremost, the team is currently (Apr-May 2010) conducting a public survey on the next version planning. We've put...( read more )...(read more)

New Silverlight 4 Themes available–get the raw bits

Posted: 03 May 2010 10:24 AM PDT

A while back I posted a sneak peek preview of 3 new themes that we were working on for Silverlight 4 applications. Our team wanted to do more than just the overall base theme and provide the themes for the core, SDK and some Silverlight Toolkit controls...( read more )...(read more)

New Silverlight 4 Themes available–get the raw bits

Posted: 03 May 2010 10:24 AM PDT

A while back I posted a sneak peek preview of 3 new themes that we were working on for Silverlight 4 applications. Our team wanted to do more than just the overall base theme and provide the themes for the core, SDK and some Silverlight Toolkit controls Read More......(read more)

Silverlight Tip of the Day #10 – Converting Client IP to Geographical Location

Posted: 03 May 2010 09:34 AM PDT

In Tip of the Day #9 I showed you how you can obtain your clients IP addresses through either server side script or a simple web service call. In this tip I will show you how to take that IP address to determine the geographical location of the user that...( read more )...(read more)

Windows Client Developer Roundup for 5/3/2010

Posted: 02 May 2010 09:38 PM PDT

This is Windows Client Developer roundup #22. The Windows Client Developer Roundup aggregates information of interest to Windows Client Developers, including WPF , Surface, Windows 7, XNA, Windows Forms , Silverlight , Windows Phone and Visual Studio...( read more )...(read more)

The fastest way to resize images from ASP.NET. And it’s (more) supported-ish.

Posted: 03 May 2010 01:29 AM PDT

I've shown before how to resize images using GDI , which is fairly common but is explicitly unsupported because we know of very real problems that this can cause. Still, many sites still use that method because those problems are fairly rare, and because most people assume it's the only way to get the job done. Plus, it works in medium trust. More recently, I've shown how you can use WPF APIs to do the same thing and get JPEG thumbnails , only 2.5 times faster than GDI (even now that GDI really ultimately uses WIC to read and write images). The boost in performance is great, but it comes at a cost, that you may or may not care about: it won't work in medium trust. It's also just as unsupported as the GDI option. What I want to show today is...(read more)

Silverlight Cream for May 02, 2010 -- #854

Posted: 02 May 2010 09:58 PM PDT

In this Issue: Michael Washington , Jason Young ( -2- , -3- ), Phil Middlemiss , Jeremy Likness , Victor Gaudioso , Kunal Chowdhury , Antoni Dol , and Jacek Ciereszko ( -2- ). Shoutout: Victor Gaudioso has aggregated All of My Silverlight Video Tutorials...( read more )...(read more)

Windows Client Developer Roundup for 5/3/2010

Posted: 02 May 2010 09:38 PM PDT

This is Windows Client Developer roundup #22. The Windows Client Developer Roundup aggregates information of interest to Windows Client Developers, including WPF , Surface, Windows 7, XNA, Windows Forms , Silverlight , Windows Phone and Visual Studio...( read more )...(read more)

Xml Document Transforms (XDT) for any XML file in your project

Posted: 02 May 2010 10:09 PM PDT

There have been several requests floating around to be able to use XDTs (the technology behind Web.Debug.Config/Web.Release.Config) with other XML files within the project…  To make that feasible I wrote a XmlDocumentTransform.targets   file which can generically transform any XML file using the standard Web.Config Transformation syntax introduced with VS 2010… Learn more about XDT & Web.Config Transformation here… Now to get started first download XmlDocumentTransform.targets file from my Skydive… Follow the below simple steps to get transformation working for any well formed XML file in your project… Step 1: Save the downloaded XmlDocumentTransform.targets to %ProgramFiles%\MSBuild\Microsoft\VisualStudio\v10.0\Web\XmlDocumentTransform...(read more)

Free WebCamps - North America, Asia and Europe - *Sign Up Now*

Posted: 02 May 2010 02:31 PM PDT

A few days ago on Twitter @ red7_liu tweeted: 微软的Web Camps大会要来中国了,大牛Scott Hanselman会来. This part "大牛" as I understand, effectively means "Big Cow." "Microsoft Web Camps Conference is coming to China, Big Cow Scott Hanselman will come." If that's not a good enough reason to go to Microsoft WebCamps , then what is? ;) This isn't a conference, it's a camp, like a classroom. Here's the schedule . Day 1: Learning: Web Platform from the ground up Day 2: Hack day, labs and building apps in teams First day we learn, second day we code. What are Web Camps?   Web Camps are free, two-day events that allow attendees to learn and build on the Microsoft Web Platform. At camp, they will hear from Microsoft...(read more)

Sunday, May 2, 2010

Silverlight Cream for May 01, 2010 -- #853

Silverlight Cream for May 01, 2010 -- #853


Silverlight Cream for May 01, 2010 -- #853

Posted: 01 May 2010 09:58 PM PDT

In this Issue: Damian Schenkelman , Rob Eisenberg , Sergey Barskiy , Victor Gaudioso , CorrinaB , Mike Snow , and Adam Kinney . From SilverlightCream.com : Prism's future: Trying to summarize things Damian Schenkelman collected links to the latest Prism...( read more )...(read more)

Saturday, May 1, 2010

MVVM Study - Interlude

MVVM Study - Interlude


MVVM Study - Interlude

Posted: 01 May 2010 09:34 AM PDT

There's a whole lot of talk these days about MVVM. It's the "hep" thing and everyone wants in. There isn't a single day lately where someone doesn't post about this topic (and I read their post..I've tried really...( read more )...(read more)

MVVM Study - Interlude

Posted: 01 May 2010 09:34 AM PDT

There's a whole lot of talk these days about MVVM. It's the "hep" thing and everyone wants in. There isn't a single day lately where someone doesn't post about this topic (and I read their post..I've tried really...( read more )...(read more)

Is the Future of the Web HTML5

Posted: 30 Apr 2010 10:23 PM PDT

Apparently this week it is…Glad everyone ( Microsoft , Google , Apple ) got on the same page this week that HTML 5 is the future of the Web. I will even go as far as agreeing also. Keep reading because I'm not saying Flash, Silverlight or...( read more )...(read more)

Crappy Image Resizing in WPF? Try RenderOptions.BitmapScalingMode

Posted: 30 Apr 2010 11:30 PM PDT

A WPF enthusiast on twitter is building an application. They noticed that the images they were using looked like crap in the toolbar. We checked, and it wasn't an issue of SnapToDevicePixels or UseLayoutRounding. Nope, this was something else. So I asked...( read more )...(read more)

Quick Tip: Enable Telnet under Windows 7

Posted: 30 Apr 2010 10:37 PM PDT

Telnet can be a nice easy way to debug DNS and see the raw result of a web request. There are lots of other tools that do this, but I keep returning to Telnet; maybe because at one point in my career, Telnet was the internet. Enabling Telnet Open the...( read more )...(read more)

The Next Six Months

Posted: 30 Apr 2010 02:00 PM PDT

Enough is going on that I thought I'd lay out my plans for the next six months, especially as a few of these items involve community contributions. My principal focus from now until the end of 2010 will be: Silverlight On Ramp Windows Phone 7 Silverlight...( read more )...(read more)

Is the Future of the Web is HTML5

Posted: 30 Apr 2010 10:23 PM PDT

Apparently this week it is…Glad everyone ( Microsoft , Google , Apple ) got on the same page this week that HTML 5 is the future of the Web. I will even go as far as agreeing also.  Keep reading because I'm not saying Flash, Silverlight or other...( read more )...(read more)

Silverlight Cream for April 30, 2010 -- #852

Posted: 30 Apr 2010 09:44 PM PDT

In this Issue: Michael Washington , Tim Greenfield , Jaime Rodriguez , and The WP7 Team . Shoutouts: Mike Taulty has a pretty complete set of links up for information about VS2010, Silverlight, Blend, Phone 7 Upgrade Christian Schormann announced Blend...( read more )...(read more)

Workaround for StackOverflowException when using SlSvcUtil.exe

Posted: 30 Apr 2010 04:40 PM PDT

Some developers reported to us they were experiencing StackOverflowException when using SlSvcUtil.exe that shipped with the SL4 SDK. Upon investigation, we discovered that this happens on machines with a system language set to something else then English...( read more )...(read more)

Silverlight Designer Support in VS 2010

Posted: 30 Apr 2010 03:47 PM PDT

Visual Studio 2010 is a huge release in terms of designer support for Silverlight and WPF. You can now drag Silverlight controls from the Toolbox to the design surface. You can resize and position controls on the design surface, set their properties and...( read more )...(read more)

General Performance Improvements in VS2010 since Beta2

Posted: 30 Apr 2010 03:14 PM PDT

When we released Beta2 in Oct 2009, there was a lot of customer excitement about the super cool features in VS 2010. However, one recurring complaint from customers was that the performance of VS 2010 was not on par with Orcas. Customers were experiencing general slowness in a lot of features that was hindering them with daily operations. We heard you all loud and clear. Since then our team has put in a lot of hard work to deliver a first class experience in Web Developement and have fixed a lot of performance issues seen in Beta2. The most notable ones are 1. Switching to Desiger from Editor 2. General Designer performance 3. Loading Toolbox 4. Command line msbuild 5. Build and Rebuild within IDE 6. Adding events by double-clicking controls...(read more)

Expression Blend 4 for Windows Phone in 90 seconds

Posted: 30 Apr 2010 04:13 PM PDT

  A refreshed Windows Phone Developer Tools CTP has been released this week which provides compatibility with Visual Studio 2010.  Matching the new tools, we've also released a new version of the Expression Blend Add-In for Windows Phone. What...( read more )...(read more)

AudioOrchard: Awesome Silverlight app, Interview with Eric Herbrandson

Posted: 30 Apr 2010 03:13 PM PDT

I'm not a musician, but I've always loved tinkering with synthesizers, sequencers and drum machines. I worked at a music store in high school, so I got to play with all the new toys. Since then, I've bought myself a new synth-related toy every once in...( read more )...(read more)

Silverlight Tip of the Day #9 – Obtaining Your clients IP Address

Posted: 29 Apr 2010 04:04 PM PDT

This tip shows you how to obtain your client's IP address when using Silverlight. Unfortunately there is no way to accomplish this directly from Silverlight. It is also not supported via JScript so communicating between Silverlight and JScript will also...( read more )...(read more)

AudioOrchard: Awesome Silverlight app, Interview with Eric Herbrandson

Posted: 30 Apr 2010 03:13 PM PDT

I'm not a musician, but I've always loved tinkering with synthesizers, sequencers and drum machines. I worked at a music store in high school, so I got to play with all the new toys. Since then, I've bought myself a new synth-related toy every once in...( read more )...(read more)

MFC Class Wizard (Visual C++ 2010)

Posted: 30 Apr 2010 03:55 PM PDT

Visual C++ 2010 brings back the well-regarded MFC Class Wizard tool. The MFC Class Wizard is a convenient way to add classes, messages, and variables to a project without having to manually modify sets of source files.

AudioOrchard: Awesome Silverlight app, Interview with Eric Herbrandson

Posted: 30 Apr 2010 03:13 PM PDT

I'm not a musician, but I've always loved tinkering with synthesizers, sequencers and drum machines. I worked at a music store in high school, so I got to play with all the new toys. Since then, I've bought myself a new synth-related toy every once in a while. Music composition and tracker tools on the web have always been interesting to me. There have been a few different Silverlight drum machine/sequencer projects over the years, plus my own Silverlight Synthesizer project . This one, however, is a cut above the rest. It's far more than just a sequencer, it's a musician's collaboration tool, and it's written in a combination of Silverlight, MVC, jQuery and more. Have you seen AudioOrchard? AudioOrchard is awesome...(read more)