1

我正在尝试编写一个使用 YourackSharp 包装器来 quert=y youTrack 的客户门户。

项目的 bugtracker 上有一个错误:

http://youtrack.codebetter.com/issue/YTSRP-27?projectKey=YTSRP - 但似乎此代码已回滚。

重新启用代码后。我收到以下错误。

将 System.Collections.Generic.List`1[[System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] 转换为 YouTrackSharp.Issues.IssueStack 跟踪时出错:

at JsonFx.Serialization.DataReader`1.ReadSingle(ITextTokenizer`1 tokenizer, IEnumerable`1 tokens, Type targetType)
at JsonFx.Serialization.DataReader`1.Read(String input, Type targetType)
at JsonFx.Serialization.DataReader`1.Read[TResult](String input)
at EasyHttp.Codecs.DefaultDecoder.DecodeToStatic[T](String input, String contentType)
at EasyHttp.Http.HttpResponse.StaticBody[T]()
at YouTrackSharp.Infrastructure.Connection.Get[T](String command)
at YouTrackSharp.Issues.IssueManagement.GetAllIssuesForProject(String projectIdentifier, Int32 max, Int32 start)
at TasksProxy.YouTrackServer.GetProjectIssues(IProxyProject project) in C:\Code\RadicalGeekMVC\TasksProxy\YouTrackServerConnection.cs:line 74
at RadicalGeek.Models.Project.GetTasks() in C:\Code\RadicalGeekMVC\RadicalGeek\Models\Project.cs:line 51
at ASP._Page_Views_Portal_Index_cshtml.Execute() in c:\Code\RadicalGeekMVC\RadicalGeek\Views\Portal\Index.cshtml:line 152
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()
at System.Web.WebPages.StartPage.RunPage()
at System.Web.WebPages.StartPage.ExecutePageHierarchy()
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
at System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance)
at System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer)
at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult)
at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19()
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)

此错误在连接类的第 103 行引发。

var staticBody = httpRequest.Get(_uriConstructor.ConstructBaseUri(command)).StaticBody(); 该方法如下所示:

`        public T Get<T>(string command)
    {
    var httpRequest = CreateHttpRequest();     
    try
    {              
    var staticBody = httpRequest.Get(_uriConstructor.ConstructBaseUri(command)).StaticBody<T>();
    HttpStatusCode = httpRequest.Response.StatusCode;             
    return staticBody;
    }
    catch (HttpException httpException)
    {
    if (httpException.StatusCode == HttpStatusCode.Forbidden)
    {
    throw new InvalidRequestException(Language.Connection_Get_Insufficient_rights);
    }
    throw;
    }
    }`

如果有人可以在这方面给我任何帮助,因为我真的需要访问项目的自定义字段。

我已经实现的代码更改可以看作是在此更改集中回滚的更改:

https://github.com/JetBrains/YouTrackSharp/commit/fc488364b0787deae82d9b0fd3891e21be23bb10

谢谢你。

4

0 回答 0