locked
RC version

    Question

  • I've just updated windows 8 and visual studio to RC version. Just now i'm thinking whether it's a a joke or something. Where the hell is Windows::UI::Core::InvokedHandler ? InvokeHandlerArgs ? Invoke ? InvokeAsync ? Are you kidding ? I can understand why you will change old API (from pre-windows 8 systems), but changing new API ? 
    Friday, June 01, 2012 8:28 AM

Answers

  • Andrew,

    We investigated this issue and unfortunately this is a bug in XAML Designer. To work-around this, you will need to add the following code in the vcxproj file for the static library. Try following steps:

    1. Unload the static library project in VS

    2. Edit vcxproj file and at the end, just before </Project> tag, add following Target

      <Target Name="PrimaryWinMDOutputGroup" Returns="@(PrimaryWinMDFullPath)">
        <ItemGroup>
          <PrimaryWinMDFullPath Include="$(OutDir)NoWinMDFile.winmd"/>
        </ItemGroup>
      </Target> 

    3. Reload the static library project

    4. Close and Re-open solution

    Designer should now work. Can you please try the steps and confirm the work-around? I have filed a bug on our end to fix this issue for good in next public release of Visual Studio.

    Thanks for helping us in debugging this issue.

    -Navit Saxena

    Friday, June 01, 2012 10:40 PM
  • Petr, please see the sticky post on Migrating from Windows 8 Consumer Preview to the Release Preview for links to documentation on the changes and a blog describing them.

    Invoke and InvokeAsync have been deprecated in favor of RunAsync.

    --Rob

    
    Friday, June 01, 2012 5:31 PM
    Owner

All replies

  • I've just updated windows 8 and visual studio to RC version.

    I saw:

    1) Unhandled exception in XAML designer

    See https://connect.microsoft.com/VisualStudio/feedback/details/745751/xaml-designer-crashes-on-one-project-but-not-another

    2) Crash of VS

    3) Unresponsive Metro desktop:   IE Win+D did not work, Ctrl Alt Del does respond, but I can't Sign out.  I had to power off.

    4) On reboot, I tried to start VS again:


    • Edited by Andrew7Webb Friday, June 01, 2012 4:28 PM Add link
    Friday, June 01, 2012 3:23 PM
  • Andrew,

    Can you please share the stack trace for the unhandled exception you are seeing in the XAML designer? Also, can please tell us if this issue is specific to your project or happens even on creating a Blank C++ App?

    You can get in touch with me at navits at microsoft dot com and I can help you.

    -Navit Saxena

    Friday, June 01, 2012 4:06 PM
  • System.ArgumentNullException

    Value cannot be null.Parameter name: key

       at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.WaitForCompletion(NestedCallContext nestedCallContext, BlockingCall call, WaitHandle timeoutSignal)   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalOut(Action action, Int32 targetApartmentId, WaitHandle aborted, WaitHandle timeoutSignal)   at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalOut[TValue](RemoteHandle`1 targetObject, Action action)   at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalOut[TResult,TValue](RemoteHandle`1 targetObject, Func`2 func)   at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.CreateDesignerImpl(IHostSourceItem item, IHostTextEditor editor, RemoteCancellationToken remoteCancelToken)   at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.Microsoft.Expression.DesignHost.IDesignerService.CreateDesigner(IHostSourceItem item, IHostTextEditor editor, CancellationToken cancelToken)   at Microsoft.Expression.DesignHost.IsolatedDesignerService.IsolatedDesignerView.CreateDesignerViewInfo(CancellationToken cancelToken)


    System.ArgumentNullException

    Value cannot be null.Parameter name: key

    Yes, it is project specific.  I was able to create a new BlankPage project and the XAML designer loaded on that project.

    However, the XAML in the metro project, created also from BlankPage, causes the XAML designer to have the exception.   The main difference is that "metro" is dependent on the "politan" project.  Now "politan" is a static library, with "Metro Style Support"= YES.   It has some functions like:

    POLITAN.H

     
    #pragma once
    
    namespace WUX =  Windows::UI::Xaml;
    
    namespace politan
    {
    
    float sum( float a, float b );
    
    WUX::Media::Brush^ textBrush();
    
    etc

    and

    void stairStep( WUX::Media::PointCollection^ points, int stepSize, int steps );

    This is the first time I tried this approach.

    The "metro" project calls functions from "politan"
     

    oid MainPage::OnNavigatedTo(NavigationEventArgs^ e)
    {
    	(void) e;	// Unused parameter
    	using namespace politan;
    
    	float sumf= sum( 1.1f, 2.4f );
    
    	auto points = ref new Windows::UI::Xaml::Media::PointCollection();
    	stairStep( points, 20, 8 );
    
    }

    1:17 New info:

    If I remove the #include "politan.h" from the pch.h in the "metro" project,  coment out all references to "politan" functions, and remove the reference dependency, then the XAML designer will load for the "metro" project too.


    • Edited by Andrew7Webb Friday, June 01, 2012 5:21 PM new info
    Friday, June 01, 2012 4:42 PM
  • Petr, please see the sticky post on Migrating from Windows 8 Consumer Preview to the Release Preview for links to documentation on the changes and a blog describing them.

    Invoke and InvokeAsync have been deprecated in favor of RunAsync.

    --Rob

    
    Friday, June 01, 2012 5:31 PM
    Owner
  • Andrew,

    Thanks for sharing the project, I can reproduce the issue. We will investigate this issue and get back to you as soon as possible.

    -Navit Saxena

    Friday, June 01, 2012 7:55 PM
  • Andrew,

    We investigated this issue and unfortunately this is a bug in XAML Designer. To work-around this, you will need to add the following code in the vcxproj file for the static library. Try following steps:

    1. Unload the static library project in VS

    2. Edit vcxproj file and at the end, just before </Project> tag, add following Target

      <Target Name="PrimaryWinMDOutputGroup" Returns="@(PrimaryWinMDFullPath)">
        <ItemGroup>
          <PrimaryWinMDFullPath Include="$(OutDir)NoWinMDFile.winmd"/>
        </ItemGroup>
      </Target> 

    3. Reload the static library project

    4. Close and Re-open solution

    Designer should now work. Can you please try the steps and confirm the work-around? I have filed a bug on our end to fix this issue for good in next public release of Visual Studio.

    Thanks for helping us in debugging this issue.

    -Navit Saxena

    Friday, June 01, 2012 10:40 PM
  • Yes, that change to the project file allowed the XAML designer to load.  Thanks for the quick workaround.   I'll continue with this approach.

    Friday, June 01, 2012 11:14 PM