My machine:
Windows XP (x86), VS2008, .net 3.5, sql server 2005, WinForms -> App works fine.
Production Machines: Windows 7 (x64), SQl Server 2005 Express -> App Starts but throws exception
Visual Studio Targeting x86 on setup project and RMO project. Visual Studio gives me a a couple warnings but I can still build:
Unable to find dependency 'MICROSOFT.SQLSERVER.MANAGEMENT.SQLPARSER' (Signature='89845DCD8080CC91' Version='10.0.0.0') of assembly 'Microsoft.SqlServer.Smo.dll'
Unable to find dependency 'MICROSOFT.SQLSERVER.MANAGEMENT.SQLPARSER' (Signature='89845DCD8080CC91' Version='10.0.0.0') of assembly 'Microsoft.SqlServer.Management.SmoMetadataProvider.dll'
This is a simple RMO (Replication Management Objects) app that initiates a pull subscription in SQL Server 2005 and displays status. Works fine on my machine, but fails on the production machine. I'm using a setup project to install the app on the production machine, but I think I'm missing a dependency somewhere, but I can't figure it out.
On the production machine the app starts fine, but when I try to synch the subscription i get:
System.IO.FileNotFoundException: The Specified module could not be found. (Exception from HResult: 0x8007007E)
EDIT: Task Manager in Win 7 inditcates that it is running as a 32-bit app (myapp.exe *32).
EDIT: Ok, my app is now showing in task manager that it is a 64 bit app, but I'm getting an error. I'm thinking that I some how have a dependency dll targeting x86. How can I verify the dependency dll is targeting the correct platfrom and/or make sure that it is targeting x64... I thought the setup prjoect would rebuild the dll in my detected dependencies to target whatever cpu I chose in the setup project?
Could not load file or assembly 'Microsoft.SqlServer.Replication, Version=10.0.0.0, Culture-neutral, PublicKey Token=89845dcd8080cc91' or one of its dependencies. An attempt to was made to load a program with an incorrect format.
run Fusion Log viewer as administrator and set it to Log Bind Failures to Disk.
that way you'll be able to see which DLL's don't load properly.
I thought the setup prjoect would rebuild the dll in my detected dependencies to target whatever >cpu I chose in the setup project
the setup does not compile any dlls for you automatically.
An attempt to was made to load a program with an incorrect format.
look here, on where to find an x64 version of 'Microsoft.SqlServer.Replication'
http://social.msdn.microsoft.com/Forums/en/sqlreplication/thread/628ec2ae-c5d1-4aef-b31b-b889975bfc2b
Related
I get the "Could not load file or assembly xxx or one of its dependencies*********" error when I host my website on a Windows Server 2012 (IIS 8). The xxx here is my project name in my local VS 2015. The application is working perfectly fine in my local PC
It is a VB.NET application with Oracle 12c database as it's backend.
Things I have tried till now.
1. Publish with setting the Target CPU as "Any CPU" and Configuration as "Release-Any CPU" - Still the same error.
2. In the Server IIS, I have set the Enable 32-but apps as True on App's App pool. This is giving a different error. - Could not load file or assembly 'Oracle.DataAccess' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Please help.
It sounds like your Oracle.DataAccess dll is a 64 bit dll. You can see what driver is loaded on the web server by navigating in Windows Explorer to the \windows\assembly folder.
Most applications that are built with the Any CPU option will have the checkbox in the project settings to prefer 32 bit. To avoid this, change your project's platform target to be a 64 bit.
Then you do not need to "Enable 32 bit" in your application pool and your problem should disappear. Please let me know if this helps.
I am creating a Windows Form application and trying to debug it.
It displays the following error:
error while trying to run project could not load file or assembly or
one of its dependencies
I updated and repaired my Visual Studio but error is same.
When I go to bin\debug and try to run .exe it shows this error:
the application was unable to start correctly (0xc000007b)
0xc000007b means STATUS_INVALID_IMAGE_FORMAT, this is an indication that your x86 application tries to load an x64 dll, or that your application target is x64, to check this you can look in the Project properties->Build->Target Platform
If your platform target is not x64 you can check your application dependencies with Dependency Walker and look if one or more of them is a 64 bit dll.
I'm getting the 'An attempt was made to load a program with an incorrect format' error when trying to run a program using 32 bit version of the chilkatdotnet4 dll.
I have tried this: (setting the IIS app pool to allow 32 bit programs):
I get a "An attempt was made to load a program with an incorrect format" error on a SQL Server replication project
(Installed IIS first)
And the answer further down the page by Mazhar Karimi.
This: (changing the cpu target within VS):
Change target CPU settings in Visual Studio 2010 Express
This: (placing the chilkat library into the GAC for 32 bit!):
http://www.chilkatforum.com/questions/114/64bit-could-not-load-file-or-assembly-chilkatdotnet4-or-one-of-its-dependencies-an-attempt-was-made-to-load-a-program-with-an-incorrect-format
And finally, going into the .csproj file itself in notepad and changing the Platform Target (and anything else that mentioned platform) into x86.
Edit: I have also tried going into the .dll properties and clicking 'unblock'.
After every change I have saved, built, uninstalled and reinstalled my program (c# windows service)
I am STILL getting this error!
Any ideas?
After changing your windows service to x86 this will change the build directory to
..ProjectName\bin\x86\debug
Make sure your windows service is pointing at this directory otherwise you will be running your old (any CPU) version of the service.
If you service is not pointing at this x86 directory, uninstall and reinstall the service for the new directory
I need this for the build server - I'd like to avoid installing full Visual Studio there.
I use the newest v12 MSBuild to build the solution with the app. Installing .NET Framework 4.5.1 and Windows 8.1 SDK got me through several compilation errors. With all that installed, right now, I get this:
error MSB4019: The imported project "C:\Program Files
(x86)\MSBuild\Microsoft\WindowsXaml\v12.0\Microsoft.Windows.UI.Xaml.CSharp.targets"
was not found. Confirm that the path in the declaration is
correct, and that the file exists on disk.
The targets file is present on my development machine with Visual Studio 2013 installed, so I guess it got there with VS 2013. When I tried to paste the whole folder to the build machine (I know, a stupid thing to do), I got the following compilation warnings and errors:
warning MSB3644: The reference assemblies for framework
".NETCore,Version=v4.5.1" were not found. To resolve this, install the
SDK or Targeting Pack for this framework version or retarget your
application to a version of the framework for which you have the SDK
or Targeting Pack installed.
XamlCompiler error WMC1006: Cannot
resolve Assembly or Windows Metadata file 'System.Runtime.dll'
Xaml Internal Error error WMC9999: Type universe cannot resolve assembly:
System.Runtime, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a.
Obviously, copying and pasting stuff around is not a way to go. Is there some proper approach to achieve what I want?
EDIT: The build machine has Windows Server 2012 installed, not Windows 8.1. Could that be a problem?
EDIT 2: After comparing outputs of msbuilds executed both on development machine and build server, I've noticed that the folder C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5.1 is missing from the build machine (there is only 4.5 folder). After pasting it, I got the following error:
CompileXaml error WMC9998: XBF generation failure due to missing
Windows 8.1 Support, Set property
<DisableXbfGeneration>true</DisableXbfGeneration> in your Project file
and try again.
There is still something missing from the Windows 8.1 toolchain...
Since it's a windows store app, and Windows Server 2012 doesn't have an app store, I'd say the libraries needed in order to compile the app are just missing from the OS itself. I suggest running tracer on a windows 8.1 box to see what files are accessed during compilation, and copy them to the server. I'm not certain that this will work, but it's the likeliest scenario I can think of. You can use something like Process Monitor for this
See what files/registry keys are being accessed by application in Windows
Alternatively, you might want to monitor the temporary build folder in .net to see what assemblies get copied locally during the build.
EDIT: Microsoft doesn't officially support this http://msdn.microsoft.com/en-us/library/windows/apps/br211384.aspx
Did you download and install Microsoft Build Tools 2013 on the build server? The v12 version of MsBuild is now released as part of Visual Studio (instead of the Microsoft.NET Framework) and you'd want to use this separate install to get the MsBuild v12 bits on your build server.
I just did this a few weeks ago for a Windows 8 store app so it should be the same for Windows 8.1. As long as the build machine is running Windows 8.1, All you should need to do is install the latest Visual Studio Express for Windows Store Apps on the build machine and you should be fine. It should install everything you need.
I am using visual studio 2010 and have installed mvc 4. When debugging using the vs development server the sample web application works perfectly but if i try to debug with IIS i get the following error:
Could not load file or assembly
'Microsoft.VisualStudio.QualityTools.HostAdapters.ASPNETAdapter,
Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or
one of its dependencies. The system cannot find the file specified.
I do not have any references to quality tools in web.config, have tried to add them but still did not work. I also tried o use the aspnet_regiis tool just in case.
i have also tried to target different x64 or x86 platform but it did not make a difference.
My dev machine is windows 7 64 bit
You can find an answer here
This error is caused by mixed development environment. That means you
have build the service with .NET 4 at he x64 machine and somebody else
is trying to host the service at his x86 development machine
If it doesn't work, check that the target framework is 4.0