[Closed] DotNet SharpSVN
Hey Guys,
I am kinda new to dotnet in max where I was working with sharpSvn lib to authenticate, checkout and update repo. I am succeeded in all those but I am unable to save the authentication. to save Auth credentials, i am trying like this which is throwing an error…
dllPath = @"C:\sharpSvnDll\"
dll = dotnet.loadAssembly (dllPath+"SharpSvn.dll")
mainDll = "SharpSvn"
client = dotnetObject (dotnetClass (mainDll+".svnClient"))
fn authenticate =
(
local userName = "userName"
local pw = "Password"
local handlers = (dotnetClass (mainDll+".Security.SvnUserNamePasswordEventArgs"))
--
target = (dotnetClass (mainDll+".SvnTarget")).FromString dllPath
handlers.UserName = userName
handlers.Password = pw
handlers.Save = True
--
client.Authentication.SubversionWindowsUserNamePasswordHandler = handlers
)
authenticate()
the error is:
– Error occurred in Authenticate(); filename: ; position: 435; line: 15
– Frame:
– handlers: dotNetClass:SharpSvn.Security.SvnUserNamePasswordEventArgs
– pw: “Password”
– username: “userName”
– Runtime error: dotNet runtime exception: Non-static method requires a target.
ANyHelp regarding it.? and one more thing is I need to get those log entries too mostly to a variable… Help would be very much appreciated. Thanks
question #1:
why is SharpSvn?
(you should understand that we have to install this library to our systems to be able to debug your script)
Coz I was having problems with commandline not installed on all the systems for tortoise svn… and I dont want to use commandline. I found sharpSvn useful while working for an other tool in c#
the error messages shown say that the problem is a wrong using of the library methods.
it’s not mxs issue
Hey, Denis. Thanks about that, but I wonder it is some thing to do with the syntax rather. Coz I had the same error throwing up for other functions too but later on with fixing syntax they worked fine. That is what I am confused about.But again as you said, I will check with loading up other dll s too. Any idea how to get logs from sharpSVN though as the authentication and stuff is working fine in other method.
local handlers = (dotnetClass (mainDll+".Security.SvnUserNamePasswordEventArgs"))
handlers.UserName = userName
likely you can get ‘handlers’ as a class… but you can’t set a property of a .net class. you have to have a class instance (object)
local handlers = (dotnetobject (mainDll+".Security.SvnUserNamePasswordEventArgs"))
handlers.UserName = userName
this might work. but anyway to make everything works i need to get the dll.
but i have no idea what this dll is about and why i have to mess around with it
Tried that… no luck We cant make it in to an object because those are collections. May be we have to create a collection object and assign it to that, but no idea how to do it especially in max. Will try doing it in that way anyways.
I just wanted to authenticate, checkout, get logs of a repo but dont want to use commandline arguments… SharpSvn is a very good library from collabnet and useful where you dont have to fiddle around with commandline and stuff. If you have any other option please let me know…
For logs, check this http://tech-artists.org/forum/showthread.php?638-DotNet-in-max-syntax
partly answered.