Search code examples
c#gitlabrestsharpgitlab-api

GitLab: Project Not Found: Runs Fine Locally, Doesn't Work Deployed


We have an app that updates a gitlab project and pushes/commits to master. When I run locally, the program runs fine. When I run on the application hosted server (not the gitlab server), I get a 404 "Project not found".

  1. It's not the private access token, we just made a new one
  2. I can sign in to gitlab on our app hosted server and find the project
  3. I verified the account can push straight to master
  4. There is no xdt transformation on the config files

I logged into the account on the app hosted server and hit the project via the same api url.

Here is the codified url:

RestRequest fileExists = new RestRequest(
    $@"api/v4/projects/{project.id}/repository/files/{action.file_path.Replace("/", "%2F")}?ref=master&private_token={ConfigurationManager.AppSettings["JiraPrivateKey"]}", 
    Method.GET);

I'm almost thinking it's some sort of server setting, but I would think that I would get the 404 when I tried the api url in the browser.


Solution

  • After thinking about it, since I use the ConfigurationManager, I had to copy by .exe.config file to the server and not just the exe itself. After dragging the config and the exe over. It worked. :-(