VMware {code} Community
Northamm
Contributor
Contributor

VI SDK and MS Visual Studio 2008

Before I go down the road of trying does anyone know if MS Visual Studio 2008 is supported or do I have to stick with MS VS 2005 ?

Thanks

Matt

Tags (1)
0 Kudos
8 Replies
smallweb
Contributor
Contributor

Hi,

VS2008 supports the .Net framework versions 2.0, 3.0 and 3.5, so you can always use VS2008 in stead of VS2005.

Danny

0 Kudos
paul_xtravirt
Expert
Expert

Thats not strictly true. Generating the stubs does not work by default.

You will need to do the following:

  1. Open the visual studio command prompt

  2. Enter the following: set VSINSTALLDIR="C:\All My Apps\Microsoft Visual Studio 9"

  3. Copy the two WSDL files that you want to use (either 2.5 or 2.0) to the vi-sdk-2.5.0-64154\SDK\samples\DotNet folder

  4. In the visual studio command prompt, change directory to the vi-sdk-2.5.0-64154\SDK\samples\DotNet folder

  5. enter the following command: genvimstubs.cmd .\



    If you found this helpful, please consider awarding points

If you found this helpful, please consider awarding some points
0 Kudos
Peteski
Contributor
Contributor

Unfortunately this isn't the whole story. Since the entire VMWare SDK is predicated on VS 2005 (or VS 2005 Express), you need to alter some of the paths in the genvimstubs.cmd file for it to work properly. It's pretty easy, just substitute the attached updated gcmvimstubs2.cmd file and it will work- assuming you have

  1. VC# 2008EE (or VS 2008)

  2. .net framework 3.5

  3. MS SDK 6.1 (if this didn't come with VS you may need to download the platform sdk from MS:

All I've done is put in the full paths to some of the exes like csc.exe, wdsl.exe and sg.exe using the correct ones for VS 2008, .net 3.5 and SDK 6.1.

This will properly generate the stubs but you should follow the directions for the other parts like compiling the dlls to a debug .exe (last step in build2005.cmd): "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\VCSExpress.exe" "C:\**VMWareSDKinstallDir*\SDK\samples\DotNet\cs\Samples2005.sln* /rebuild Debug"

Note1: "samples2005.sln" may need to be opened in VC# 2008 GUI and converted to a VC# 2008 sln file before running this!

Note2: the path given above for "VCSExpress.exe" will be different for those using VS 2008 (devenv.exe (whew!)

0 Kudos
harkamal
Expert
Expert

I recently started using visual studio 2008 and wrote hello world application using c# which is a vi client plugin.

Can someone explain why are the stubs needed for vi development, does this make life easier ? an example would be greatly appreciated.

0 Kudos
admin
Immortal
Immortal

Stubs are used to consume WebService exposed to mange VI. You can perform various tasks to manage your Virtual Infrastrure which you perform using VI Client programmatically consuming the APIs exposed. VI APIs are the only available Management interface for VI.

0 Kudos
ber05
Contributor
Contributor

Super, it works!

..\SDK\samples\DotNet> genvimstubs.cmd C:\Users\ber\SDK\wsdl\vim25 Vim25Api stage Vim25Objects.cs . Vim25Service2005

..\SDK\samples\DotNet> genvimstubs.cmd C:\Users\ber\SDK\wsdl\vim VimApi stage VimObjects.cs . VimService2005

0 Kudos
RobMokkink
Expert
Expert

I was allways looking for a reason to start learning C#. I installed everything, but why would you change the VSINSTALLDIR?

Thanks in advance.

0 Kudos
dmitrif
Enthusiast
Enthusiast

Because not all products get installed on C: etc.

For instance, my primary hard drive for reasons I already forgot is K:

On the topic, I've been using 2008 with VI 3.5 and then 4.0 SDK for a couple of years now, it required some minor trivial modification in batch files that came with the SDK and all works just fine, our application uses .NET 3.5, the SDK assembly is compiled with wsdl from .NET 2.0.

D.
0 Kudos