Adventures in MS Robotics Studio

Saturday, July 26, 2008

July MSRDS CTP Causes errors for the latest Amazing Challenge

Error 1 The type 'Microsoft.Ccr.Core.PortSet`5<t0,t1,t2,t3,t4>' is defined in an assembly that is not referenced. You must add a reference to assembly 'Ccr.Core, Version=2.0.730.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. C:\Users\astrobleme\Microsoft Robotics Dev Studio 2008\RoboChamps\AmazingChallenge\AmazingChallengeEntry\AmazingChallengeEntry.cs 49 39 AmazingChallengeEntry

Error 2 The type 'Microsoft.Ccr.Core.PortSet`6<t0,t1,t2,t3,t4,t5>' is defined in an assembly that is not referenced. You must add a reference to assembly 'Ccr.Core, Version=2.0.730.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. C:\Users\astrobleme\Microsoft Robotics Dev Studio 2008\RoboChamps\AmazingChallenge\AmazingChallengeEntry\AmazingChallengeEntry.cs 73 51 AmazingChallengeEntry

Error 3 The type 'Microsoft.Dss.ServiceModel.Dssp.Update`2<t0,t1>' is defined in an assembly that is not referenced. You must add a reference to assembly 'DssBase, Version=2.0.730.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. C:\Users\astrobleme\Microsoft Robotics Dev Studio 2008\RoboChamps\AmazingChallenge\AmazingChallengeEntry\AmazingChallengeEntry.cs 173 28 AmazingChallengeEntry

Friday, July 25, 2008

Run-time errors

I guess my biggest complaint so far is that the MSRDS developers have tried too hard to make life easy on you. For instance, to start a new MSRS project in Visual Studio, you first create the solution using the following command:

dssnewservice /service:{project_name}
which builds the solution with all the bell and whistles you need to get started. Why didn't they make a Visual Studio Project Template??? It turns out that the problems that I had with my first project were do to the DssProxy Generator failing. The project would build and sometimes not throw an error when dssproxy.exe exited without doing it's thing.

Eventually, I ran the proxy by hand and figured out the problem with my code [Hint: running it by hand gives you nifty text output. The error thrown by visual studio had a numeric error.].

For future reference, the error looks like this:


*   Service started [07/24/2008 23:18:20][http://timpc2:50000/directory]
* Service started [07/24/2008 23:18:20][http://timpc2:50000/constructor/dc442a82-6f1e-46f0-a88f-3df0c58dd20e]
* Service started [07/24/2008 23:18:20][http://timpc2:50000/console/output]
* Starting manifest load: file:///C:/Documents and Settings/tmcqueen/Microsoft Robotics Dev Studio 2008/samples/msrstest3/msrste
st3.manifest.xml [07/24/2008 23:18:20][http://timpc2:50000/manifestloaderclient]
Rebuilding contract directory cache. This will take a few moments ...
Contract directory cache refresh complete
** Error creating service. Service type:http://schemas.tempuri.org/2008/07/msrstest3.html [07/24/2008 23:18:25][http://timpc2:500
00/constructor/dc442a82-6f1e-46f0-a88f-3df0c58dd20e]
*** Manifest Loader: Creating service failed: http://schemas.tempuri.org/2008/07/msrstest3.html.
Reason: Service not found: http://schemas.tempuri.org/2008/07/msrstest3.html System.InvalidOperationException: Service not foun
d: http://schemas.tempuri.org/2008/07/msrstest3.html
at Microsoft.Dss.Services.Serializer.DataCache.LoadServiceAssemblies(ServiceInfoType createRequest)
at Microsoft.Dss.Services.Constructor.ConstructorService.CommonCreateHandler(DsspOperation create)
[07/24/2008 23:18:25][http://timpc2:50000/manifestloader/eb7c8b4b-c8ef-44b5-9d48-ebe229331858]
* Manifest load complete [07/24/2008 23:18:25][http://timpc2:50000/manifestloaderclient]
and the output of DSSPROXY.EXE was:

C:\Documents and Settings\astrobleme\Microsoft Robotics Dev Studio 2008\samples\msrstest3>dssproxy /Dll:"obj\Debug\msrstest3.Y2008.M
07.dll"
Reflecting: msrstest3.Y2008.M07
The type MSRSTest3.StopRequest is used as a data contract, or message type, or as a part or base type of a data contract or messag
e type but has no DataContract attribute.

The Class that caused the error looked like this:

    public class StopRequest { }


and adding the directive above the class fixed the issue.

[DataContract]
public class StopRequest { }


Had I known at the time, I would have used DSSINFO.exe to try to figure the error out:


C:\Documents and Settings\astrobleme\Microsoft Robotics Dev Studio 2008\samples\msrstest3\obj\Debug>dssinfo /v:m msrstest3.Y2008.M07
.dll

Reflecting: msrstest3.Y2008.M07.dll
Reflecting: msrstest3.Y2008.M07
Reflection Error: The type MSRSTest3.StopRequest is used as a data contract, or message type, or as a part or base
type of a data contract or message type but has no DataContract attribute.
at Microsoft.Dss.Tools.DssProxy.Loader.DataContractReflector.Reflect()
at Microsoft.Dss.Tools.DssProxy.Loader.ServiceAssemblyTypesReflector.ReflectDataContractCore(Type type, DataContractReference reference)
at Microsoft.Dss.Tools.DssProxy.Loader.ServiceAssemblyTypesReflector.ReflectDataContract(Type type, Boolean reflectAsBaseType)
at Microsoft.Dss.Tools.DssProxy.Loader.ServiceAssemblyTypesReflector.ReflectDsspOperationContract(Type type)
at Microsoft.Dss.Tools.DssProxy.Loader.ServiceAssemblyTypesReflector.ReflectPortSetContractAsServicePort(PortSetReflector reflector)
at Microsoft.Dss.Tools.DssProxy.Loader.ServiceAssemblyReflector.CheckTypes()
at Microsoft.Dss.Tools.DssProxy.Loader.ServiceAssemblyReflector.Reflect()
at Microsoft.Dss.Tools.DssProxy.ContractModelLoader.Load()
at Microsoft.Dss.Tools.DssInfo.ServiceInfo.Run()

META

This blog is an attempt to document my ah-ha moments in Microsoft Robotics Studio. Please realize that I am not an expert.