Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Other Programming > BOOK: Professional Microsoft Robotics Studio ISBN: 978-0-470-14107-6
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional Microsoft Robotics Studio ISBN: 978-0-470-14107-6
This is the forum to discuss the Wrox book Professional Microsoft Robotics Developer Studio by Kyle Johns, Trevor Taylor; ISBN: 9780470141076
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Microsoft Robotics Studio ISBN: 978-0-470-14107-6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old December 9th, 2010, 03:52 PM
Registered User
 
Join Date: Feb 2010
Location: Austin, TX
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Can't Get Ch 3 Example to Create ServiceB.Config.xml

Hello,

I'm trying to run the ServiceB example project from ProMRDS Chapter 3. I'm using Visual Studio 2008 v9.0.21022.8 RTM and .NET 3.5 SP1 on a WinXP Pro SP3 laptop.

I've built my Service A and Service B without any problems, except I can't get it to generate a config file for Service B. Yes, I added the "SaveState(_state);" line to ServiceB.cs. When I run the project in Debugger, the DssHost.exe console shows:

http://i209.photobucket.com/albums/b..._09DEC2010.jpg

The text mentions multiple times, namely pages 129 and 130, that if no path is specified the config file will be created in the same directory as the manifest file. For me, that's:

C:\Documents and Settings\owner\My Documents\Visual Studio 2008\Projects\ServiceB\ServiceB.manifest.xml

I know that's a different path than my "mountpoint":

C:\Documents and Settings\owner\Microsoft Robotics Dev Studio 2008 R3

but if I delete the ServiceB.manifest.xml file in the ServiceB folder above, the project will generate a new one in that same folder (ServiceB folder, not the mountpoint path).

My ServiceB.manifest.xml code looks like:

Code:
<?xml version="1.0" ?>
<Manifest 
    xmlns="http://schemas.microsoft.com/xw/2004/10/manifest.html"
    xmlns:dssp="http://schemas.microsoft.com/xw/2004/10/dssp.html"
    >
    <CreateServiceList>
        <ServiceRecordType>
            <dssp:Contract>http://schemas.us.com/2010/12/serviceb.html</dssp:Contract>
            <dssp:PartnerList>
              <dssp:Partner>
                <dssp:Service>ServiceB.Config.xml</dssp:Service>
                <dssp:Name>StateService</dssp:Name>
              </dssp:Partner>
            </dssp:PartnerList>
        </ServiceRecordType>
    </CreateServiceList>
</Manifest>
which is just adding the extra lines to the default manifest per page 130.

You can see in the screen shot that I added this to the Console's output in ServiceB.cs :

Code:
string sLogDir = LayoutPaths.RootDir + LayoutPaths.LogDir;
Console.WriteLine("Path: " + sLogDir);
It shows basically mountpoint\store\logs. I tried putting a self-created config file and a copy of the manifest there, but it ignored them.

Even though the text and the MRDS examples I found say that you don't need to, I've tried adding different paths to the <dssp:Service>ServiceB.Config.xml</dssp:Service> line in the manifest, such as "file:///C:/..." or just "C:/..." or C:\...", but it always gets the same DssHost.exe error. I tried:

Code:
<dssp:Service>http://localhost/ServiceB.Config.xml</dssp:Service>
and it didn't get the error - but I couldn't find an instance of the config file to modify.

I have no idea why it's not creating my ServiceB.Config.xml file in the same folder as my ServiceB.manifest.xml file or how to make it work.

Thank you,
George

Edit: fixed a typo

Last edited by GeorgeMo; December 10th, 2010 at 01:21 PM.
  #2 (permalink)  
Old December 9th, 2010, 05:03 PM
Registered User
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

The problem is i think, that your project is not in the Robotics studio directory, but in the visual studio directory.
Try create the services inside the Robotics studio directory, then i think it is working.
  #3 (permalink)  
Old December 10th, 2010, 01:32 PM
Registered User
 
Join Date: Feb 2010
Location: Austin, TX
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by bberrevoets View Post
Hi,

The problem is i think, that your project is not in the Robotics studio directory, but in the visual studio directory.
Try create the services inside the Robotics studio directory, then i think it is working.
Thank you for the response. I redid it in the path:

C:\Documents and Settings\owner\Microsoft Robotics Dev Studio 2008 R3\Projects\ServiceB

It then ran without the DssHost error and created a config file, serviceb.config.xml, but it kept "creating" it every time and writing over any changes I made. Until I added the middle line here:

Code:
[ServiceState]
[InitialStatePartner(Optional = true, ServiceUri = "ServiceB.Config.xml")]
ServiceBState _state = new ServiceBState();
On page 129 of ProMRDS it says that you can load from either the [InitialStatePartner] or the manifest, but even after adding the manifest code above (and copy-and-pasted from the example code), I couldn't get it to work without the [InitialStatePartner] line.

Also, I would like to figure out how to force it to create the config.xml file while I'm in a different directory. Unless that's just impossible.
  #4 (permalink)  
Old December 10th, 2010, 05:35 PM
Registered User
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Smile

Hi,

It is working perfectly, because the code you write (if you follow the book) Rewrite the config file everytime the service start.

And yes, you need the InitialStatePartner in the code, if you want to force the path of the config file, leave out the configfile in the manifest. and write something ike the following.

Code:
[InitialStatePartner(Optional = true, ServiceUri = @"Owner\\Config\\ServiceB.config.xml")]
private ServiceBState _state = new SericeBState();
Now the config file will be saved in :
C:\Documents and Settings\owner\Microsoft Robotics Dev Studio 2008 R3\Owner\Config

I hope i was clear because english is not my language
  #5 (permalink)  
Old December 13th, 2010, 01:12 AM
Registered User
 
Join Date: Feb 2010
Location: Austin, TX
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by bberrevoets View Post
Hi,

I hope i was clear because english is not my language
Yes, clear and helpful. Thank you.
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch 9-Sending Email-Encrytping web.config btcomp BOOK: Beginning ASP.NET 4 : in C# and VB 3 August 28th, 2010 04:37 PM
multiple struts-config.xml rajesh_css Struts 1 June 25th, 2009 05:48 AM
XML Config reader V1taminC XML 1 March 11th, 2008 09:11 AM
Folder deletion with XML Config Peroni Beginning VB 6 5 January 16th, 2008 07:11 PM



All times are GMT -4. The time now is 12:10 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.