Showing posts with label DLL. Show all posts
Showing posts with label DLL. Show all posts

Friday, March 2, 2018

How to fix "Could not load file or assembly or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)" error in web publish deployment in Windows 8?

I had to make a deployment on the new branch which was branching from the original project. it is working fine that i published the web to the server in the original branch. However i encountered an error

"SGEN : error : Could not load file or assembly 'file:///C:\Users\ddeng\Documents\\bin\HiQPdf.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)"



 When i check the folder, the HiQPdf.dll file did exist in the folder. the root cause of this error is that those third party DLL had been locked by Windows 8 due to security concern.

we have to unlock it to allow the publish action to move the dll to the destination folder.

please follow the steps to fix the issue.

1. right click to get properties 



2 in the properties there was a button UNBLOCK, click on the Unlock button and applied the change.




try to rebuild again. you will see your publish go through suceessfully.



Wednesday, February 8, 2012

deploy Class (Service) library to GAC automatically

when we do SharePoint development, we might need to deploy some of DLL to GAC, So that SharePoint application can access them.

 here is a very handy script that we can embed in the Post-build Event. the DLL will be automatically deployed to the GAC.

right click on the project and select properties from the popup menu.



clicked on the Edit Post Build Button and Paste the following lines into Post-build Event Command Line Windows.

"%ProgramFiles%\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\gacutil.exe" /i "$(TargetPath)"




then we just press F5 or select build command from the menu bar. we will see this message.

 Assembly successfully added to the cache
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========