"could not load file or assembly..." with sagepay dotnet integration kit - opayo

I've got the kit project working, but want to integrate it into my own web project. I used "add reference" on the project and located the "SagePay.IntegrationKit.DotNet.dll" file and added it. I was then able to reference the methods of the kit but when I come to build the project, I get:
Error 1743 Could not load file or assembly 'file:///C:\Users\localdev\Documents\Visual Studio 2013\Projects\myTest\myTest.Payment\bin\SagePay.IntegrationKit.DotNet.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
Am I doing this the wrong way? Am I missing something?

Found the solution on another stackoverflow question: 8524423
Just opening the file properties in windows explorer and clicking on 'Unblock this file' should also solve the problem

Related

'DJI.WindowsSDK.DJISDKManager' threw an exception

I recently downloaded the most recent DJI Windows SDK (2.0) in hopes to update my DLLs and be able to move forward with the new SDK. I can build the project but when I try to execute my app, it errors with the following:
'DJI.WindowsSDK.DJISDKManager' threw an exception. - Inner Exception.
FileNotFoundException: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
I've re-pulled the repo, using both Visual Studio 2017 and the 2019 Preview, I then tried the sample SDK and got the same error. I'm currently on Windows Build 17763.292. Is there something I'm missing? Anyone else with similar issues?
Thanks!
First thing to check is your references; here's mine from a working project:
Solution References
Note my project uses JSON, so you may ignore the Newtonsoft NUGET. Also note the DJIWindowsWrapper reference is to the winmd file. Your project will probably build fine without this reference (mine does), but won't run.

How to handle error "Could not load the assembly file:///C:\sample.dll. This assembly may have been downloaded from the Web."

I downloaded some sample code for windows phone app. When I tried to run it in vs2010 it shows this error
"Could not load the assembly file:///C:\Users\sample\Microsoft.Phone.Controls.Toolkit.dll. This assembly may have been downloaded from the Web."
I changed the properties of this file and unblocked it but still it shows the same error.
The reason for that is that for some security reason the target assembly is blocked.you have to go to the folder where the assembly is stored and unlock it by right clicking properties and then the unblock button.
I also didn't see the unblock button on the offending dll. Moving my project to a folder outside my Documents folder resolved the issue for me. I use c:\myprojects\ instead of c:\users\\Documents\Visual Studio 2010\Projects

Deploy dll with resource files to sharepoint 2010 in visual studio 2010

I have problem to add a assembly to my sharepoint project. I have a assembly that contains resource files for different language. I have one file for English, Utility.resx och one for Swedish Utility.sv-SE.resx. When I build it, it will be one dll for the project and one for the swedish language. The problem is when I should deploy it to Sharepoint with Visual Studio. I have added the assembly for the project to my packagefile in my sharepoint project. But when I trying to deploy it but I got the message:
Error occurred in deployment step 'Add Solution': Error: Cannot add the specified assembly to the global assembly cache: Utility.resources.dll
I have tried to specified both sv-SE\Utility.resources.dll and Utility.resources.dll as Location when I added the assembly i package. Note that I want to add it as assembly from project output.
Anyone having an ideas how to solve this problem?
This should help - http://blogs.visigo.com/chriscoulson/deploying-localized-satellite-assemblies-with-sharepoint-2010/
You have to add the resource assemblies using "Add Existing Assembly" and hard code the path to the BIN\release\ folder and NOT "Add Assembly from Project Output" for some reason...
And no - you can't use bin\$(ConfigurationName) -- GAHH!
Why not deploying the resource files as resx?
They need to be added to the manifest.xml as "RootFiles":
<RootFile>
<RootFile Location="Resources\Utility.sv-SE.resx"></RootFile>
<RootFile Location="Resources\Utility.resx"></RootFile>
</RootFiles>
Hope that helps,
marco

Unable to copy file C:\SomePath\Myfile.dll to bin\Myfile.dll Access to the path bin\Myfile.dll is denied

We just converted a VS 2008 project to VS 2010. The conversion showed no errors. Now, when building the solution. We get the following errors:
Unable to copy file C:\TI\Project\SharedAssemblies\Myfile.dll to bin\Myfile.dll Access to the path bin\Myfile.dll is denied
ANOTHER PROBLEM:
I have another problem too! One of my project is referencing a project DLL and that DLL does not exist. I tried to build the solution but that project is never building because it stops whenever there is error on any other project.
UPDATE 2:
So, instead of using the ported VS 2008 to VS 2010 solution I just opened the VS 2008 solution in VS 2010 and some of the errors have gone away. Now, I am left with couple of errors in which one of them is the following:
Error 1 Could not load referenced assembly "C:\MyProject\bin\JobManager.dll". Caught a FileNotFoundException saying "Could not load file or assembly 'C:\MyProject\bin\JobManager.dll' or one of its dependencies. The system cannot find the file specified.". C:\MyProject\ResGen
What kind of resources the resgen is trying to build and where is it located?
One common cause that I've encountered is that a unit test has the assembly loaded (like in NUnit) and that is blocking the copy. Closing NUnit, for example, clears the problem. Check for something similar that's holding on to the assembly.
I just removed the file from bin folder and everything start working
might be it help you!

How to solve this error: Could not find file 'Microsoft.Windows.CommonLanguageRuntime, Version 2.0.50727.0'

This question to which I already found the answer is posted here in case of someone else encounters it. I decided to post the Q&A here so that SO has something about this error, since I don't know if it's been here before.
This occured after an update of the .NET Framework. Before the update, everything compiled just fine! After the update, I could compile nothing!
The error message is:
Error 1 - Could not find file 'Microsoft.Windows.CommonLanguageRuntime, Version=2.0.50727.0'.
This is a problem within Visual Studio 2005. This occurs after an update of the .NET Framework 2.0 and is due to project reference within a single solution.
For example, when you're writing a test library which will test your assembly within the same solution, you will most likely reference the project. Then, this error may occur.
To solve this error, simply reference the file binary of your project, either the DLL or the EXE within which resides the code you want to test. This is called a file reference.
Let's suppose we have two projects called:
Company.Project.ApplicationName;
Company.Project.ApplicationName.Tests.
When adding the reference to our Company.Project.ApplicationName project within our Company.Project.Application.Tests project, we can either use the Browse or the Project tab. When using the Project tab, you create a project reference. We don't want to use this if this error occurs. What we want to use is Browse, so that we can make a file reference.
Here's a link to the Microsoft Support Website that explains this issue.
You may receive a "Could not find file 'Microsoft.Windows.CommonLanguageRuntime" error message when you build a solution of a Visual Basic 2005 Windows Application project in Visual Studio 2005

Resources