Separate assembly for UI/Markup. Can't see MCML load errors

Last post 02-10-2010 12:55 AM by AndyC. 22 replies.
Page 2 of 2 (23 items) < Previous 1 2
Sort Posts: Previous Next
  • 02-04-2010 11:06 PM In reply to

    • MSBob
    • Top 200 Contributor
    • Joined on 12-02-2004
    • Member

    Re: Separate assembly for UI/Markup. Can't see MCML load errors

    Sorry you couldn't get it to work. Just in case you want to torture yourself further below is the markup I used to validate this ("Library" is from OML).

    Personally I don't find any value in separating the markup out of the addin but I probably don't understand where you are going with the architecture. The closest thing I do is some crazy cuss where I dynamically parse fonts, colors and images out of ehres and generate my own markup. This enables me to adhere to a user's theme if they hacked ehres. Over the top pointless I know-but I like consistency. Regardless, MCML development can really be a real cluster-cuss.

    <UI Name="test">
    <Content>
          <Panel>
            <Layout>
              <FlowLayout Orientation="Horizontal" ItemAlignment="Center" Spacing="20,20" />
            </Layout>
           
            <Children>


              <ColorFill Content="Red" MinimumSize="50,50" Padding="20,20,20,20"  />
              <ColorFill Content="Orange" MinimumSize="50,50" />
              <ColorFill Content="Yellow" Layout="HorizontalFlow">
                <Children>
                  <Text Content="ColorFills!" />
                </Children>
              </ColorFill>
              <ColorFill Content="Blue" MinimumSize="50,50" />
              <ColorFill Content="Green" MinimumSize="50,50" Padding="20,20,20,20" />
    <Graphic Alpha=".15"

    Content="resx://Library,Culture=Neutral,Version=4.0.0.0,PublicKeyToken=74d3b407d6cf16f1/Library.Resources/V3_Controls_Movie_Icon_Default"

    Layout="Fill">
                   
                  </Graphic>
            </Children>
           
          </Panel>
        </Content>
    </UI>

     

  • 02-05-2010 4:40 AM In reply to

    Re: Separate assembly for UI/Markup. Can't see MCML load errors

    ..so after venting last night, I kept searching for possible causes. The link you gave me pointed me in the right direction regarding resource files. After seeing that error message (last post) i tried to setup the .ui project and resource setting for "en-us". This didn't work right but at least I got a different message where it caused tvlibrary and the .ui markup to look for videolibrary.ui.resources.dll. I figured this was not how I wanted to end up doing this because I wanted to share-able UI library and model code not just a pure resources dll.

    Anyways, after unloading and editing the project file then undoing the stuff I did.....crap started working! Earlier in this debacle I had even tried making the resource file public instead of internal. I am not even using a strong name reference in the markup. One thing I did, however, was get rid of the loading page entirely.....I can't say which of these was the problem because I tried a lot of stuff but 'reset' after each trial-and-error run. I do coding for a career but this platform is ....ugh.

    I wanted to separate the UI stuff because I wanted to pull the Dvd Extender code into a separate plug-in and not include in tvlibrary.

    PS. Whatever happened to the playback code/forum/project thingy? Also, is OML dead :-( ?

    EDIT:

    Hmm. It looks like this worked (in addition to the resource accidentally fix?) if I put the dll in ehome as well as GAC-ing. This is still good. At least I know I can have the markup in another dll

     

    EDIT 2:

    Ok, so far, aside from the i-don't-know-what-the-f-happened issue with the resources,  it works if

    (a) I use sn references in every resx:// reference to the UI library including code-behind and markuo

    (b) I just put the [long filthy expletive deleted] assembly in \ehome as well as in GAC.

    I think I am just going to do (b) since it requires the least work. If at some point I scrap the separate UI deal then i don't have to go back and change the references.

    Thanks again, man.

    [vent]

    Sometimes I think MS should have just made Internet TV such that all it's UI was a shared public lib that 3rd parties could reuse (with calls like "ShowDetails() or BuildGallery() ) or something like that then have Internet TV and Netflix just sit on top of this library. Honestly, do we all want to build GUI if we don't know need/want to? Hell no! I'd rather build functionality to add to the core Media Center "experience" and not worry about the banalities of this god-cursed platform.

    I should just start accepting the fact that eHome only cares about live tv and all their resources fall into that.

    [end vent]

  • 02-05-2010 10:18 AM In reply to

    • MSBob
    • Top 200 Contributor
    • Joined on 12-02-2004
    • Member

    Re: Separate assembly for UI/Markup. Can't see MCML load errors

    Heh, you could always take the third route and use ILMerge or maybe get creative with assembly loading.

    Last I checked the eHome team was focused on Pictures/Videos because thats what their usage statistics told them (you know because MC was shoved into Vista and grandma stumbled on a way to view her photos in a slideshow). To be honest I'm really not sure why they have kept the UI internal. I know Charlie was asked several times and he never really gave what I would consider a valid reason. Add-in development has been repeatedly shafted over the years, but I honestly don't think it was on purpose (except for the "more info" security menu in 7MC). If I were to guess though, I would say they have enough on their hands just keeping the core stable.

    Concerning playback I was waiting on Sam to create a site but have been busy with other things to really prod him.

    As far as OML goes, it isn't dead. I'm a UI developer. Unlike most I actually enjoy dealing with MCML's "quirks". After a while I found myself spending way too much time dealing with aspects of the project like SQL and the installer and things began to feel more like work rather than fun. So I have taken a step back and have been focusing on getting the UI where I want it before I'm willing to invest the time into cleaning up these bits. That means things will be quiet until I'm ready.

  • 02-09-2010 12:20 AM In reply to

    • AndyC
    • Top 10 Contributor
    • Joined on 03-29-2004
    • UK
    • Elite Member
    • Media Center MVP

    Re: Separate assembly for UI/Markup. Can't see MCML load errors

    Hi Jack,

    Not sure from the thread if this was explained - the reason for the issue is that Media Center has a concept of "known assemblies" - this is a list that Media Center uses to resolve markup references.  The assembly that you specify with your Launch method (your primary assembly) in is added to the known assemblies list, but no other assembly of yours is.  You need to use the fully qualified strong name in order for Media Center to find your assembly, or you need to put it in the eHome folder (which is checked in addition to the known assemblies list), or you need to merge the second assembly into your primary assembly using ILMerge or Intellilock (or something similar), and deploy a single assembly in your production code.

    Cheers,
    Andrew

    PS The blue screen with no error is a bug in Windows 7 MC.

  • 02-09-2010 7:25 AM In reply to

    • MSBob
    • Top 200 Contributor
    • Joined on 12-02-2004
    • Member

    Re: Separate assembly for UI/Markup. Can't see MCML load errors

    Just noticed that Olcay put together a pretty good workaround for all this.

  • 02-09-2010 7:13 PM In reply to

    Re: Separate assembly for UI/Markup. Can't see MCML load errors

    Andrew,

    Thanks for the info.

  • 02-09-2010 7:14 PM In reply to

    Re: Separate assembly for UI/Markup. Can't see MCML load errors

    Dude. Thanks for that link. It crystallizes my problem perfectly. You were saying the same things pretty much but I was just not getting it :-).

  • 02-10-2010 12:55 AM In reply to

    • AndyC
    • Top 10 Contributor
    • Joined on 03-29-2004
    • UK
    • Elite Member
    • Media Center MVP

    Re: Separate assembly for UI/Markup. Can't see MCML load errors

    Thanks for posting the link to Olcay's blog MSBob - I thought I'd tried that and it hadn't worked, but if it works that definitely helps in making MCML easier to read and port.

    Cheers,
    Andrew

Page 2 of 2 (23 items) < Previous 1 2


Terms of Service | Privacy Statement | Code of Conduct | About