2

I'm writing a program in C# with the Redmine Api and I only can login through

var manager = new RedmineManager("http://srvredmine/login", username, password);

and if I use simple task like

var user = manager.GetCurrentUser();
Console.WriteLine(user);

I get a NotFoundException occurred in redmine-net45-api.dll


I changed to RedmineWebClient because it works better for me. For example I want to download a Wiki page then I use MessageBox.Show(manager.DownloadString("http://srvredmine/projects/sports").ToString()); And for login I use

NetworkCredential credentials = new NetworkCredential(username, password, "http://srvredmine/login/"); RedmineWebClient manager = new RedmineWebClient(); manager.BaseAddress = "http://srvredmine/"; manager.Credentials = credentials;

But in the messageBox i only get the string of the login page.

NineBerry
  • 26,306
  • 3
  • 62
  • 93
Zasam
  • 63
  • 2
  • 17

2 Answers2

1

Try to remove "login" from the url you pass to the RedmineManager() constructor.

var manager = new RedmineManager("http://srvredmine/", username, password);

The API expects the base URL to the server, not to a specific function.

NineBerry
  • 26,306
  • 3
  • 62
  • 93
  • I already tried that, but I also get a Exception `code` Redmine.Net.Api.RedmineException | Additional information: not found – Zasam Mar 14 '17 at 06:35
  • Well, we need more information. Detailed information on the error including call stack. And is there really an uptodate version of Redmine installed at http://srvredmine? What happens when you open `http://srvredmine/users/current.xml` in a browser? – NineBerry Mar 14 '17 at 10:31
  • I tried it a bit with RedmineWebClient but I cant login either, but I can you some functions of the RedmineWebClient. if i use [link](http://srvredmine/users/current.xml) It says Page not found 404. oh okay, there is the error. – Zasam Mar 14 '17 at 10:45
  • Please look to my updated Post and thx for the answer, I see where my problem was. – Zasam Mar 14 '17 at 10:50
1

Just asked a developer. The Redmine Version is too old to use RedmineManager and RedmineWebClient is not that useful for me.

Zasam
  • 63
  • 2
  • 17