Jenkins Change Assembly Info Plugin not working on Linux Host and Windows Slave

I have a configuration using a Linux Jenkins master and a Windows 10 slave. I'm using it to do an msbuild operation on the slave and generate an install executable as an artifact. I have this working on a Jenkins Windows 10 master system (same one I'm using as a slave), and this all works fine. However, when I run the same job remotely I get the dreaded "CS1031" error:

PropertiesAssemblyInfo.cs(1,1): error CS1031: Type expected [C:slave2WorkspaceworkspaceSDB ProjectsCCMonitorCCMonitorCCMonitorCCMonitor.csproj]

This is pointing at the first character in the file. If I omit the job step with the Change Assembly Info plugin, everything works fine and I get the output correct. What I found was that the AssemblyInfo.cs file was missing the characters 0xEB 0xBB at the front of the file -- these somehow got dropped in the translation. Sounds like a character set issue, but it is only an issue with this plugin step.

Is there something that needs to be configured differently?

thanks!!


So I had this same issue today and found the solution. Not sure if you ever figured this one out, so I wanted to drop the solution just in case.

Turned out to be an encoding issue. The assembly file is encoded UTF-8 with signature. As a workaround to avoid the characters being added to the beginning of the file, change the encoding to UTF-8 without signature.

I did this by opening the files in notepad++ and then selecting Encoding -> Encode in UTF-8

链接地址: http://www.djcxy.com/p/66398.html

上一篇: 使用并发构建访问所有工作空间以进行作业

下一篇: Jenkins更改装配信息插件不适用于Linux主机和Windows从机