Search

WindowsStore XamlParseException after VS2012 Update 1 by notacat

Closed
as Fixed Help for as Fixed

10
0
Sign in
to vote
Type: Bug
ID: 773691
Opened: 12/6/2012 9:35:11 AM
Access Restriction: Public
1
Workaround(s)
4
User(s) can reproduce this bug
after installing VS2012 Update 1, VS generates incorrect code in the InitializeComponent method for xaml page. It creates page Uri using page namespace instead of assembly name. That causes runtime XamlParseException at attempt to load such page.
It worked before Update 1 installation and it breaks our already published samples.
We can try to workaround this issue by renaming namespaces in all samples. But customers, who already downloaded our samples, will still have this issue after installing Update 1 for VS 2012.
We consider that as a showstopper issue.
Please, fix it ASAP.
Details (expand)

Visual Studio/Team Foundation Server/.NET Framework Tooling Version

Visual Studio 2012

Steps to reproduce

Build and run attached sample and click "load sample page" button.
You'll get XamlParseException in the BlankPage1 ctor.
Look at code comments in this method. They explain the problem.

Product Language

English

Operating System

Windows 8

Operating System Language

English

Actual results

VS generates page Uri using namespace instead of assembly name, so you get runtime
XamlParseException.
The generated code looks like this:
global::Windows.UI.Xaml.Application.LoadComponent(this, new global::System.Uri("ms-appx:///DefaultNamespace/BlankPage1.xaml"), global::Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Nested);

Expected results

The generated code should use assembly name in the page Uri:
global::Windows.UI.Xaml.Application.LoadComponent(this, new global::System.Uri("ms-appx:///ClassLibrary1/BlankPage1.xaml"), global::Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Nested);
File Attachments
File Name Submitted By Submitted On File Size  
VS2012Update1Bug.zip 12/6/2012 26 KB
Sign in to post a comment.
Posted by Microsoft on 1/13/2013 at 9:37 PM
Thanks for your feedback. We have addressed this issue for Visual Studio 2012 Update 2.
Posted by Microsoft on 12/7/2012 at 1:50 PM
Not at this time.
Posted by notacat on 12/7/2012 at 1:15 PM
thanks for targets file, it fixes the problem for me.
Can you share any ETA for Update 2?
Posted by Microsoft on 12/6/2012 at 2:00 PM
Please reach out to me at harikm@microsoft.com or Jeffrey Ferman and we can provide a sample targets file that fixes this issue
Posted by Microsoft on 12/6/2012 at 1:09 PM
This is fixed. It will be shipped as a part of VS Update 2.
Posted by Microsoft on 12/6/2012 at 9:51 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.
Posted by VincentH_Macaw on 1/14/2013 at 6:16 AM
The error occurs when the assembly name differs from the default namespace in the project properties. The code that VS generates for InitializeComponent() uses the project default namespace where it should use the project assembly name.

The workaround is to make the assembly name and the default namespace identical in the project properties.
Works fine regardless of whether or not this contains a dot.