0

I'm trying to update in-house developed plugin for Azure DevOps Server. Previously company was using TFS 2017, and plugin worked correctly. Now, it launches (I see it through messages in EventLog), but there is an issue, that function ServerItemExists returns "False", but actually file is present.

I have found issues about that versionControl TfsConfigurationServer.GetService() always returns null (TfsConfigurationServer.GetService<VersionControlServer>() always returns null), but it seems to be not my case. Here code below

            var configFileServerPath = $"$/{projectName}/AutoCodeReview.xml";
                        var versionControlServer = projectCollection.GetService<VersionControlServer>();

                        writeLog(EventLogEntryType.Information, $"Details. configFileServerPath: {configFileServerPath}. versionControlServer.TeamProjectCollection.Name: {versionControlServer.TeamProjectCollection.Name}");
                        bool ItemExists = versionControlServer.ServerItemExists(configFileServerPath, ItemType.File);
                        writeLog(EventLogEntryType.Information, $"Item existence: {ItemExists}");
                        if (!ItemExists)
                        {
                            writeLog(EventLogEntryType.Information, $"return, not item exists");
                            return null;
                        }

So I use EventViewer as smth like debug output, and I see, that I've got message as "Item existence false". But file exists!

My suggestions in path defining. URL in browser to element looks like this: http://tfs1:8080/tfs/DefaultCollection/Project1/_versionControl?path=%24%2FProject1%2FAutoCodeReview.xml

As I figure out by EventVwr, these are paths:

configFileServerPath $/Project1/AutoCodeReview.xml

TeamProjectCollection.Name http://tfs1:8080/tfs/DefaultCollection/

So this works fine in TFS 2017, and shows that there is no file in Azure DevOps Server 2019. As I new to C#, it seems to be difficult to realize what is wrong.

Van Ng
  • 773
  • 1
  • 7
  • 17

0 Answers0