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 need to use DocumentFormat.OpenXml.dll in my code. In the solution package, I included this external dll in the Additional Assemblies. It looks like this:

enter image description here

I also need to reference it, so that I can use its classes in the code. So I added a reference to the same file. But now, when I want to deploy my solution it shoots error with the message:

"SharePointProject" and "SharePointProject" contain a file that deploys to the same Package location: DocumentFormat.OpenXml.dll

I guess the problem is that I haven't referenced the dll from additional package assemblies list, but directly from the file, though I could be wrong here.

How do I make sure that the external assembly DocumentFormat.OpenXml.dll gets deployed with the solution and I can use its classes in my code? Thanks!

share|improve this question
    
I removed the reference from project (not package) and commented the code which uses its classes, just to test the deployment without it. I still get the same error, which means that the edit in the additional assemblies for package are causing it. Any clues? Thanks! –  Boris Dec 27 '12 at 13:42
    
Have you copied or changed the location of any item in your solution? –  user3470 Dec 27 '12 at 13:53
    
No, I am aware of that issue. If I remove the additional assembly from package, the solution deploys just fine. This leads me to a conclusion that the issue is related to adding external assemblies to the package. –  Boris Dec 27 '12 at 14:06
    
Ensure 'Copy Local' is set to false in your assembly's reference. –  James Love Dec 27 '12 at 14:07
add comment

1 Answer

Your problem may be related to incorrect locations of SharePoint Project Items (SPI). After you add your assembly click on Show All Files in the Solution Explorer in Visual Studio and locate the SharePointProjectItem.spdata file. Open it and make sure that the Target attribute of all the ProjectItemFileSource elements points to the correct location.

share|improve this answer
add comment

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.