views:

273

answers:

2

Hey all!

For various reasons I have clean installed my dev box and it is running Win7 x64 and currently has VS2010 installed. I am maintaining several projects that require the use of the 1.5 CTP2 release services, under .net 3.5 (obviously). I have already taken the steps needed to install the full 1.5 CTP2 under Win7.

While I understand that the wizard style tooling that normally runs in VS2008 is not available (at least, I think it isn't?) I am hoping that temporarily I can get by with using the command line tools to tide me over till then so I don't need to keep round tripping into the VS2008 VM I keep handy.

I need to do the normal things...

  • Create a service and the web.config entries to enable it

  • Create or update a service reference in a Silverlight project

  • Create or update a service reference in a WPF project

Again, command line is OK - I obviously don't need to do this very often.

Thanks!

Ken

+1  A: 

You need to make sure the System.Data.Services.Design.dll are updated and installed in the gac (if you're on Windows 7):

http://wildermuth.com/2009/05/29/Running_ADO_NET_Data_Services_1_5_CTP1_on_Windows_7

Additionally, when you run visual studio, you need to specify some environment variables to make it work. I do this with a batch file:

set dscodegen_usedsc=1
set dscodegen_version=2.0
call "C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv"

Once you do that, you can continue to to "Add Service Reference" and get the CTP2 proxies.

Shawn Wildermuth
As I am looking for answers regarding VS2010 - do you think the similar workaround (with the right path) would work?Thanks!
Soulhuntre
No way to do 1.5 in 2010. By the end of January a WDS 2.0 SL client library will be available. I'd suggest waiting.
Shawn Wildermuth
A: 

Vitek Karas over on the Microsoft forums suggested the following, however I am left with the horrible "The server encountered an error processing the request. See server logs for more details." error. Which sucks so I have no idea if this will work right.

Hi,

  • Create service and web.config entries. The wizard to add ADO.NET Data Service item into your project should be there. Use that one. Once that is done change the references from System.Data.Services.. to Microsoft.Data.Services... and in your .svc file change the Factory type to that assembly as well (namespaces should remain the same). In your svc.cs file you can change the parameter to InitializeService to DataServiceConfiguration if you want the new features, but the interface generated there should work as well.

  • Create or update service reference. The really interesting part this does is to generate the client side classes for the service. The other stuff is just VS project maintenance which you don't really need to build and run your application. Again you should be able to use the Add Service Reference in the VS to setup the project and references and such (don't forget to change System.Data.Services.. to Microsoft.Data.Services...). The pre CTP code gen should work with the CTP binaries unless you need to use some of the new features. In that case use the command line utility called "datasvcutil.exe". See this article for details: http://msdn.microsoft.com/en-us/library/dd756369.aspx The steps should be very similar for both SL and WPF, the generated code is identical, you just need to add reference to a different Microsoft.Data.Service.Client.dll in your project.

Thanks,

Vitek Karas [MSFT]

Soulhuntre
Ok, my bug was unrelated. Turns out that the ADO.NET services dont like entities that use the "Date" type in SQL Server 2008 :(Anyway, Vitek's answer is correct, and you ALSO of course need to use Shawn Wildermuth's awesome workaround.
Soulhuntre

related questions