views:

142

answers:

3

Hi all, I recently downloaded the Windows API code pack for .net, and seeing there was VB.net examples inside there, I opened them up. Upon building I get a warning that the referenced components 'Core' and 'Shell' could not be found. Looking in the code pack folder I see there are no DLLs at all, but instead a whole load of C# sources.

Do I have to download C# Express (which I want to avoid) to use the code pack or are there precompiled DLLs somewhere?

A: 

This is nothing to do with the C# sources, the code pack is supposed to have both C# and VB.Net samples.

System.Core is one of the .Net framework dlls, so if your Visual Studio have problems finding it it sounds like you might have a problem with your .Net installation. Maybe try reinstalling Visual Studio 2010 and/or the .Net framework 4.0 and see if that helps.

ho1
Josh
Ah, you're opening the wrong solution files it seems like then. .csproj is the project files for C# projects. For VB.Net the project file extension should be vbproj.
ho1
That's what I first though, but I checked and checked and I was definitely opening a .vbproj. I think the vbproj is trying to load the C# projects, seems the code pack itself (which needs to be built from source) is written in C#.
Josh
A: 

One thing that might cause the problem, your VB.net examples were not created in VS 2010 Express, and so those errors appeared when it were opened in VS 2010 Express.

As ho suggested, try reinstalling .NET framework and/or VS 2010.

Another possible solution is to build the project under 'Release' configuration instead of 'Debug'.

manuel
+1  A: 

Yes, this is a problem if you use Express. While it has lots of sample VB.NET code that demonstrates usage, the implementation is done in C# and there is no pre-built version of the assemblies available from the download site. They have to built first before you can try the samples.

To get them built, you would have to run this command from the "Visual Studio Command Prompt":

cd \whereYouInstalledIt\WindowsAPICodePack\WindowsAPICodePack
msbuild WindowsAPICodePack.sln

But I don't think the Express edition installs the "Visual Studio Command Prompt" shortcut in Programs either. Well, another good reason to upgrade to the RTM license.

Hans Passant
You were right, VB.net Express 2010 doesn't have that "Visual Studio Command Prompt", but luckily VB.net Express 2008 does. I entered the command and it successfully built the modules, so I added references to them in the project and it seems to be working alright now.Thanks to all who helped.
Josh