33584

Web.config system.webserver errors

I'm trying to deploy my C# ASP.Net app to my hosting site. The problem is I have 2 C++ dlls that the app uses, but with shared hosting they can't be in the bin folder. They've been referenced in the project fom a folder called 'bin_native'. The app runs on my machine with using the probing privatePath in the runtime section of the web.config and Assembly directives at the top of my Default.aspx file. But it won't run on the server like that. It can't find the dlls when parsing the default.aspx when the site loads, with an error at the 2 Assembly directives at the top of that file.

So I'm trying to add references to the dlls in the system.webserver section of the web.config. Support for the site said if I can do that maybe the app can use a separate bin folder that is located in the parent directory of my sites wwwroot folder (where the ASP.Net bin folder is). That way the app can find the dlls.

But I can't get the system.webserver section correct without errors. When I test on my machine I get the following error:

Server Error in '/' Application. Could not load file or assembly 'find_duplicates, Version=0.0.0.0, Culture=neutral, PublicKeyToken=e02ee5289fcc8248' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) 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.IO.FileLoadException: Could not load file or assembly 'find_duplicates, Version=0.0.0.0, Culture=neutral, PublicKeyToken=e02ee5289fcc8248' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Here are the changes in my project I've made so far:

Default.aspx:

<%@ Assembly Name="find_duplicates" %> <%@ Assembly Name="trim_combos" %>

Web.config:

<system.webServer> <modules runAllManagedModulesForAllRequests="true"> <add name="find_duplicates" type="find_dups.find_duplicates, find_duplicates,Version=0.0.0.0, Culture=neutral, PublicKeyToken=e02ee5289fcc8248" /> <add name="trim_combos" type="trim_coms.trim_combos, trim_combos, Version=0.0.0.0, Culture=neutral, PublicKeyToken=e02ee5289fcc8248" /> </modules> <validation validateIntegratedModeConfiguration="false" /> </system.webServer> <runtime> <dependentAssembly> <assemblyIdentity name="find_dups.find_duplicates.find_duplicates" publicKeyToken="e02ee5289fcc8248" culture="neutral" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="trim_coms.trim_combos.trim_combos" publicKeyToken="e02ee5289fcc8248" culture="neutral" /> </dependentAssembly> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <probing privatePath="bin_native"/> </assemblyBinding> </runtime>

My dlls are defined in the header files as:

find_duplicates dll namespace find_dups class find_duplicates trim_combos dll namespace trim_coms class trim_combos

I'm on Windows 7 64 bit running IIS in Integrated Pipeline mode. That's why I'm using the system.webserver section instead of the the system.web section in the web.config.

Any help with this would be greatly appreciated. Thanks in advance.

Answer1:

I got it to work. My dlls are not managed (they're native modules) so it couldn't load the types for them, even though they had a class and a namespace. Apparently for native modules you just use the add name, with nothing else, as follows:

<system.webServer> <globalModules> <add name="find_duplicates"/> </globalModules> </system.webServer>

Recommend

  • Resharper intellisense suggests wrong path in MVC 6
  • Error: SyntaxError: Unexpected token <
  • Need to find Default Web Site's Home Directory in IIS
  • What is the best way to include a style sheet for a specific page?
  • coldfusion variables into powershell
  • How to modify the HTML tag in Drupal 6?
  • Azure Diagnostic is not saving logs in azure tables
  • Linux command line : edit hacked index files
  • Why are YouTube videos using 'youtube.com/v' not loading
  • Yii2: Finding file and getting path in a directory tree
  • Servlet stops working on Tomcat server after some hits or time
  • Best way to dynamically load an xml configuration file into a Flex4/Flash movie at runtime?
  • Implicit joins and Where in Doctrine - how?
  • Force show.bind execution
  • How to revert to previous XCode version?
  • Make VS2015 use angular-cli ng at build time in a .NET project
  • Checking free space on FTP server
  • Disable Enter in editText android
  • Change Inet root folder for iis 7
  • Display issues when we change from one jquery mobile page to another in firefox
  • Deselecting radio buttons while keeping the View Model in synch
  • Resize panoramic image to fixed size
  • Volusion's generic SQL folder, functionality
  • Where to put my custom functions in Wordpress?
  • JSON with duplicate key names losing information when parsed
  • Updated Ionic CLI but shows previous version (Windows)
  • Jquery - Jquery Wysiwyg return html as a string
  • Function pointer “assignment from incompatible pointer type” only when using vararg ellipsis
  • 0x202A in filename: Why?
  • Numpy divide by zero. Why?
  • C# - Getting references of reference
  • How do you join a server to an Active Directory (domain)?
  • Angular 2 constructor injection vs direct access
  • coudnt use logback because of log4j
  • Java static initializers and reflection
  • Android Google Maps API OnLocationChanged only called once
  • File not found error Google Drive API
  • Linking SubReports Without LinkChild/LinkMaster
  • Easiest way to encapsulate a HTML5 webpage into an android app?
  • UserPrincipal.Current returns apppool on IIS