Hi,
I’ve recently begun converting our internal perforce maxscript library from the now defunct p4dn.dll across to the new shiny p4api.net.dll available from perforce here;
http://www.perforce.com/product/components/tools-apis
However I’ve quickly run into problems creating a connection to the server and was wondering if anyone had encountered and resolved similar issues. Example code below;
(
local sFilePath = (@"D:\p4api.net64\lib\") -- path to the perforce dll
local p4DotNet = dotnet.loadAssembly ( sFilePath +"p4api.net.dll" )
-- create the server address object.
local ServerAddress = dotNetObject "Perforce.P4.ServerAddress" @"leia:1666" -- using leia, our internal perforce server
-- create a server object using ServerAddress.
local Server = dotNetObject "Perforce.P4.Server" ServerAddress
-- connect to the repository using Server
local Repository = dotNetObject "Perforce.P4.Repository" Server
-- attempt to access the Repository's connection
local Con = try (Repository.connection) catch(format "%
" ( getCurrentException() ); undefined)
-- alternativly attempt to directly create a connection using Server
local Connection= try ( dotNetObject "Perforce.P4.Connection" Server) catch(format "%
" ( getCurrentException() ); undefined)
)
any help appreciated.
Cheers,