none
How do I specify a custum Microsoft.Dss.Core.DefaultTargetXsltPath Value?

    Întrebare

  • When I found this piece of documentation:

    http://msdn.microsoft.com/en-us/library/cc998464.aspx

    I thought, 'great, I can easily customize the DSS Node Homepage'. So, I created the following *super* simple custom .xslt file :

    <?xml version="1.0" encoding="UTF-8" ?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:template match="/">
        <html>
          <body>
            <h2>My Custom Homepage for DSSHost</h2>
          </body>
        </html>
      </xsl:template>
    </xsl:stylesheet>
    

    then I added this file as an Embeded Resource in my project and used the [EmbededResource] attribute in my service class. Finally, I added this

    <add key="Microsoft.Dss.Core.DefaultTargetXsltPath" value="/resources/MyService/MyService.Resources.MainPage.xslt"/>
    

    to the appSettings section of my appConfig.

    Alase, when I started the node and went to http://localhost:20000 all I got was the usual, defualt DSS Node Homepage with all the runninger services listed instead of my simple, custom html.

    When I go to http://localhost:20000/resources I can browse to my .xslt file which means DSS can see the resource, so why isn't it using it?

    I have cleared my browser cache so I don't think it is simply getting a cached file.

    Does the resource need to be in a special location relative to the DSSHost or something like that? Do I need to attribute the class that uses [EmbededResource] with something? Is there any way to get debug information from DSS about what it's doing?

    I am using a custom host. Is there something special I need to do in my host to get this to work properly?

    The documentation makes it look so simple. Why can't I figure this out?

    1 martie 2012 22:43

Răspunsuri

  • Off-hand, I don't personally know how a 3rd party developer would do this easily, if at all.  I do know that it wasn't intentionally designed to support this request.  I'll poke around at the office to see if someone can provide a clearer, more definitive answer.

    The property you reference is only for non-core dll's.  Core-dll's have their resources embedded when they are compiled.  This is for security purposes.

    6 martie 2012 07:14
    Moderator

Toate mesajele

  • As a sanity check, I've gone all the way back to Service Tutorial 1. I have added the super simple XSLT file (where the file name = dummy.xslt) shown above to the service project as a resource and marked its build action as EmbededResource. I then added the following two lines of code at the very top of the service class:

    [EmbeddedResource("dummy.xslt")]
    string _dummy;

    and changed the App.config file to look like this:

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <appSettings>
        <!-- XSLT to use for the default target -->
        <add key="Microsoft.Dss.Core.DefaultTargetXsltPath" value="/resources/User.ServiceTutorial1.Y2006.M06/RoboticsServiceTutorial1.Resources.dummy.xslt"/>
      </appSettings>
    </configuration>

    Still, the DSS Node Homepage did not change.

    I hope this simple experiment makes this problem easy for everyone to re-produce.

    Am I missing something here? Am I changing the wrong App.config file?

    Please help.

    5 martie 2012 18:53
  • Off-hand, I don't personally know how a 3rd party developer would do this easily, if at all.  I do know that it wasn't intentionally designed to support this request.  I'll poke around at the office to see if someone can provide a clearer, more definitive answer.

    The property you reference is only for non-core dll's.  Core-dll's have their resources embedded when they are compiled.  This is for security purposes.

    6 martie 2012 07:14
    Moderator
  • Thanks Luke

    The documentation for the referenced property (Microsoft.Dss.Core.DefaultTargetXsltPath) explicitly states, "To set the XSLT for the HOME PAGE, and all other pages not associated with any DSS service . . ." If that documentation is not correct then who do I need to contact to get it clarified and corrected on this page

    http://msdn.microsoft.com/en-us/library/cc998464.aspx ?

    Also, you made a distinction bewteen core and non-core dll's. Where can I find more inforamation about what is considered a core dll?

    6 martie 2012 17:06
  • "core vs. non-core" dll's would merely be the difference betwen dll's we provide you a copy of the source for (user services) and the core components of CCR/DSS.  As such, the documentation is correct in stating you can modify the xslt for the home page for the user services, not to my knowledge the core components of CCR/DSS.
    9 martie 2012 17:57
    Moderator
  • Have you tried modifying the dsshost.exe.config (or dsshost32.exe.config)?  That seems like the logical place to change the DSS node's home page.

    14 martie 2012 21:56
    Proprietar
  • Gershon Parent, that sounds like a new, interesting idea.

    I am using a custom host and after exploring the API for a while I did not see a place to change such a setting. Will you please elaborate further on your response.

    Thank you

    19 martie 2012 18:07
  • In the "bin" directory under the root of your RDS install are dsshost.exe and dsshost32.exe.  They each have their own config files; dsshost.exe.config and dsshost32.exe.config respectively.
    I suggest adding the same key described above to the appSettings section of the config file of the dsshost you are using (or both). 

    19 martie 2012 18:14
    Proprietar
  • are you sating you have done that and it has worked, or that it is something worth trying? I can't seem to get it to work.
    19 martie 2012 19:27
  • Only that that is where I would attempt to modify the home page's behavior.  I have not tried it myslef.

    I don't see any reason that modyfying a service's configuration would modify the home-page, so I think the documentation is wrong.

    Is this the same question as http://social.msdn.microsoft.com/Forums/en-US/roboticsdss/thread/5afa6f97-f43c-472d-8747-85fdf0918b55 or something different?

    22 martie 2012 00:28
    Proprietar