Could not load file or assembly '2017-12-31 19-00 Copy of AjaxControlToolkit' or one of its dependencies - .net-assembly

I have some issued in my exchange mail server 2013. After i login it's showing as below description. Please help me to solve this problem. Thanks.
Server Error in '/ecp' Application.
Could not load file or assembly '2017-12-31 19-00 Copy of
AjaxControlToolkit' 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 '2017-12-31 19-00 Copy of AjaxControlToolkit' or one of
its dependencies. The located assembly's manifest definition does not
match the assembly reference. (Exception from HRESULT: 0x80131040)
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 '2017-12-31 19-00 Copy of
AjaxControlToolkit' 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:
[FileLoadException: Could not load file or assembly '2017-12-31 19-00
Copy of AjaxControlToolkit' or one of its dependencies. The located
assembly's manifest definition does not match the assembly reference.
(Exception from HRESULT: 0x80131040)]
System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String
codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint,
StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean
throwOnFileNotFound, Boolean forIntrospection, Boolean
suppressSecurityChecks) +0
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName
assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly,
StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean
throwOnFileNotFound, Boolean forIntrospection, Boolean
suppressSecurityChecks) +210
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString,
Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr
pPrivHostBinder, Boolean forIntrospection) +242
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
forIntrospection) +17 System.Reflection.Assembly.Load(String
assemblyString) +35
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String
assemblyName, Boolean starDirective) +122
[ConfigurationErrorsException: Could not load file or assembly
'2017-12-31 19-00 Copy of AjaxControlToolkit' or one of its
dependencies. The located assembly's manifest definition does not
match the assembly reference. (Exception from HRESULT: 0x80131040)]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String
assemblyName, Boolean starDirective) +12761078
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory()
+503 System.Web.Configuration.AssemblyInfo.get_AssemblyInternal() +142 System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection
compConfig) +334
System.Web.Compilation.BuildManager.CallPreStartInitMethods(String
preStartInitListPath) +203
System.Web.Compilation.BuildManager.ExecutePreAppStart() +152
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager
appManager, IApplicationHost appHost, IConfigMapPathFactory
configMapPathFactory, HostingEnvironmentParameters hostingParameters,
PolicyLevel policyLevel, Exception appDomainCreationException) +1151
[HttpException (0x80004005): Could not load file or assembly
'2017-12-31 19-00 Copy of AjaxControlToolkit' or one of its
dependencies. The located assembly's manifest definition does not
match the assembly reference. (Exception from HRESULT: 0x80131040)]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12881540
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context)
+159 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest
wr, HttpContext context) +12722601

This problem has solved. I deleted the files name
2017-12-31 19-00 Copy of AjaxControlToolkit.dll
2017-12-31 19-00 Copy of Microsoft.Exchange.Management.ControlPanel.dll
2017-12-31 19-00 Copy of Microsoft.Exchange.Management.ControlPanel.OwaOptionStrings.dll
2017-12-31 19-00 Copy of Microsoft.Exchange.Management.ControlPanelMsg.dll
2017-12-31 19-00 Copy of Microsoft.Exchange.PowerShell.RbacHostingTools.dll
2017-12-31 19-00 Copy of Microsoft.Online.BOX.Shell.dll
2017-12-31 19-00 Copy of Microsoft.PowerShell.HostingTools.dll
2017-12-31 19-00 Copy of Web.config
From folder below:
D:\Microsoft\Exchange Server\V15\ClientAccess\ecp\bin
So it's work automatic. If you got error like that but display similar please try to delete (Copy to another folder, in case of problem we need recovery)that file from another folder.
Thanks!!!

Related

Servicestack NLog 4.0.43 error

I am struggling to find the problem, I have removed all ServiceStack components and added again.
When I check the references in my project it is correct.
I also tried to load the latest version Servicestack.NLog 4.0.43
but when I try to add in my project the error below comes up:
I am using the versions:
Servicestack 4.0.43
Servicestack.Logging.NLog 4.0.42
NLog 3.2.0.0
I can build the application, but it shows the error below:
Could not load file or assembly 'NLog' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Server Error in '/jobmanager' Application. Could not load file or
assembly 'NLog' 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 'NLog' or one of its dependencies. The located assembly's
manifest definition does not match the assembly reference. (Exception
from HRESULT: 0x80131040)
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 'NLog' 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:
[FileLoadException: Could not load file or assembly 'NLog' or one of
its dependencies. The located assembly's manifest definition does not
match the assembly reference. (Exception from HRESULT: 0x80131040)]
[FileLoadException: Could not load file or assembly 'NLog,
Version=3.2.1.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c' or
one of its dependencies. The located assembly's manifest definition
does not match the assembly reference. (Exception from HRESULT:
0x80131040)] System.Reflection.RuntimeAssembly._nLoad(AssemblyName
fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly
locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder,
Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean
suppressSecurityChecks) +0
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName
assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly,
StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean
throwOnFileNotFound, Boolean forIntrospection, Boolean
suppressSecurityChecks) +210
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString,
Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr
pPrivHostBinder, Boolean forIntrospection) +242
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
forIntrospection) +17 System.Reflection.Assembly.Load(String
assemblyString) +35
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String
assemblyName, Boolean starDirective) +122
[ConfigurationErrorsException: Could not load file or assembly 'NLog,
Version=3.2.1.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c' or
one of its dependencies. The located assembly's manifest definition
does not match the assembly reference. (Exception from HRESULT:
0x80131040)]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String
assemblyName, Boolean starDirective) +12496980
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory()
+499 System.Web.Configuration.AssemblyInfo.get_AssemblyInternal() +131 System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection
compConfig) +331
System.Web.Compilation.BuildManager.CallPreStartInitMethods(String
preStartInitListPath, Boolean& isRefAssemblyLoaded) +148
System.Web.Compilation.BuildManager.ExecutePreAppStart() +172
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager
appManager, IApplicationHost appHost, IConfigMapPathFactory
configMapPathFactory, HostingEnvironmentParameters hostingParameters,
PolicyLevel policyLevel, Exception appDomainCreationException) +1151
[HttpException (0x80004005): Could not load file or assembly 'NLog,
Version=3.2.1.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c' or
one of its dependencies. The located assembly's manifest definition
does not match the assembly reference. (Exception from HRESULT:
0x80131040)] System.Web.HttpRuntime.FirstRequestInit(HttpContext
context) +12618692
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context)
+159 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest
wr, HttpContext context) +12458309
This should be fixed with the latest version on MyGet. Since you already have v4.0.43 installed you'll need to clear your NuGet Cache and delete your /packages folder to download the latest version.

How come azure website requires Owin?

I have created a simple WebApi project that doesn't reference MVC and everything and doesn't require Owin or anything that I don't yet understand.
It runs OK on IIS Express, but once I deploy to cloud it says
"Could not load file or assembly 'Microsoft.Owin' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"
There is no reference to Owin anywhere.
OK. I added Owin package, but NuGet has only 2.0.2.0 package at the moment, but for some reason it requires 3.0.0.0.
[FileLoadException: Could not load file or assembly 'Microsoft.Owin' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
[FileLoadException: Could not load file or assembly 'Microsoft.Owin, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +34
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +152
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +77
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +16
System.Reflection.Assembly.Load(String assemblyString) +28
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +38
[ConfigurationErrorsException: Could not load file or assembly 'Microsoft.Owin, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +736
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +217
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +170
System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +91
System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +284
System.Web.Compilation.BuildManager.ExecutePreAppStart() +153
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +521
[HttpException (0x80004005): Could not load file or assembly 'Microsoft.Owin, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9930568
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254
I finally fixed that by
Adding Owin package
Explicitly Owin binding to version 2.0.1.0
Removing Owin from Startup.
But that is something I just don't understand. (Started happening after I updated Visual Studio 2013 to Update 4)
OWIN is the standard interface between .NET web servers and web applications used by Microsoft since they went "fully" open-source with the ASP.NET Web Stack. I think that the OWIN Package became mandatory for ASP.NET WEB.API projects since Visual Studio 2013 Update 4.
You can find more info on OWIN here: http://coding.abel.nu/2014/05/whats-this-owin-stuff-about/

Issue after upgrading Sitefinity 6.3 (Windows Azure Webproject) to Sitefinity 7.0

I have a website developed in Sitefinity 6.3 that is deployed on windows Azure (website deployed in Cloud Service). Now I have upgraded the project to sitefinity 7.0 as mentioned on their migration page.
Project upgraded successfully, and I followied the steps to remove & add References, but then I ran the project & it showed me following error:
Assembly 'Telerik.Sitefinity, Version=7.0.5100.0, Culture=neutral, PublicKeyToken=b28c218413bdf563'
uses 'Microsoft.WindowsAzure.ServiceRuntime, Version=2.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
which has a higher version than referenced assembly
'Microsoft.WindowsAzure.ServiceRuntime, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
Then I installed the Azure SDK version 2.2, then following error was displaying:
Could not load file or assembly 'msshrtmi' or one of its
dependencies. An attempt was made to load a program with an incorrect
format.
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 'msshrtmi' or one of its dependencies. An attempt was made to load a program with an incorrect format.
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 'msshrtmi' could not be loaded.
=== Pre-bind state information ===
LOG: DisplayName = msshrtmi
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: msshrtmi | Domain ID: 2
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/user/Projects/TestTime/Code/From Svn/Unpublished/TestTime/
LOG: Initial PrivatePath = C:\user\Projects\TestTime\Code\From Svn\Unpublished\TestTime\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\user\Projects\TestTime\Code\From Svn\Unpublished\TestTime\web.config
LOG: Using host configuration file: C:\Users\Administrator\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/eaa8f4f5/4dd032f8/msshrtmi.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/eaa8f4f5/4dd032f8/msshrtmi/msshrtmi.DLL.
LOG: Attempting download of new URL file:///C:/user/Projects/TestTime/Code/From Svn/Unpublished/TestTime/bin/msshrtmi.DLL.
ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.
Stack Trace:
[BadImageFormatException: Could not load file or assembly 'msshrtmi' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +34
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +152
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +77
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +16
System.Reflection.Assembly.Load(String assemblyString) +28
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +38
[ConfigurationErrorsException: Could not load file or assembly 'msshrtmi' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +752
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +218
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +170
System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +91
System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +285
System.Web.Compilation.BuildManager.ExecutePreAppStart() +153
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +516
[HttpException (0x80004005): Could not load file or assembly 'msshrtmi' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Web.HttpRuntime.FirstReques
I tried setting following tag in web.config :
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.WindowsAzure.ServiceRuntime" culture="neutral" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-2.3.0.0" newVersion="2.2.0.0" />
</dependentAssembly>
</assemblyBinding
I also copied the related dlls in bin folder & added reference to project.
But nothing seemed to work for me, Please let me know where am I going wrong?
Edit: ------------------------
Thanks [DrewG] for sharing important info.
I followed all the steps as DrewG mentioned. Then I got error when I ran the project in Visual Studio for Post Build task, then I removed that task & Changed following setting in web.config:
<bindingRedirect oldVersion="0.0.0.0-2.3.0.0" newVersion="2.2.0.0"/>
to
<bindingRedirect oldVersion="0.0.0.0-2.5.0.0" newVersion="2.2.0.0"/>
Then it run perfectly, Then I removed the References folder, then It also run perfectly.
Now, I could not recognise wht was fixed by DrewG's steps, but after reverting all the steps it's working correct. I would like to know what might be fixed?
Thanks
I had a similar problem caused from running the project locally. It's trying to load the 64 bit version of that dll (msshrtmi.dll).
Azure is wanting the 64 bit version of the .dll but you either need to use the 32bit version when you run locally or you need to setup a site in IIS with a 64bit app pool to be able to test locally.
I came up with a bit of a hack to get this to work on our azure sites but it has been working before and after an upgrade to Sitefinity 7 so maybe it will help you out.
I copied the 64bit and 32bit msshrtmi.dll files to a folder named References in the same directory as the .sln file. Then I wrote a quick .bat file and added it as a Post Build Task for the project that passes my current build profile.
Note: I have a Build profile with the name "Azure" that I use to update some other settings rather than using Thunder. The Azure build profile is basically just a copy of Release, but I like to test Release builds locally too.
Build task looks like this
call $(SolutionDir)References\AZURE.bat $(ConfigurationName) $(SolutionDir)
AZURE.bat file looks like this
If %1 == Azure echo "Copying 64bit version of msshrtmi.dll"
If %1 == Azure copy %2\References\64\msshrtmi.dll %2\YourProject\Bin\msshrtmi.dll
If NOT %1 == Azure echo "Copying 32bit version of msshrtmi.dll"
If NOT %1 == Azure copy %2\References\32\msshrtmi.dll %2\YourProject\Bin\msshrtmi.dll

IIS can't load dependent DLL

I have created a DLL with C++/CLI in order to wrap some unmanaged C++ code (e.g. boost). This work quite fine as long as I
put all dependent DLLs into one folder and
propagate via %PATH% environment that folder to the IIS (requires a restart of the system).
However Microsoft states that it should be enough to put all dependencies within the bin directory under the application path. This ends up with saying the following:
Server Error in '/' Application.
Could not load file or assembly 'NETLibd.DLL' or one of its dependencies. The specified module could not be found.
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.FileNotFoundException: Could not load file or assembly 'NETLibd.DLL' or one of its dependencies. The specified module could not be found.
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.
Stack Trace:
[FileNotFoundException: Could not load file or assembly 'NETLibd.DLL' or one of its dependencies. The specified module could not be found.]
System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +39
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) +132
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +144
System.Reflection.Assembly.Load(String assemblyString) +28
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +46
[ConfigurationErrorsException: Could not load file or assembly 'NETLibd.DLL' or one of its dependencies. The specified module could not be found.]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +618
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +209
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178
System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +94
System.Web.Compilation.BuildManager.CallPreStartInitMethods() +332
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +677
[HttpException (0x80004005): Could not load file or assembly 'NETLibd.DLL' or one of its dependencies. The specified module could not be found.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9090988
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +97
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +258
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272
I have looked at suggestion from Microsoft and others and adjusted the web.config accordingly. Neither of them worked out for me.
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="/bin;bin/modules;/modules;\modules;bin\modules" />
<dependentAssembly>
<assemblyIdentity name="boost_chrono-vc100-mt-gd-1_52" publicKeyToken="0" culture="neutral" />
<codeBase version="0.0.0.0" href="file:///C:/app/bin/modules/boost_chrono-vc100-mt-gd-1_52.dll" />
</dependentAssembly>
</assemblyBinding>
</runtime>
Is there any possibility to tell the IIS a specific path just for this application, e.g. via web.config. I think on production systems it would not be very wise to make all these libraries via %PATH% systemwide available. At least it would be interesting which DLL could not be found (I know about dependency walker, but due to the fact that all DLLs are in the same directory it does not complain about any missing file).
I wanted to execute function from C++ DLL which resides in subfolder of 'bin', and on IIS i had to add my web application to AppPool with ADMIN rights. After that, it loads without errors, in common AppPool it won't load (execute) properly.

Code behind not being imported when migrating package

I'm upgrading all my SharePoint 2007 solutions to 2010. I am using the "Import SharePoint Solution Package". It doesn't look like it imported the code behind for each User Control (ascx.cs), only each ascx file.
I am getting this error when trying to deploy through Visual Studio and wondering if the missing code would be the reason:
Error 18 Error occurred in deployment step 'Add Solution': Failed to load receiver assembly "MEMS.Internet.CommonControls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7f2e7ac152a7fa3b" for feature "WspImportProject1_Feature1" (ID: e3960e6f-9f48-4e8c-a9ba-bdf25e296757).: System.IO.FileNotFoundException: Could not load file or assembly 'MEMS.Internet.CommonControls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7f2e7ac152a7fa3b' or one of its dependencies. The system cannot find the file specified.
File name: 'MEMS.Internet.CommonControls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7f2e7ac152a7fa3b'
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at Microsoft.SharePoint.Administration.SPFeatureDefinition.get_ReceiverObject()
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].
0 0 WspImportProject1

Resources