我对C#的this WebDavClient库有问题。我使用以下代码建立与SVN存储库的连接:
using (var webdavClient = new WebDavClient())
{
var result = await webdavClient.Propfind(uri);
if (result.IsSuccessful)
{
....
}
}
通过C#-Library调试后,实际请求似乎工作正常。但是,没有提供 displayname 属性,我不知道为什么服务器的响应中缺少 displayname 属性。我从服务器得到的响应如下:
<lp1:response xmlns:V="http://subversion.tigris.org/xmlns/dav/" xmlns:S="http://subversion.tigris.org/xmlns/svn/" xmlns:C="http://subversion.tigris.org/xmlns/custom/" xmlns:lp1="DAV:" xmlns:lp2="http://subversion.tigris.org/xmlns/dav/">
<lp1:href>/svn/repo/folder1</lp1:href>
<lp1:propstat>
<lp1:prop>
<lp1:resourcetype>
<lp1:collection />
</lp1:resourcetype>
<lp1:getcontenttype>text/html; charset=UTF-8</lp1:getcontenttype>
<lp1:getetag>W/"2//folder1"</lp1:getetag>
<lp1:creationdate>2016-11-11T12:11:28.864862Z</lp1:creationdate>
<lp1:getlastmodified>Fri, 11 Nov 2016 12:11:28 GMT</lp1:getlastmodified>
<lp1:checked-in>
<lp1:href>/svn/repo/!svn/ver/2/folder1</lp1:href>
</lp1:checked-in>
<lp1:version-controlled-configuration>
<lp1:href>/svn/repo/!svn/vcc/default</lp1:href>
</lp1:version-controlled-configuration>
<lp1:version-name>2</lp1:version-name>
<lp1:auto-version>DAV:checkout-checkin</lp1:auto-version>
<lp2:baseline-relative-path>folder1</lp2:baseline-relative-path>
<lp2:repository-uuid>54432e45-83a1-49ac-b790-da67dd1d131f</lp2:repository-uuid>
<lp2:deadprop-count>0</lp2:deadprop-count>
<lp1:lockdiscovery />
</lp1:prop>
<lp1:status>HTTP/1.1 200 OK</lp1:status>
</lp1:propstat>
几个月前,WebDav-Library正如预期的那样工作,但是现在,我再也无法让它工作了。您有什么建议可以查看或可能出错吗?
答案 0 :(得分:0)
DAV:displayname属性是完全可选的。为什么SVN会返回它,如果它将匹配路径名的最后一部分呢?