Encoded path from system property for .NET runner
We are trying to migrate over from msbuild runner to the new .NET Runner with msbuild command since the old one are deprecated.
However, when we move over all settings and parameters we got a problem. We use system properties that contain relative paths to a couple of different .dll tasks that run before and after builds and they worked fine for the old runner. But now with the new runner it seems like they are passed HTML encoded to msbuild. Which results in a path where \ and . chars are encoded and thus msbuild cannot find the files. At least that is my best guess. If I set the properties in the build.proj file they work as intended. Its only when they are passed as system variables from Teamcity that the build fails.
This is the errors we get:
MSBuild] 14:22:45.097 1>C:\BuildAgent\work\a486f5cf1ffcc2d1\build.proj(56,5): error MSB4062: The "UpdateVersionTask.UpdateVersionTask" task could not be loaded from the assembly C:\BuildAgent\work\a486f5cf1ffcc2d1\%22BuildTools%5CUpdateVersionTask%2Edll%22. Could not load file or assembly 'file:///C:\BuildAgent\work\a486f5cf1ffcc2d1\%22BuildTools%5CUpdateVersionTask%2Edll%22' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
I have verified that the path is correct (except for the encoded chars) and that the dlls are present in that place. There is nothing wrong with the tasks themselves since they work when the path is set in the build.proj file.
When running the build with diagnostic log level I can see that this is inputed to msbuild: /p:VersionTaskPath=%22BuildTools%5CUpdateVersionTask%2Edll%22
But since all properties is sent encoded to msbuild in the log I am guessing this is done by design. And is normally not a pboelm. And we havent noticed any problems besides when we use it as a path like this.
Is there any way to prevent a certain property from being encoded? Or is there another workaround? We dont want the setting in the repo, we really want it in the build template in Teamcity like we always have done.
Please sign in to leave a comment.
No-one that has any insight into this?