심재운 블로그

반응형

개발하는 제 pc 환경에서는 이슈가 없었지만, 실서버의 환경에서 배포 후 오류 발생되어 화면이 뜨지 않아 곤란한 상황이 발생되었습니다.

 

 

문제 발생 

 

error CS0012: 'System.Object' 형식이 참조되지 않은 어셈블리에 정의되었습니다. 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' 어셈블리에 참조를 추가해야 합니다.

 

FATAL 2022-03-22 10:49:27,911   114ms MvcApplication         
Application_Error  - System.Web.HttpCompileException (0x80004005): 
d:\Web\Views\Account\Login.cshtml(167): 
error CS0012: 'System.Object' 형식이 참조되지 않은 어셈블리에 정의되었습니다. 
'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' 어셈블리에 참조를 추가해야 합니다.
   위치: System.Web.Compilation.BuildManager.PostProcessFoundBuildResult(BuildResult result, Boolean keyFromVPP, VirtualPath virtualPath)
   위치: System.Web.Compilation.BuildManager.GetBuildResultFromCacheInternal(String cacheKey, Boolean keyFromVPP, VirtualPath virtualPath, Int64 hashCode, Boolean ensureIsUpToDate)
   위치: System.Web.Compilation.BuildManager.GetVPathBuildResultFromCacheInternal(VirtualPath virtualPath, Boolean ensureIsUpToDate)
   위치: System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
   위치: System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
   위치: System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound)
   위치: System.Web.Compilation.BuildManager.GetCompiledType(VirtualPath virtualPath)
   위치: System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer)
   위치: System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
   위치: System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
   위치: System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
   위치: System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult)
   위치: System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass3_1.<BeginInvokeAction>b__1(IAsyncResult asyncResult)
   위치: System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult)
   위치: System.Web.Mvc.Controller.<>c.<BeginExecuteCore>b__152_1(IAsyncResult asyncResult, ExecuteCoreState innerState)
   위치: System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
   위치: System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)
   위치: System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
   위치: System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult)
   위치: System.Web.Mvc.MvcHandler.<>c.<BeginProcessRequest>b__20_1(IAsyncResult asyncResult, ProcessRequestState innerState)
   위치: System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
   위치: System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
   위치: System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   위치: System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
   위치: System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

 

 

해결방안

 

아래와 같이 System.Runtime 의 버전을 오류 발생한 로그에 맞게 값을 지정해 주어야 오류 없이 사용이 가능합니다.

<compilation debug="true" defaultLanguage="c#" targetFramework="4.5.2">
    <assemblies>
        <add assembly="System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    </assemblies>
</compilation>
반응형

댓글

비밀글모드