I'm over a domain, reading the path \\machinecap\platform\in.
The platform is a share, wich leads to E:\cappuccino\platform locally. The application is a Windows Service made in C# .NET 2.0, wich make use of FileSystemWatcher to read the path \\machinecap\platform\in for files created and renamed.
I have "Full Control" permissions since \\machinecap\platform (including all sub-dirs), but only this, no access to any folder else in the server (is a Windows Server 2003).
The problem is that when a file arrives at the server, the service fall down, and no (descent) message is logged in Event Viewer. Trying to trace the problem, I made a loggon in the server and tried to run mannually all the steps that the application does. I can create files in the "in" folder, however I cannot delete these files... a error message is shown: "E:\ is not accessible. Access is denied."
Of course I don't have any access to E:\ root folder, only to E:\cappuccino\platform... is this the problem? Do I really have to give read access to E:\ in order I can read E:\cappuccino\platform?
MORE INFO
Exception message:
Unhandled Exception: System.BadImageFormatException: Could not load file or assembly 'Oracle.DataAccess, Version=2.112.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies.
An attempt was made to load a program with an incorrect format.
File name: 'Oracle.DataAccess, Version=2.112.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342'
at TestRiskStore.ArisReportReader.CreateOrRename(Object source, FileSystemEventArgs e)
at System.IO.FileSystemWatcher.CompletionStatusChanged(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* overlappedPointer)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
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].
Please note that I'm using Oracle.DataAccess component.. I think the problem is related to this, not sure.... any idea how to solve this problem?
I've found the problem: my machine is 32 bits, the server is 64 bits, and I was compiling the application to run on any platform. The problem is that the OracleDataAccess components that it was installed on the server is for 32 bits, so the assemblies were installed only on GAC_32 folder. Thus when the application try to run on 64 bits mode it doesn't find the assemblies.
So I just recompiled the application as x86 (32 bits), and it worked. Now the application runs on 32 bit mode and it look for the assemblies in the correct folder.
Related
I recently upgraded my solution from .netframework 4 to 4.7.2 ( It was in VS 2010 and I upgraded it using VS2019) . The solution contains WCF Services and some class library and a mvc 3 website . I had not have issue running my website and it worked without issue . However my other colleagues who got my changes having the following error.
The also recently installed VS 2019 and it is strange that I do not have issue but other have,
The error is below:
Exception Type:
System.ServiceModel.ServiceActivationException, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message:
The service '/Reporting/ReportingService.svc' cannot be activated due to an exception during compilation. The exception message is: The CLR Type 'X.Services.Reporting.WebService.ServiceBehaviours.ReportingServiceHostFactory' could not be loaded during service compilation. Verify that this type is either defined in a source file located in the application's \App_Code directory, contained in a compiled assembly located in the application's \bin directory, or present in an assembly installed in the Global Assembly Cache. Note that the type name is case-sensitive and that the directories such as \App_Code and \bin must be located in the application's root directory and cannot be nested in subdirectories.
Stack Trace:
System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath, EventTraceActivity eventTraceActivity)
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.HandleRequest()
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest()
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.OnBeginRequest(Object state)
System.Runtime.IOThreadScheduler.ScheduledOverlapped.IOCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
System.Runtime.Fx.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped)
System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
This makes me think there might be something that I have on my machine and others don't.
Any suggestion would be much appreciated.
please note
I do not directly use servicehostfactory
public class ReportingServiceHostFactory : UnityServiceHostFactory
{....}
This is how my svc file is
<%# ServiceHost Language="C#" Debug="true" Service="X.Services.Reporting.WebService.RepotingService" Factory="X.Services.Reporting.WebService.ServiceBehaviours.ReportingServiceHostFactory"%>
Any help would be much appreciated!
Thanks,
I found out what the issue is. The issue is the platform after changing the platform from x86 to AnyCPU in all my projects the issue is fixed. I think the reason is that with x86 platform the debug folder is nested in X*^ folder and that caused the isssue
I have tried solutions from the following posts/sites:
Could not load file or assembly Operation is not supported. (Exception from HRESULT: 0x80131515)
Could not load file or assembly in VS2017 with IIS express
Visual Studio "Could not load file or assembly. Operation is not supported" error in Release mode
http://www.clearmindsoftware.com/post/Resolution-Error-Could-not-load-file-or-assembly-file5c5cserver5cpath5cfiledll-or-one-of-its-dependencies-(0x80131515)
Error:
Could not load file or assembly
'file://\[networkdrive]\Programming\Misc
Projects\CSVSerializer\UnitTestProject1\bin\Debug\UnitTestProject1.dll'
or one of its dependencies. Operation is not supported. (Exception
from HRESULT: 0x80131515)
This error occurs when trying to discover tests on my solution on a mapped network drive, on multiple devices, this occurs in vs2015 and vs2017. If I copy the solution and directories to the device itself, it works fine.
What I've tried:
Unblocking file: The DLLs are not blocked
Readonly: Not marked as readonly
loadFromRemoteSources: Enabled on vs2015 & 2017 on all devices
Using UNC paths instead of a mapped drive
Why a network drive?
To keep my project files in a central, redundant, backed up location that I can access from multiple devices without having to pull from source control and rebuild each time. To save space on VMs for large projects and assemblies.
This seems as a supported, and even anticipated way to use a project considering there is a VS flag just for this https://learn.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/runtime/loadfromremotesources-element
Why is this happening? Is there more info for this error? what can I do to troubleshoot the problem?
I have developed an addin for word in vs2010.It's working cool in 32 bit version of office, but its not working on 64bit version of office .Searched a lot and found that
For 64-bit Root\Software\Microsoft\Office\application name\Addins\add-in ID
For 32-bit Root\Software\Wow6432Node\Microsoft\Office\application name\Addins\add-in ID
registry information path's.I tried register the information for 64bit.Even too its not working in 64 bit of office. In 64 bit office my addin was displaying under InActive Application Add-Ins.I even tried enabling it.
How to develop and deploy an addin for 64 bit of office..?
and am getting the following error ..!!
Could not load file or assembly 'xxxxx, 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.
************** Exception Text **************
System.BadImageFormatException: Could not load file or assembly 'xxxxx, 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.
File name: 'xxxxx, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
at MyWord.ThisAddIn.ThisAddIn_Startup(Object sender, EventArgs e)
at MyWord.ThisAddIn.FinishInitialization()
at
Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.ExecuteCustomization.ExecutePhase(ExecutionPhases
executionPhases) at
Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.ExecuteCustomization.Microsoft.VisualStudio.Tools.Office.Runtime.Interop.IExecuteCustomization2.ExecuteEntryPoints()
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].
An attempt was made to load a program with an incorrect format
In 99% of the cases, that just means one thing when this exception is raised in a 64-bit program. The "incorrect format" is a DLL that contains 32-bit code. That cannot work, a 64-bit program can only load 64-bit DLLs.
If you used C# to write that add-in then it is a very simple fix. Right-click the project in the Solution Explorer window, Properties, Build tab. Set the "Platform target" to AnyCPU. Untick the "Prefer 32-bit" checkbox if you see it (VS2012 and up). Repeat this for the Release configuration.
Other possible explanations for this, the unusual cases:
Not having the 64-bit version of the .NET Framework installed
Writing code in the C++/CLI language, you have to build the x64 version
Having a dependency on a 32-bit unmanaged DLL
Accidentally loading the wrong DLL
You'll need SysInternals' Process Monitor to chase these kind of mishaps down. The trace shows you what DLLs the Office program is looking for and in which directories it looked for the DLL. It will be a big trace, work from the bottom of the trace backwards.
Take a look at the Deploying an Office Solution by Using Windows Installer article in MSDN which describes all the required steps in depth. It states the following:
32-bit
HKEY_LOCAL_MACHINE\SOFTWARE(32-Bit)\Microsoft\Office\Excel\Addins\SampleCompany.ExcelAddIn
64-bit
HKEY_LOCAL_MACHINE\SOFTWARE(32-Bit)\Microsoft\Office\Excel\Addins\SampleCompany.ExcelAddIn
HKEY_LOCAL_MACHINE\SOFTWARE(64-Bit)\Microsoft\Office\Excel\Addins\SampleCompany.ExcelAddIn
An installer for 64-bit Windows requires two registry paths because it’s possible for users to run 32-bit and 64-bit versions of Office on a computer that runs 64-bit Windows.
But you may detect (in the custom actions) the bitness of MS Office installed and create keys in the proper hive.
I'm having little problem running my C# application after switching to Windows 8.1 from 8.
The problem is that I get this exception from title and there's not much help online. I tried to pinpoint the problem and it seems like my x64 application is trying to call x86 CSharp library. The reference in project leads to a DLL file, that upon calling x64 dumpbin program with /headers parameter outputs:
Dump of file Microsoft.CSharp.dll
PE signature found
File Type: DLL
FILE HEADER VALUES
14C machine (x86)
3 number of sections
4FFA5C64 time date stamp Mon Jul 09 06:21:56 2012
0 file pointer to symbol table
0 number of symbols
E0 size of optional header
2022 characteristics
Executable
Application can handle large (>2GB) addresses
DLL
Notice the machine is x86, while the application is running in x64 (checked with Environment.Is64BitProcess). This might be the problem I'm facing, however I can't find way to solve it - there seems to be no x64 .Net libraries installed. The only ones I have found are at: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework. Or maybe I'm completely off and there's some other problem. Anyway the exception occurs at startup in one of constructors and full detail is:
Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
"Could not load file or assembly 'Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The module was expected to contain an assembly manifest."
Edit:
While still panicking, I solved this by downloading CSharp.dll and replacing the dummy 0-byte file in path shown in answer by it.
The module was expected to contain an assembly manifest
You've been looking at a reference assembly, it is not the one that's actually loaded when you run your program. Microsoft.CSharp.dll is stored in the GAC, put there by the .NET installer. You can see the file by navigating to c:\windows\microsoft.net\assembly\gac_msil\microsoft.csharp. Keep clicking until you get to the file.
The exception message is a very unhealthy one, it doesn't recognize the DLL as a .NET assembly. There are few decent explanations for that, other than the file being corrupted. File corruption is always bad news, a strong hint that your hard-disk is failing. You'll need to get it fixed, follow-up if necessary at superuser.com
This is a Windows 7 machine with Service Pack 1, and I published a C# WPF application using x86 target platform configuration since it also needs to be installed on XP machines.
The problem I'm dealing with is becoming a nuisance. The application runs fine in Visual Studio 2008 debug mode. After running the setup executable generated from publishing, the installation completes successfully (or at least appears that way), but when it attempts to open, I get the Application cannot be started. Contact the application vendor. message box.
Here is the Error Summary section of the log file:
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of http://ServerPath/MyApplication_Install/Release/x86/MyApplication.application resulted in exception. Following failure messages were detected:
+ Value does not fall within the expected range.
And the Error Details section:
ERROR DETAILS
Following errors were detected during this operation.
* [9/12/2012 8:15:42 AM] System.ArgumentException
- Value does not fall within the expected range.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.NativeMethods.CorLaunchApplication(UInt32 hostType, String applicationFullName, Int32 manifestPathsCount, String[] manifestPaths, Int32 activationDataCount, String[] activationData, PROCESS_INFORMATION processInformation)
at System.Deployment.Application.ComponentStore.ActivateApplication(DefinitionAppId appId, String activationParameter, Boolean useActivationParameter)
at System.Deployment.Application.SubscriptionStore.ActivateApplication(DefinitionAppId appId, String activationParameter, Boolean useActivationParameter)
at System.Deployment.Application.ApplicationActivator.Activate(DefinitionAppId appId, AssemblyManifest appManifest, String activationParameter, Boolean useActivationParameter)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
There are other ClickOnce questions on here that deal with Microsoft.Vbe.Interop, Version=14.0.0.0 - that does appear in this log file under the OPERATION PROGRESS STATUS section, but it doesn't say the assembly needs to be installed in the Global Assembly Cache.
* [9/12/2012 8:45:19 AM] : Detecting dependent assembly Microsoft.Vbe.Interop, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71E9BCE111E9429C, processorArchitecture=msil using Microsoft.Vbe.Interop, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=msil.
* [9/12/2012 8:45:19 AM] : Detecting dependent assembly Microsoft.Vbe.Interop, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71E9BCE111E9429C using Microsoft.Vbe.Interop, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c.
Do I need to remove leftover files/folders from previous installations? That's my gut feeling, but I don't know where to look inside the AppData/Local/Temp or Windows/System32 folders.
Edit
I did some deep digging and found the executable for my application here:
C:\Users\MyUsername\AppData\Local\Apps\2.0\A30V87AA.25Q\PQ06CCDW.CYM\wpfb..tion_41f7e986af356c0c_0004.0004_b15da840f06645a3\MyApplication.exe
It loaded up without any errors. And to confirm this was from the installation, not my source code, I did an uninstall in Control Panel, checked that directory and all the files were gone.
After re-installing from setup.exe, a different set of jibberish folder directories were made, but I was still able to run the application.
So why does the Application cannot be started. Contact the application vendor. message pop up after installation, even though there is a working copy deep inside the AppData directory?
Edit #2
As suggested by jvanh1, I ran as an administrator to see if that made any difference. Unfortunately it didn't.
I was forced to checkout the latest tagged version and do some manual copy/pasting - the subsequent publish actually worked. The more important issue here is that we never have used branching before in our version control (at least not for this application), so I convinced my manager to let me give it a shot.
I will continue to investigate what caused this annoying ClickOnce publish problem in the first place - my guess is different sets of references in the tagged version vs. my working copy.
I encountered a very similar issue, it turns out one of the reference dll was moved but the hintpath wasn't updated. VS didn't warn me, instead it automatically referenced the GAC copy, causing a prerequisite change. I fixed the issue by replacing the GAC reference with local dll reference.