Jump to content

Making p4api.NET work


  • Please log in to reply
1 reply to this topic

#1 Tofik__PL



  • Members
  • Pip
  • 1 posts

Posted 12 June 2017 - 02:29 PM

I am trying to implement the p4api.NET API into my VS2015 project. I got the API as a nuget package.

In the beginning, I could not add it as a reference, most likely due to my project target architecture being Any CPU. Once I changed it to x86, the reference has been properly added. Unfortunately, when my code reaches PerforceConnection.Connect(null), the following is thrown:

Unable to load DLL 'p4bridge.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

Since the bridge file cannot be added as a direct reference, it being COM and all, I took a double-condom approach and basically tried putting a copy of it in every build directory of my project, for both release and debug. That's how desperate I got trying to make it work.

Of course, none of this has worked. I am at my wits end at this point and would very much appreciate if anyone could write a step-by-step guide for me on how to set this API up. The actual server communication I'm sure I can handle, it's just that setup part I cannot get right.

Also, since it's my first post here, hello everybody :)


Turned out it was a mismatch between the API and the bridge file. I downloaded the API from perforce website instead of NuGet, and now it works correctly.

#2 p4bill


    Advanced Member

  • Members
  • PipPipPip
  • 202 posts

Posted 13 June 2017 - 11:59 AM

Glad you were able to get it to work. That NuGet package is not supported by Perforce and looks like it has not been updated since 2014.

If you haven't already, check out the manual here:


The introduction has some helpful code examples.

Also tagged with one or more of these keywords: p4api.net

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users