SPNote

SharePoint Notes

SharePoint 2010 Microsoft.SharePoint.Publishing.dll 사용시 Error

안녕하세요? Will입니다.

이번에는 제가 Navigation의 기능을 쓰기 위해 Microsoft.SharePoint.Publishing.dll 을 사용 했는데 빌드 시 Error가 나타나서 해당 Error에 대한

해결 방안을 쓰도록 하겠습니다.  해당 dll이 존재 하지 않는 다는 황당한 문구의 Error입니다. 분명히 참조를 시켜놧는데요.....

Error 내용 : The type or namespace name 'Publishing' does not exist in the namespace 'Microsoft.SharePoint' (are you missing an assembly reference?) 

Warrings 에서 보니깐 해당 dll은 System.Web.DataVisualization 이라는 dll 의 어느 Class를 사용 해서 Error가 난듯 합니다.

Warrings : The primary reference "Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL" could not be resolved because it has an indirect dependency on the framework assembly "System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v3.5". To resolve this problem, either remove the reference "Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL" or retarget your application to a framework version which contains "System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35". 

그래서 해당 Dll을 검색 하여서 찾으니 아래의 폴더에 있군요. C:\Program Files (x86)\Microsoft Chart Controls\Assemblies\System.Web.DataVisualization.dll

드라이브는 설치에 따라서 틀립니다. 해당 dll 을 참조 해주고 다시 빌드를 하니 에러가 사라지며 잘 사용 되네요.

그리고 옛날에 Silverlight.dll 사용시에도 에러가 낫엇는데 해당 dll을 참조 하면은 Error 가 사라집니다.

Add comment

Loading