问题
I've setup TFS notifications for when a Build Breaks and it works but the email is malformed and full of Asian characters:
I'm assuming there is a locale setting causing it?
I don't have access to the SMTP server but its unlikely anyone else is encountering malformed messages. Does anyone know what causes this and how to fix it?
回答1:
I logged my very first Microsoft case for this one, brings back memories.
Solution 1
The MSFT Engineer found a similar case:
TFS Notifications and alerts are UTF 16 encoded and they are garbled.
The solution is to remove the privacy tag from the emails on the exchange server.
Alternatively use a 3rd party smtp server.
I cannot attempt either of these in the locked down environment I work in but I thought share if it helps someone else in the future.
Solution 2
I found a similar thread on MSDN TFS 2012 sends Chinese characters in emails, breaking HTML alerts for all users.
The (TFS2012) solution is to edit the TeamFoundation.xsl file(s). This solution works for TFS2017, except you need to edit the BuildCompleteEvent.xsl and TeamFoundation.xsl files in the directory:
%ProgramFiles%\Microsoft Team Foundation Server 15.0\Application Tier\TFSJobAgent\Transforms\1033
- In the BuildCompleteEvent.xsl switch html to xml in 2 places:
<?xml version='1.0'?> <?xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:tb="http://schemas.microsoft.com/TeamFoundation/2010/Build" xmlns:ms="urn:schemas-microsoft-com:xslt"> <?xsl:import href="TeamFoundation.xsl"/> <?xsl:output method = "xml" doctype-public ="-//W3C//DTD HTML 4.01//EN"/>
<?xsl:output encoding="utf-8" indent="yes" method="xml"/>
- In the TeamFoundation.xsl switch html to xml:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml"/>
- It is important you do a IISReset or a Reboot the TFS server for the changes to take affect.
来源:https://stackoverflow.com/questions/44711733/team-foundation-server-unreadable-email-format