I went to compile the ZeusRestWcfClient solution in Visual Studio 2010. In order to do this, the solution had to be converted and so I told the auto-converter tool to go ahead and do what it needs to do.
Several files, including the .sln (solution) file were marked as read-only though. I ended up marking all files/folders as read-write and the converter does its thing.
However, the first thing I see upon looking at the code are red underlined namespaces. SpokesClient.WcfSpokes is not a namespace and RestDeviceServicesClient, RestEventManagerClient, and DeviceInfo are unknown oddities to the project according to Visual Studio.
Strange. So after a little investigation I discover that setting the Target Framework to .Net Framework 4.0 made the errors go away. So I compile and run the program yet trying to click any of the buttons in the app claim the Spokes server is offline. It was clearly running so I take a look at the exception messages to see.... this:
Well, that's interesting. I wonder if the switch in target frameworks has anything to do with this. Maybe updating the WcfSpokes Service Reference will fix this issue.
I'm presented with this upon an attempt to update:
After taking a break to get some coffee I come back and think perhaps these errors are all stemming from the conversion process. That was the only difference between seeing the program successfully run and failing hard.
And I think I may be right.
I ended up getting the ZeusRestWcfClient sample compiling and running successfully in Visual Studio 2010.
Here's how I made that happen:
- Get a fresh download of the ZeusRestWcfClient code. Don't touch it yet.
- Make a new C# console application project in Visual Studio 2010. Lets call it REST for now.
- Head into the project folder (the folder that contains the REST.sln file) and delete everything except the REST.sln file
- Copy the SpokesClient over to the project folder. You should now see REST.sln and SpokesClient in your project folder.
- Open up the REST.sln file. Right click the solution and Add -> Existing Project...
- Point it to the SpokesClient.csproj
- When the converter tells you it needs to convert the files but some are read-only, choose to "edit in-memory", not "make writable" (I havent tested make writable but edit in-memory works for me).
- Once the converter is finished you should be able to compile immediately and see a successfully running program with no further edits.
It's interesting to note that the Target Framework after doing this method remains as .Net Framework 3.5 - not 4.0 as I had tried to resolve the errors originally.
I'll redo the process and mark files as writable when prompted by the converter. While writing this a thought had occurred to me that perhaps the errors were caused by making ALL files and folders within the project folder as read-write? Another thing to test.