문제

NVELOCITY (v1.1.1) 시작하기 만하면 잘 작동하는 것 같습니다.

저를 괴롭히는 작은 작은 것이 있습니다.나는 어딘가에 처리 되더라도 예외가 발생할 때마다 vs2010을 설정하고 다음 코드를 실행할 때 항상 평가할 호출에서 "닫힌 textreader에서 읽을 수 없음"(objectdisposedException)짐마자나는 nvelocity에 대한 소스 코드가 없으므로 디버깅 할 수 없습니다.

나는 이것을 일으키는 어딘가에있는 설정을 놓치고 있습니까?NVELOCITY의 무해한 버그입니까?그 결과는 괜찮아 나온다. 나에게 그것은 뭔가가 옳지 않은 것처럼 보입니다.

var velocity = new VelocityEngine();
var properties = new ExtendedProperties();
var context = new VelocityContext(fieldValues);
properties.AddProperty("velocimacro.library", string.Empty); // no library
velocity.Init(properties);

using (var writer = new StringWriter())
{
  velocity.Evaluate(context, writer, null, templateContents);
  return writer.ToString();
}
.

예외 스택 트레이스 :

system.io .__ error.readerClosed ()에서 System.IO.StringReader.Read (char [] 버퍼, Int32 색인, Int32 카운트)
nvelocity.runtime.parser.velocityCharStream.Fillbuff () in. C : \ \ src \ nvelocity \ runtime \ parser \ velocitycharstream.cs : 313

도움이 되었습니까?
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top