How to System.BadImageFormatException (No string associated with token) error solved

Tabish Ashraf 0 Reputation points
2023-01-28T13:47:57.62+00:00

Our Web Application build in .NET 4.8 and hosted as an azure app service throws this exception in some views. Here is the stack trace for one of these exceptions. We have run out of options to try certain things but it is stuck like that. We have tried to change project architecture x86,x64 but no effect. I have tried hosting on my local IIS but still this exception gets thrown. I cannot find any application level code that could be causing this.

System.BadImageFormatException: [C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\70a9f213\50e04934\assembly\dl3\aecaff1b\1c561891_6531d901\TeleSpecialists.Web.Code.dll] No string associated with token.
   at ASP._Page_Views_SchedulerModule_Index_cshtml.Execute()
   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.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass3_6.
Internet Information Services
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,219 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,096 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,109 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 53,426 Reputation points
    2023-01-30T18:31:30.25+00:00
    0 comments No comments