NHibernate Version Issue - nhibernate

I'm having a go at getting a test project up and running. I've nabbed a load of code from this article.....
Fluent NHibernate Automap with NHibernate Facility in ASP.NET MVC
Problem is that I'm getting the following error....
Could not load file or assembly 'NHibernate, Version=3.0.0.1001,
Culture=neutral, PublicKeyToken=aa95f207798dfdb4' or one of its
dependencies. The located assembly's manifest definition does not
match the assembly reference. (Exception from HRESULT: 0x80131040)
I've downloaded all the latest and greatest from NHibernate, Castle Project, and FluentNHibernate. I've looked at the version of the NHibernate.dll that I am referencing in the project and it's 3.0.0.400. Where and why is the solution complaining about 3.0.0.1001??????
For future use, I'd like to know how I find out what the problem is as well as the solution if possible.
Many thanks,
ETFairfax
MORE INFO.......
Exception Details: System.IO.FileLoadException: Could not load file or
assembly 'NHibernate, Version=3.0.0.1001, Culture=neutral,
PublicKeyToken=aa95f207798dfdb4' or one of its dependencies. The
located assembly's manifest definition does not match the assembly
reference. (Exception from HRESULT: 0x80131040)
Source Error:
Line 45: if (container == null)
Line 46: {
Line 47: container = new WindsorContainer()
Line 48: .Install(
Line 49: Configuration.FromAppConfig(),
Source File: C:\Users\Public\Documents\TestCompany\Source\TestCompany.TestModule\MvcApplication2\Global.asax.cs Line: 47
Assembly Load Trace: The following information can be helpful to determine why the assembly 'NHibernate, Version=3.0.0.1001, Culture=neutral, PublicKeyToken=aa95f207798dfdb4' could not be loaded.
=== Pre-bind state information ===
LOG: User = ETFairfax-TestCompany\ETFairfax
LOG: DisplayName = NHibernate, Version=3.0.0.1001, Culture=neutral, PublicKeyToken=aa95f207798dfdb4
(Fully-specified)
LOG: Appbase = file:///C:/Users/Public/Documents/TestCompany/Source/TestCompany.TestModule/MvcApplication2/
LOG: Initial PrivatePath = C:\Users\Public\Documents\TestCompany\Source\TestCompany.TestModule\MvcApplication2\bin
Calling assembly : ClassLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\Public\Documents\TestCompany\Source\TestCompany.TestModule\MvcApplication2\web.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: NHibernate, Version=3.0.0.1001, Culture=neutral, PublicKeyToken=aa95f207798dfdb4
LOG: Attempting download of new URL file:///C:/Users/ETFairfax/AppData/Local/Temp/Temporary ASP.NET Files/root/25bf06cc/f1f41498/NHibernate.DLL.
LOG: Attempting download of new URL file:///C:/Users/ETFairfax/AppData/Local/Temp/Temporary ASP.NET Files/root/25bf06cc/f1f41498/NHibernate/NHibernate.DLL.
LOG: Attempting download of new URL file:///C:/Users/Public/Documents/TestCompany/Source/TestCompany.TestModule/MvcApplication2/bin/NHibernate.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Revision Number
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
Stack Trace:
[FileLoadException: Could not load file or assembly 'NHibernate, Version=3.0.0.1001, Culture=neutral, PublicKeyToken=aa95f207798dfdb4' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
System.RuntimeTypeHandle._GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName) +0
System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +64
System.RuntimeType.PrivateGetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +58
System.Type.GetType(String typeName) +50
Castle.Facilities.NHibernateIntegration.NHibernateFacility.RegisterDefaultConfigurationBuilder() +133
Castle.Facilities.NHibernateIntegration.NHibernateFacility.RegisterComponents() +29
Castle.Facilities.NHibernateIntegration.NHibernateFacility.Init() +196
Castle.MicroKernel.Facilities.AbstractFacility.Init(IKernel kernel, IConfiguration facilityConfig) +61
Castle.MicroKernel.DefaultKernel.AddFacility(String key, IFacility facility) +182
Castle.Windsor.WindsorContainer.AddFacility(String key, IFacility facility) +49
Castle.Windsor.Installer.DefaultComponentInstaller.SetUpFacilities(IConfiguration[] configurations, IWindsorContainer container) +242
Castle.Windsor.Installer.DefaultComponentInstaller.SetUp(IWindsorContainer container, IConfigurationStore store) +89
Castle.Windsor.WindsorContainer.Install(IWindsorInstaller[] installers) +268
MvcApplication2.MvcApplication.InitializeWindsor() in C:\Users\Public\Documents\TestCompany\Source\TestCompany.TestModule\MvcApplication2\Global.asax.cs:47
MvcApplication2.MvcApplication.Application_Start() in C:\Users\Public\Documents\TestCompany\Source\TestCompany.TestModule\MvcApplication2\Global.asax.cs:62
Version Information: Microsoft .NET Framework Version:2.0.50727.4952; ASP.NET Version:2.0.50727.4955

Fluent was probably built with a later version than the NHibernate asselbly you downloaded.
Theres a bundle of Fluent/NH3.0 at Fluent NHibernate website.
http://fluentnhibernate.org/downloads

Related

Could not load file or assembly 'MvcSiteMapProvider

I added the provider via nuget console Install-Package MvcSiteMapProvider.MVC4.
The install looked good:
Successfully added 'MvcSiteMapProvider.MVC4 4.6.22' to XYZ.
When I execute the application I get this error message any suggestions on troubling shooting?
Server Error in '/XYZ' Application.
Could not load file or assembly 'MvcSiteMapProvider, Version=4.6.22.0, Culture=neutral, PublicKeyToken=1923abe4657913cc' 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 'MvcSiteMapProvider, Version=4.6.22.0, Culture=neutral, PublicKeyToken=1923abe4657913cc' 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 'MvcSiteMapProvider, Version=4.6.22.0, Culture=neutral, PublicKeyToken=1923abe4657913cc' 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 'MvcSiteMapProvider, Version=4.6.22.0, Culture=neutral, PublicKeyToken=1923abe4657913cc' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs) +0
System.Reflection.CustomAttribute.CreateCaObject(RuntimeModule module, IRuntimeMethodInfo ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs) +38
System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent) +571
System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType) +103
System.Reflection.RuntimeAssembly.GetCustomAttributes(Boolean inherit) +37
Owin.Loader.DefaultLoader.SearchForStartupAttribute(String friendlyName, IList1 errors, Boolean& conflict) +106
Owin.Loader.DefaultLoader.GetDefaultConfiguration(String friendlyName, IList1 errors) +46
Owin.Loader.DefaultLoader.LoadImplementation(String startupName, IList1 errorDetails) +75
Owin.Loader.DefaultLoader.Load(String startupName, IList1 errorDetails) +21
Microsoft.Owin.Host.SystemWeb.OwinBuilder.GetAppStartup() +115
Microsoft.Owin.Host.SystemWeb.OwinHttpModule.InitializeBlueprint() +28
System.Threading.LazyInitializer.EnsureInitializedCore(T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory) +115
Microsoft.Owin.Host.SystemWeb.OwinHttpModule.Init(HttpApplication context) +106
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +534
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +352
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296
[HttpException (0x80004005): Could not load file or assembly 'MvcSiteMapProvider, Version=4.6.22.0, Culture=neutral, PublicKeyToken=1923abe4657913cc' 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) +9947380
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +261
Assuming you actually have the Nuget package installed, that error is most usually an issue with binding redirects in your Web.config. You can try to resolve the issue manually, by finding the appropriate binding redirect and making sure the version numbers are correct. I find it easier to just force remove the package and reinstall it. That will usually fix the problem:
> uninstall-package MvcSiteMapProvider.MVC4 -Force
> install-package MvcSiteMapProvider.MVC4
Make sure your Web.config is not open in your documents pane, or if it is, that you allow it to reload. If you save over it without refreshing from the filesystem after installing a Nuget package, you'll often bork things like binding redirects, leading to this issue.

ImageResizer AzureReader2 Plugin Nuget Error Out of the Box

I am getting an error when installing the ImageResizer AzureReader2 plugin. This is on a fresh install in an empty web project using Nuget to install the ImageResizer packages.
It is very similar to this issue here, but a binding redirect does not seem to fix the issue. I have also tried updating to 3.0 with the same issue.
Here is the stack :
Could not load file or assembly 'Microsoft.WindowsAzure.Configuration, Version=2.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)
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 'Microsoft.WindowsAzure.Configuration, Version=2.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)
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 'Microsoft.WindowsAzure.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.
=== Pre-bind state information ===
LOG: DisplayName = Microsoft.WindowsAzure.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
(Fully-specified)
LOG: Appbase = file:///c:/workspace/CC3.Images/CC3.Images/
LOG: Initial PrivatePath = c:\workspace\CC3.Images\CC3.Images\bin
Calling assembly : ImageResizer.Plugins.AzureReader2, Version=3.4.3.103, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: c:\workspace\CC3.Images\CC3.Images\web.config
LOG: Using host configuration file: C:\Users\steve.westner\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Microsoft.WindowsAzure.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
LOG: Attempting download of new URL file:///C:/Users/steve.westner/AppData/Local/Temp/Temporary ASP.NET Files/root/ae2511c3/bb7d3a9/Microsoft.WindowsAzure.Configuration.DLL.
LOG: Attempting download of new URL file:///C:/Users/steve.westner/AppData/Local/Temp/Temporary ASP.NET Files/root/ae2511c3/bb7d3a9/Microsoft.WindowsAzure.Configuration/Microsoft.WindowsAzure.Configuration.DLL.
LOG: Attempting download of new URL file:///c:/workspace/CC3.Images/CC3.Images/bin/Microsoft.WindowsAzure.Configuration.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Major Version
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
Stack Trace:
[FileLoadException: Could not load file or assembly 'Microsoft.WindowsAzure.Configuration, Version=2.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)]
ImageResizer.Plugins.AzureReader2.AzureVirtualPathProvider..ctor(String blobStorageConnection) +0
ImageResizer.Plugins.AzureReader2.AzureReader2Plugin.Install(Config c) +379
ImageResizer.Configuration.PluginConfig.add_plugin_by_name(String name, NameValueCollection args) +275
ImageResizer.Configuration.PluginConfig.loadPluginsInternal() +402
ImageResizer.Configuration.PluginConfig.LoadPlugins() +102
ImageResizer.Configuration.Config..ctor(ResizerSection config) +546
ImageResizer.Configuration.Config.get_Current() +115
ImageResizer.InterceptModule.get_conf() +36
ImageResizer.InterceptModule.System.Web.IHttpModule.Init(HttpApplication context) +250
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +418
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +336
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296
[HttpException (0x80004005): Could not load file or assembly 'Microsoft.WindowsAzure.Configuration, Version=2.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) +9931880
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34248
I resolved this issue by moving to ImageResizer version 4.0 stack, which at this time is in pre-release and was not showing in the package manager console.
The following command installed everything needed :
Install-Package ImageResizer.Plugins.AzureReader2 -Pre

ASP.NET MVC 4 Website won't start - Could not load type 'System.Reflection.AssemblyMetadataAttribute'

I deployed my ASP.NET MVC 4 web app to a Windows Server 2003 (IIS 6). But it will not start.
Originally I had developed the project for .NET 4.5, but had to rebuild it for .NET4 when I found out that .NET 4.5 is not supported on Windows Server 2003.
This meant removing all the third party references (with NuGet), changing the build target in project properties to .NET4, then adding the references back.
The references were to Ninject, EF and Automapper.
When I try to load a page I get the following error:
Could not load type 'System.Reflection.AssemblyMetadataAttribute' from
assembly 'mscorlib, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089'. 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.TypeLoadException: Could not load type
'System.Reflection.AssemblyMetadataAttribute' from assembly 'mscorlib,
Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
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:
[TypeLoadException: Could not load type
'System.Reflection.AssemblyMetadataAttribute' from assembly 'mscorlib,
Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.]
System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken,
IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs,
Int32 methodInstCount, ObjectHandleOnStack type) +0
System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module,
Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext,
RuntimeTypeHandle[] methodInstantiationContext) +180
System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken,
Type[] genericTypeArguments, Type[] genericMethodArguments) +192
System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord
caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly,
RuntimeModule decoratedModule, MetadataToken decoratedToken,
RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[]
attributes, IList derivedAttributes, RuntimeType& attributeType,
IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean&
isVarArg) +115
System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule
decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount,
RuntimeType attributeFilterType, Boolean mustBeInheritable, IList
derivedAttributes, Boolean isDecoratedTargetSecurityTransparent) +426
System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly
assembly, RuntimeType caType) +103
System.Reflection.RuntimeAssembly.GetCustomAttributes(Type
attributeType, Boolean inherit) +64
WebActivator.AssemblyExtensions.GetActivationAttributes(Assembly
assembly) +113
WebActivator.ActivationManager.RunActivationMethods() +216
WebActivator.ActivationManager.RunPreStartMethods() +28
WebActivator.ActivationManager.Run() +55
[InvalidOperationException: The pre-application start initialization
method Run on type WebActivator.ActivationManager threw an exception
with the following error message: Could not load type
'System.Reflection.AssemblyMetadataAttribute' from assembly 'mscorlib,
Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'..]
System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1
methods) +423
System.Web.Compilation.BuildManager.CallPreStartInitMethods() +306
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager
appManager, IApplicationHost appHost, IConfigMapPathFactory
configMapPathFactory, HostingEnvironmentParameters hostingParameters,
PolicyLevel policyLevel, Exception appDomainCreationException) +677
[HttpException (0x80004005): The pre-application start initialization
method Run on type WebActivator.ActivationManager threw an exception
with the following error message: Could not load type
'System.Reflection.AssemblyMetadataAttribute' from assembly 'mscorlib,
Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'..]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9164848
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +97
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
+258
Any ideas?
EDIT: Website developed using VS2012
Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from assembly mscorlib
Yes, this technically can go wrong when you execute code on .NET 4.0 instead of .NET 4.5. The attribute was moved from System.Core.dll to mscorlib.dll in .NET 4.5. While that sounds like a rather nasty breaking change in a framework version that is supposed to be 100% compatible, a [TypeForwardedTo] attribute is supposed to make this difference unobservable.

Unable to find assembly 'NHibernate.Search

I am getting the following error intermittently on one of our build environments (not on my local machine) - ignore the NH version - I compiled the assembly form source. The app pool is then restarted in iis. I cannot find out where this is originating from. Any ideas?
An unhandled exception occurred and the process was terminated.
Application ID: DefaultDomain
Process ID: 2428
Exception: System.Runtime.Serialization.SerializationException
Message: Unable to find assembly 'NHibernate.Search, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
StackTrace: at System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo assemblyInfo, String name)
at System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor(String objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.AppDomain.Deserialize(Byte[] blob)
at System.AppDomain.UnmarshalObject(Byte[] blob)

The service cannot be activated due to an exception during compilation

I have deployed WCF service on IIS 7 (Windows Server 2008), but I'm getting a strange error:
WebHost failed to process a request.
Sender Information: System.ServiceModel.Activation.HostedHttpRequestAsyncResult/31364015
Exception: System.ServiceModel.ServiceActivationException: The service '/WCFService.svc' cannot be activated due to an exception during compilation. The exception message is: Could not load file or assembly 'IHEC.WS.dll, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG)). ---> System.Configuration.ConfigurationErrorsException: Could not load file or assembly 'IHEC.WS.dll, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG)) ---> System.IO.FileLoadException: Could not load file or assembly 'IHEC.WS.dll, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
File name: 'IHEC.WS.dll, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' ---> System.IO.FileLoadException: Could not load file or assembly 'IHEC.WS.dll' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
File name: 'IHEC.WS.dll'
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].
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
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 System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective)
--- End of inner exception stack trace ---
at System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective)
at System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory()
at System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai)
at System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig)
at System.Web.Compilation.WebDirectoryBatchCompiler..ctor(VirtualDirectory vdir)
at System.Web.Compilation.BuildManager.BatchCompileWebDirectoryInternal(VirtualDirectory vdir, Boolean ignoreErrors)
at System.Web.Compilation.BuildManager.BatchCompileWebDirectory(VirtualDirectory vdir, VirtualPath virtualDir, Boolean ignoreErrors)
at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath)
at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
at System.Web.Compilation.BuildManager.GetCompiledCustomString(String virtualPath)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.GetCompiledCustomString(String normalizedVirtualPath)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String normalizedVirtualPath)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String normalizedVirtualPath)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)
--- End of inner exception stack trace ---
at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result)
Process Name: w3wp
Process ID: 2616
The strange is, that the file IHEC.WS.dll is there in the bin directory.
Moving OP's own answer/comment to Answers
meanwhile I have solved this problem. When I deploy a project with
using Web Deployment Project and set 'Allow this precompiled site to
be updateble' it works fine. But I don't know why