2

I can build my code locally and on another developer's machine, but cc.net fails to build the project when I check in the code.

I know that I experience a similar issue when I switch between .NET Framework 4 and .NET Framework 4 Client Profile on a console application. .NET Framework 4 is desired for Sharepoint integration, but I've checked the Project settings, and it appears configured to .NET Framework 4. So now I'm at a bit of a loss as to what step to take next.

Here is the line of code that cannot be resolved:

using Microsoft.SharePoint.Client;

Here is cc.net's output

Errors (1):

Repository.cs (15,17): error

CS0234: The type or namespace name 'SharePoint' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)


Warnings (4)

c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets (1360,9): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.SharePoint.Client". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets (1360,9): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.SharePoint.Client.Runtime". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

3 Answers 3

3

You simply need the SharePoint DLLs available to the compiler. The simplest way is to install SharePoint but you can also put the DLLs in the build path or modify the build configuration to pick up the DLLs from a specified folder.

2
  • we did exactly this. I'm pursing a lead that these files are not being downloaded by cc.net on build. Commented Apr 25, 2011 at 21:47
  • the files were not downloaded by cc.net on build, but for many other people who will experience issues like mine will find this solution must helpful to them Commented May 2, 2011 at 20:27
0

I think the issue is that the SharePoint client object model does not support .net 4.0 framework per this article. http://msdn.microsoft.com/en-us/library/ee857094.aspx

Change your target framework to 3.5 and retry, although it is strange that it works on your machine?????

As far as needing to install SharePoint that would only be true if you where using the Server Object model but it appears you are using the client object model so you should be fine.

0

You need SharePoint installed on your build server to make this work, or alternatively to copy SharePoint DLLs to the production server. There is no guide to direct you on how to configure CruiseControl to build SharePoint projects but this guide for TFS 2010 should help you to configure your environment for building SharePoint projects.

10
  • 1
    I would think so too, but our dev machines do not have sharepoint installed, and they seem to build this just fine. Commented Apr 25, 2011 at 21:24
  • You can only build SharePoint projects on a machine with SharePoint installed, what you are doing is not supported and not the best-practice! My guess is someone added SharePoint DLLs to GAC on these machines. My advice: install SharePoint ASAP. Commented Apr 25, 2011 at 21:27
  • Not true Toni - the compiler has to be able to have access to the SharePoint dlls, but these can be in the file system, e.g. under a "Dependencies" folder in your project.
    – Ryan
    Commented Apr 26, 2011 at 7:28
  • I am not saying it want work :)))), but AFAIK this is illegal (you are redistributing SharePoint DLLs!!!) and not recommended practice not event for a build server. Commented Apr 26, 2011 at 7:56
  • SharePoint dlls are installed with Visual Studio 2010, because it includes SharePoint Developer Tools. Commented Apr 26, 2011 at 10:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.