locked
Server Error in '/' Application. RRS feed

  • Question

  • User-1499457942 posted

    Hi

      I am getting above error . I have placed GSTIN folder in c:\inetpub\wwwroot. Port = 8888 . 

    Server Error in '/' Application. Could not load file or assembly 'GSTIN' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded. Description: An unhandled exception occurred during

    Thanks

    Thursday, June 21, 2018 6:50 AM

Answers

  • User-821857111 posted

    Your ASP.NET application targets .NET 2.0. What is GSTIN? Do you have the source code? If so you could try recompiling it against .NET 2.0. You an check the version of the runtime that an assembly targets like this:

    var assembly = Assembly.LoadFile(@"full_path_to_assembly.dll");
    Console.WriteLine(assembly.ImageRuntimeVersion);

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, June 22, 2018 8:48 AM

All replies

  • User-821857111 posted

    This assembly is built by a runtime newer than the currently loaded runtime
    Your application targets one version of .NET, and the component it is trying to load is created with a newer version. You need to see if you can get hold of a version of GSTIN that targets the version of .NET that your application is built with.

    Thursday, June 21, 2018 8:48 AM
  • User-1499457942 posted

    Hi

     How i can check this

    Could not load file or assembly 'GSTIN' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded. 
      Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
    
     Exception Details: System.BadImageFormatException: Could not load file or assembly 'GSTIN' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
    
    Source Error: 
    
    
     An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  
    
    Assembly Load Trace: The following information can be helpful to determine why the assembly 'GSTIN' could not be loaded.
    
    
    
    WRN: Assembly binding logging is turned OFF.
    To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
    Note: There is some performance penalty associated with assembly bind failure logging.
    To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
    
      
    
    Stack Trace: 
    
    
    
    [BadImageFormatException: Could not load file or assembly 'GSTIN' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.]
       System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
       System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +43
       System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +127
       System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +142
       System.Reflection.Assembly.Load(String assemblyString) +28
       System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +46
    
    [ConfigurationErrorsException: Could not load file or assembly 'GSTIN' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.]
       System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +613
       System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +203
       System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +105
       System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178
       System.Web.Compilation.WebDirectoryBatchCompiler..ctor(VirtualDirectory vdir) +163
       System.Web.Compilation.BuildManager.BatchCompileWebDirectoryInternal(VirtualDirectory vdir, Boolean ignoreErrors) +53
       System.Web.Compilation.BuildManager.BatchCompileWebDirectory(VirtualDirectory vdir, VirtualPath virtualDir, Boolean ignoreErrors) +175
       System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) +86
       System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +261
       System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +101
       System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +126
       System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +62
       System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +33
       System.Web.UI.PageHandlerFactory.GetHandler(HttpContext context, String requestType, String virtualPath, String path) +37
       System.Web.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +307
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
    
      
    
    
    Version Information: Microsoft .NET Framework Version:2.0.50727.8784; ASP.NET Version:2.0.50727.8762 

    Thanks

    Thursday, June 21, 2018 8:55 AM
  • User1724605321 posted

    Hi JagjitSingh ,

    The error means  the DotNet framework you are using is of older version than the one used to build the assembly(GSTIN) . As @Mike said , You can find the  a version of GSTIN that targets the version of .NET that your application is built with. 

    You can also refer to below threads for potential solution :

    https://stackoverflow.com/questions/10607095/this-assembly-is-built-by-a-runtime-newer-than-the-currently-loaded-runtime-and

    https://stackoverflow.com/questions/5138735/error-this-assembly-is-built-by-a-runtime-newer-than-the-currently-loaded-runti 

    Best Regards,

    Nan Yu

    Friday, June 22, 2018 5:34 AM
  • User-821857111 posted

    Your ASP.NET application targets .NET 2.0. What is GSTIN? Do you have the source code? If so you could try recompiling it against .NET 2.0. You an check the version of the runtime that an assembly targets like this:

    var assembly = Assembly.LoadFile(@"full_path_to_assembly.dll");
    Console.WriteLine(assembly.ImageRuntimeVersion);

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, June 22, 2018 8:48 AM