0

I need some help with a VB.net code. I am very new to VB.net. I am getting this error:

Error 'Could not load file or assembly 'LogicNP.ShellObjects, Version=13.0.0.0, Culture=neutral, PublicKeyToken=ff6f27194af4af75' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)'

This prevents me from building the code. It looks like I am missing some sort of file but I haven't heard of the LogicNP.ShellObjects. Is there a location that I can find this file at?

Edit: For those wondering, I do have the .dll file in the project/solution. I added the dll file to the solution explorer and I can see it in there. I also added the dll file to the toolbox.

I am still receiving the same error

Edit:

I think that I might have found the answer. I viewed this posting:

Visual Studio "Could not load file or assembly. Operation is not supported" error in Release mode

And the error did go away but now I have 4 errors. I will update this post if/when I get the project to build.

codingDude
  • 331
  • 1
  • 2
  • 10

2 Answers2

1

ShellObjects is a library of controls and components by LogicNP software, found here:

http://www.ssware.com/shlobj/shlobj.htm

The library is provided in something called an Assembly, which is .NET's packaging format:

https://msdn.microsoft.com/en-us/library/ms973231.aspx

The error message means that your code contains a reference to that assembly, but Visual Studio can't find it in the location specified.

InteXX
  • 6,135
  • 6
  • 43
  • 80
  • Great, how do I figure out where the IDE is looking for the assembly? – codingDude Oct 27 '17 at 14:28
  • So for record, I do have that .dll file in my solution and in the same folder as the project file. I even added it to the toolbox and I am still receiving the error – codingDude Oct 27 '17 at 18:57
  • @codingDude .NET will issue that error when there is a problem with one of the assembly's dependencies. You can try using the fuslogvw tool to monitor .NET's assembly binding and see if you can spot the problem. – Craig Oct 27 '17 at 22:00
  • @codingDude — The .dll must be in your `bin` folder, not the project folder. I'm not familiar with LogicNP's standard deployments and assembly locations, but generally you'll want to add a reference to the .dll in Visual Studio and set its `CopyLocal` property to `True`. This will automatically copy the .dll to the `bin` folder on each build, if/when required. – InteXX Oct 28 '17 at 02:37
  • @InteXX I have already done that. And it is still not building. It looks like that the file that is associated with the error is LC – codingDude Oct 30 '17 at 13:21
1

Ok, so I have verified that the fix does work.

What was happening is that the computer was blocking the dll file from being loaded because it was downloaded from the internet. See this posting:

Visual Studio "Could not load file or assembly. Operation is not supported" error in Release mode

codingDude
  • 331
  • 1
  • 2
  • 10