Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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.
share|improve this question
add comment

3 Answers

up vote 3 down vote accepted

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.

share|improve this answer
    
we did exactly this. I'm pursing a lead that these files are not being downloaded by cc.net on build. –  MedicineMan Apr 25 '11 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 –  MedicineMan May 2 '11 at 20:27
add comment

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.

share|improve this answer
add comment

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.

share|improve this answer
1  
I would think so too, but our dev machines do not have sharepoint installed, and they seem to build this just fine. –  MedicineMan Apr 25 '11 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. –  Toni Frankola Apr 25 '11 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 Apr 26 '11 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. –  Toni Frankola Apr 26 '11 at 7:56
    
SharePoint dlls are installed with Visual Studio 2010, because it includes SharePoint Developer Tools. –  Andrey Markeev Apr 26 '11 at 10:12
show 5 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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