asp.net publish problem - asp.net-2.0

My application works fine on localhost. But when I publish it to the server , it throws the exception below.
It was working yesterday, but I added some simple file IO operations to global.asax and some other parts in code, i try to write log to some file in server side ..
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:
[FileNotFoundException: Could not load file or assembly 'MyApplication' or one of its dependencies. The system cannot find the file specified.]
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) +78
System.RuntimeType.PrivateGetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +58
System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +64
System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +51
System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +38

My assumption would be that you haven't marked the target folder as an "application" is IIS, meaning it will be looking in the wrong place for the "bin" folder. You can do this in the IIS manager on the server; the folder should have a "cog" icon, indicating that it knows it is an application. If not: right-click on the folder and go into the properties; there should be a "Create Application" button (or similar). Also verify that ASP.NET is set to 2.0.* (on the ASP.NET tab).
(disclosure: there was a "moderator" flag suggesting this belongs on serverfault, but I disagree: knowing how to get an ASP.NET app working (even on a server) is a development issue)

is MyApplication.dll present in the bin folder? check it or give some details more about how you published the website

Related

Temporary files asp.net resx files, "item with the same key has already been added"

A few weeks back we updated our servers from .NET 4.5 to 4.5.1 and also changed the code to run as "optimzed code"
During the nexcoming release we started to get a wierd error message in the logs (and also the site just crashed)
System.ArgumentException: An item with the same key has already been added.
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalGetSatelliteAssembly(String name, CultureInfo culture, Version version, Boolean throwOnFileNotFound, StackCrawlMark& stackMark)
at System.Resources.ManifestBasedResourceGroveler.GetSatelliteAssembly(CultureInfo lookForCulture, StackCrawlMark& stackMark)
at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
at System.Resources.ResourceManager.GetObject(String name, CultureInfo culture, Boolean wrapUnmanagedMemStream)
at System.Resources.ResourceManager.GetObject(String name, CultureInfo culture)
at System.Web.Compilation.BaseResXResourceProvider.GetObject(String resourceKey, CultureInfo culture)
at System.Web.Compilation.ResourceExpressionBuilder.GetResourceObject(IResourceProvider resourceProvider, String resourceKey, CultureInfo culture, Type objType, String propName)
at System.Web.UI.TemplateControl.GetLocalResourceObject(String resourceKey)
at ASP.masterpages_master_master.__BuildControlbritishLink() in c:\\Workspace\\MyApp\\Admin\\MasterPages\\Master.master:line 39
at ASP.masterpages_master_master.__BuildControlheaderPanel() in c:\\Workspace\\MyApp\\Admin\\MasterPages\\Master.master:line 35
at ASP.masterpages_master_master.__BuildControlform1() in c:\\Workspace\\MyApp\\Admin\\MasterPages\\Master.master:line 27
at ASP.masterpages_master_master.__BuildControlTree(masterpages_master_master __ctrl) in c:\\Workspace\\MyApp\\Admin\\MasterPages\\Master.master:line 1
at ASP.masterpages_master_master.FrameworkInitialize() in c:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\Temporary ASP.NET Files\\admin\\dbad5a18\\4cede7d0\\App_Web_vk3fiqpm.0.cs:line 0
at System.Web.UI.UserControl.InitializeAsUserControlInternal()
at System.Web.UI.MasterPage.CreateMaster(TemplateControl owner, HttpContext context, VirtualPath masterPageFile, IDictionary contentTemplateCollection)
at System.Web.UI.MasterPage.get_Master()
at System.Web.UI.MasterPage.ApplyMasterRecursive(MasterPage master, IList appliedMasterFilePaths)
at System.Web.UI.Page.ApplyMasterPage()
at System.Web.UI.Page.PerformPreInit()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
We are using .resx files for translations, first thought was that we have dublicated keys in the resex files but that wasnt the case. After some hours of investigation we couldnt get a clear picture of what was happening. So we started to recycle the Application Pools and that seamed to solve the problem for now.
We have never seen the problem in our development enviroment (until a few days back) what we did then was to delete all the temporary files
Get-ChildItem “C:\Windows\Microsoft.NET\Framework*\v*\Temporary ASP.NET Files” -Recurse | Remove-Item -Recurse
(as what it concerncs is that the .resx files is beeing compiled with the JIT compiler and saved in temporary files? Is this correct?)
That fixed the error on our development enviroment, so we tried it on one of our production server as well, that fixed the error for a short while, but then camed back. We dont understand how that can work on our development server but not production when we have the same settings and versions of everything on both enviroments (we have compared)
Have someone had similar problems, and if yes, what have you done?
We now have to monitor our servers and see, becuase from time to time the error appears, it's randomly and it dosent give us more information as I have provided here. We have turned on more logging but that dosent give us more to go on.
To clear things out the error now is randomly, we dont know when it appears or why, we dont have any more to go on.
Can it be that the .resex files is beeing compiled differently when "optimized code" is on?
Suggestion what to do?

Moving iis7 to another server. Generic 503 error

I was moving iis to another server and I get a generic service unavailable 503 error. When looking at this error in the log:
IISMANAGER_ERROR_LOADING_PROVIDER_TYPE
IIS Manager could not load type 'Microsoft.Web.Management.PlatformInstaller.Server.PlatformInstallerModuleProvider, Microsoft.Web.Management.PlatformInstaller.Server, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35' for module provider 'PlatformInstaller' that is declared in %windir%\system32\inetsrv\config\administration.config. Verify that the type is correct, and that the assembly that contains the module provider is in the Global Assembly Cache (GAC).
Exception:System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Web.Management.PlatformInstaller.Server, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.Web.Management.PlatformInstaller.Server, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
at System.RuntimeTypeHandle._GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName)
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
at System.RuntimeType.PrivateGetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
at System.Type.GetType(String typeName, Boolean throwOnError)
at Microsoft.Web.Management.Server.AdministrationModuleProvider.GetModuleProvider(String userName, String connectionName)
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].
Process:InetMgr
Connection:VPS2837\VPS2837Admin
Any suggestions? I have tried finding a replacing the C:\Windows\System32\inetsrv\config\administration.config file with 5.0.0.0 instead of 4.0.0.0 for the version of Microsoft web management. Still no luck. Thanks in advice

On a 64-bit machine, cannot run the simplest web application when build on x64 platform (use vb in VS)

My scenario is that, I tried to build a very simple Asp.net web application, actually I did nothing but creating a new project of web (form) application using VB in visual studio 2012. Then, I changed the configuration to build it on x64 platform, and it always failed. But, if I change back to x86 platform, everything is fine. However, I do need a webapplicaiton built on x64.
When building it, no errors, but these warnings,
Rebuild All started: Project: WebApplication_debug, Configuration: Debug x64 ------
vbc : warning BC40010: Possible problem detected while building assembly 'WebApplication_debug': Referenced assembly 'mscorlib.dll' targets a different processor
vbc : warning BC40010: Possible problem detected while building assembly 'WebApplication_debug': Referenced assembly 'System.Data.dll' targets a different processor
vbc : warning BC40010: Possible problem detected while building assembly 'WebApplication_debug': Referenced assembly 'System.EnterpriseServices.dll' targets a different processor
vbc : warning BC40010: Possible problem detected while building assembly 'WebApplication_debug': Referenced assembly 'System.Web.dll' targets a different processor
Then, when I run it, I got,
Could not load file or assembly 'WebApplication_debug, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' 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 'WebApplication_debug, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' 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.
Stack Trace:
[BadImageFormatException: Could not load file or assembly 'WebApplication_debug, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
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 'WebApplication_debug, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' 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) +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
I have tried whatever I can, like setup IIS appPool, etc. No work out.
It sounds like you're trying to load it in a 32-bit webserver.
Change it to Any CPU so it will load on both architectures.
If you build it on a 32bit machine, it is likely that you just don't have the 64bit .Net framework installed.
In addition, the built-in Dev server is also 32bit, so you won't be able to run it there.

"module could not be found" error with C++/CLI component in ASP.NET

I have to include a (managed) C++/CLI component in one of my ASP.NET projects, that references for itself some other (unmanaged) C++ DLLs. Should be no problem - .NET 3.5 is happy when compiling the project, everything seems fine. The C++/CLI component and the other C++ DLLs are compiled by another department as Release version with "Any CPU" in Visual Studio 2005. The VC++ 2005 Redistributable package is installed. And the same code works without problem when I run it inside of a normal .NET console application.
Now while this code works in a console app, it's not being hosted correctly by ASP.NET - it leads an error on the initial page load (even before stepping into the Global.asax).
For testing and debugging, I have used two machine configurations:
Local Dev PC: Windows XP, 32 Bit, VC++ 2005 Redist Package, Visual Studio 2010, ASP.NET 3.5, Compiling "Any CPU", Hosting in Web Development Server (Cassini)
Test Server (target machine): Windows 7, 64 Bit, VC++ 2005 Redist Package, Hosting in IIS 7, AppPool has "Enable 32-Bit Applications" set
On both machines the same following error occurs when I start the ASP.NET application:
Exception Details: System.IO.FileNotFoundException: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
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: The specified module could not be found. (Exception from HRESULT: 0x8007007E)]
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: The specified module could not be found. (Exception from HRESULT: 0x8007007E)]
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.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +40
System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +160
System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +93
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
Now this is weird... It doesn't say anything about what assembly is missing, even Fuslogvw.exe or sxstrace.exe aren't logging anything.
Moreover of coures it seems that the error depends on the C++/CLI assembly or on the unmanaged C++ DLLs. If I remove the C++/CLI assembly reference from my ASP.NET project and the code, it works fine. Now because the C++/CLI assembly depends on native C++ DLLs that are not referenced in the ASP.NET project, I copied all dependent C++ DLLs to the "bin" folder of the ASP.NET project's output folder (same as for the workgin console application). While every C++ stuff has been compiled in Release mode, with the correct VC++ Redist Package installed, there should be all dependencies in place. Of course I know there is a FileNotFoundException, but I cannot work out what's missing...
As said: the same code for accessing the C++/CLI component works in a .NET 3.5 console application on both test PCs (where I have the same dependencies deployed) with the same dependent C++ DLLs deployed into the output folder, just in ASP.NET I get the above error.
Any suggestions how I can get rid of the problem or how I can track it further?
(Of course I searched StackOverflow and Google for the problem, e.g. I found these links, but they didn't help:
- "The specified module could not be found" error when running C# ASP.NET web service referring C++ dll
- Access x86 COM from x64 .NET
- ASP.NET application developed in 32 bit environment not working in 64 bit environment
- Module Not Found Exception From .NET 2.0 Web Service On Windows Server 2008 R2 )
ProcMon saved me.
The path was my problem too. It seems that IIS is creating a shadow copy of each managed dll in C:\Windows\System32\inetsrv folder. But this in not the case for unmanaged code. When it has to load an unmanaged dll, it search the environmental path and not the bin directory of the application in IIS.
Many thanks Aristos!!
Your code reach the _nLoad and this is good because have pass all checks for loading and move to the core to actually load the dll, and there its fail.
For start download the Dependency Walker
from http://www.dependencywalker.com/ and use it on dll to find out what other resource this dll needs to run. I suspect that can not load some other dll files.
Additional maybe this dll search for other files that can not find and thats why can not load. The second way is to use the File Monitor, or the Process Monitor from sysinternals to find what fail to load.
http://technet.microsoft.com/en-us/sysinternals
http://technet.microsoft.com/en-us/sysinternals/bb896645

"The specified module could not be found" error when running C# ASP.NET web service referring C++ dll

I have C# ASP.NET web service project in visual studio 2005 which refers a C++ dll. But when I try to run the web service I get the following error which is shown in the web browser:
The specified module could not be found. (Exception from HRESULT: 0x8007007E)
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: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
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: The specified module could not be found. (Exception from HRESULT: 0x8007007E)]
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: The specified module could not be found. (Exception from HRESULT: 0x8007007E)]
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.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +83
System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath) +10
System.Web.UI.WebServiceParser.GetCompiledType(String inputFile, HttpContext context) +43
System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath) +180
System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +193
System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +93
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
However I refer the same dll for windows form application in the same solution and it is working fine. For this windows application to work I used Dependency Walker software to resolve few dependencies of the dll. But I can't figure out how to resolve this error when I try to run the web service. My operating system is Windows 7 Ultimate 64 bit
Can I know why I m getting this error and how to resolve this ?
thanks
My guess is your C++ dll is likely unmanaged code.
The C++ dll you're refering, it's compiled in 32bit or 64?
The windows app works because you're
launching the process.
The web app is running within
the web server's application pool
which is set to run in either 32 bit
or 64.
In IIS Manager, select Application
Pools. In the list of Application
Pools, select the application pool you
have configured for your web app. In the Actions
pane, select Advanced Settings under
Edit Application Pool. Expand the
General settings, set Enable 32-bit
Applications to True, and click OK.
In my case I am trying to deploy via clickonce a C# program that calls a managed C++ dll that calls an unmanaged dll. The error was that the reference or assembly [managed dll] or one of its prerequisites couldn't be loaded, and the second line said that it couldn't be found, even though I could see the dll in the application files in the deployed folder. The link below mentioned that the correct redistributable package might not be installed on the target machine, and this was the case. The ClickOnce Prerequisites popout menu allows to select, in my case, the Visual C++ "14" Runtime Libraries (x86). Upon installing the newly built application, the installer asks the user to download this software, and after that I could run the application on the target machine.
https://social.msdn.microsoft.com/Forums/vstudio/en-US/2736bd39-56dc-46bb-8222-f8b1d0b93255/urgent-unable-to-load-dll-the-specified-module-could-not-be-found?forum=netfxbcl

Resources