2017-03-29 7 views
0

나는 우분투에서 모노를 사용하여 처음이다, 나는 최근에 MVC5를 사용하여 매우 잘 작동하는 몇몇 웹 사이트를 가지고있다. 참조 된 PCL에서 열거 형을 참조하는 양식이 뷰를 충돌시킵니다. 아래 Windows 호스트에서 잘 작동하는 내 EnumDropDownList 호출입니다. 우분투 호스트의 브라우저에서이를 볼 때Apache2 ASP MVC 면도기보기 드롭 다운에 대한 PCL 열거 형을 참조 할 때 충돌

<div class="form-group"> 
@Html.LabelFor(m => m.Type, new { @class = "control-label" }) 
@Html.EnumDropDownListFor(m => m.Type, new { @class = "form-control" }) 
</div> 

그러나 나는 오류를 다음 얻을

System.InvalidOperationException 
The view found at '~/Views/portal/productgroup.cshtml' was not created. 

추가 스택 추적은

 at System.Web.Mvc.BuildManagerCompiledView.Render (System.Web.Mvc.ViewContext viewContext, System.IO.TextWriter writer) [0x00061] in <cc73190bab9d435c831510ff295c572a>:0 
    at System.Web.Mvc.ViewResultBase.ExecuteResult (System.Web.Mvc.ControllerContext context) [0x00080] in <cc73190bab9d435c831510ff295c572a>:0 
    at System.Web.Mvc.ControllerActionInvoker.InvokeActionResult (System.Web.Mvc.ControllerContext controllerContext, System.Web.Mvc.ActionResult actionResult) [0x00000] in <cc73190bab9d435c831510ff295c572a>:0 
    at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive (System.Collections.Generic.IList`1[T] filters, System.Int32 filterIndex, System.Web.Mvc.ResultExecutingContext preContext, System.Web.Mvc.ControllerContext controllerContext, System.Web.Mvc.ActionResult actionResult) [0x0000b] in <cc73190bab9d435c831510ff295c572a>:0 
    at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive (System.Collections.Generic.IList`1[T] filters, System.Int32 filterIndex, System.Web.Mvc.ResultExecutingContext preContext, System.Web.Mvc.ControllerContext controllerContext, System.Web.Mvc.ActionResult actionResult) [0x0004f] in <cc73190bab9d435c831510ff295c572a>:0 

내가 참조 할 필요가있는 방법이 있습니다 컨트롤러의 외부 어셈블리 또는 면도기 뷰? 이것은 일반적인 문제입니까, 아니면 계속 진행중인 특정 일이있을 수 있습니까?

참고로 PCL에는 내 사이트와 Xamarin을 사용하여 제작 한 모바일 앱간에 공유되는 코드가 일부 있습니다. PCL은 모든 Xamarin과 같은 .NET Framework 4.5를 가지고 있습니다.이 코드는 Windows에서 완전히 작동하며 PCL에 저장된 enum에 대한 참조를 제거하면 작동합니다.

도움을 주시면 감사하겠습니다.

답변

0

많은 연구와 테스트를 통해 문제를 해결할 수 있었지만 지금은 그 과정을 설명 할 것입니다.

내 프로젝트 구성에서 컴파일 된 MVCViews로 전환하고 내 web.config에서 System.Runtime을 참조하지 않아 컴파일하지 못했다는 사실을 발견했습니다.이 참조를 추가 한 다음이 테스트를 컴파일하여 로컬에서 올바르게 작동했습니다 그러나 모노에서 같은 문제로 실패했습니다.

다음 모노는 System.Runtime 버전이 있었는지 궁금해하기 시작 했으므로 Nuget에서 System.Runtime 패키지를 설치했습니다. 프로젝트를 빌드 할 때 내 bin 폴더에 추가되지 않았고 nuget이 Visual Studio에 설치되어 있다고 언급했지만 프로젝트 참조.

마지막으로 System.Runtime.dll을 내 원격 bin 폴더에 복사하면 내 문제가 해결됩니다. System.Runtime에 의존한다면 우리의 bun 폴더가 필요합니다. (아마도 당신이 할 것입니다.)

나는 이것으로 도움을 얻으려고 많은 시간을 보냈지만 도움이되기를 바랍니다.