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.