NsisIIS plugin baggage - iis-7

When I invoke NsisIIS on the target machine, I get:
Could not load: C:\Users\goldend\AppData\Local\Temp\nsw48B9.tmp\NsisIIS.dll
DependencyWalker Yields:
LoadLibraryExA("C:\Users\goldend\AppData\Local\Temp\nsx5A94.tmp\NsisIIS.dll", 0x00000000, LOAD_WITH_ALTERED_SEARCH_PATH) returned NULL. Error: The specified module could not be found (126).
I have installed the VS2010 redistributables....

Either install all dependencies (.net framework, VC++ Runtime etc.) before using the plug-in on target machine
or
recompile the plugin (if possible).
I cannot see anything special except activeds.dll. Make sure this dll exists on target machine.

Related

64 bit managed assembly with unmanaged dependencies not loading in IIS / ASP.NET MVC 4

I have an almost empty ASP.NET MVC4 project referencing a 64 bit managed assembly, which has a set of unmanaged dependencies.
The managed assembly is referenced the normal way through references.
The unmanaged dependencies are copied to the bin folder on a post build event - and are present when the web app is started (this has been verified).
The problem is that I get:
Could not load file or assembly 'msvcm80.DLL' or one of its dependencies. A dynamic link library (DLL) initialisation routine failed. (Exception from HRESULT: 0x8007045A)
This is one of the unmanaged dependencies. The full list is:
iconv.dll
lbm.dll
libeay32.dll
msvcm80.dll
msvcp80.dll
msvcr80.dll
The managed dll is built against x64 and all the dependencies are also x64 (verified by using Dependency Walker).
Now I have also created a blank console app, a windows form app and a self-hosted Web Api which contains the the same code (for firing up instances using the managed assembly) and they all work fine (when forcing the build target to be x64).
Using Fusion Log (clearing it first, then loading the web app and refreshing the log viewer), I can see that there are problems loading:
iconv.dll
libeay32.dll
lbm.dll
All of them have similar log files:
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/root/3b2d5b3e/b1b5f1f5/iconv.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/root/3b2d5b3e/b1b5f1f5/iconv/iconv.DLL.
LOG: Attempting download of new URL file:///C:/.../bin/iconv.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\...\bin\iconv.dll
LOG: Entering download cache setup phase.
ERR: Error extracting manifest import from file (hr = 0x80131018).
ERR: Setup failed with hr = 0x80131018.
ERR: Failed to complete setup of assembly (hr = 0x80131018). Probing terminated.
So it actually figures out that the dependencies are in the local bin folder, but it cannot use them for some reason.
What does the error "Error extracting manifest import from file (hr = 0x80131018)." mean?
The dependencies are not in GAC and they are not registered using regsvr32 (not COM).
What puzzles me is that is works fine outside IIS (I even tried to set up the credentials on the app pool to be the same as the local network credentials - which did not make a difference, of course).
Any good ideas of how to debug this issue?
EDIT:
I am now able to run the ASP.NET site on my local developer machine, but not when it is deployed onto another server.
The "fix" for my local machine, was to remove the msvcm80.dll (C runtime) from the bin directory. The assembly is (probably) still needed, but is looked up somewhere else (presumably because I have the "correct" version of CRT (distributable) installed in WinSxS).
Digging into that, I see that the managed assembly is supposedly dependent on msvcm80.dll version 8.00.50727.6195 (x64), but that particular version is not installed on my local system (I only have it in a dependency folder) - but I do have a newer one in WinSxs (8.00.50727.6910).
So which one is IIS picking up when not adding it directly in the bin folder?
2nd EDIT:
So it looks like lbm.dll has a direct dependency to msvcr80.dll, but it also has a dependency to iconv.dll which again has a dependency to msvcr80.dll. However, according to Dependency Walker (depends.exe), those two dependencies are not resolved from the same directory (even when they have the same version!).
If I make sure that the indirect dependency is in the PATH environment variable and the 2nd dependency is in WinSxS it works. This is obviously not good enough, but I cannot figure out how to enforce that the direct and indirect dependency is loaded from a single location/file.
Using a tool like Dependency Walker you will find that lbm.dll and its dependencies only depend on msvcr80.dll and not msvcp80.dll and msvcm80.dll even though these two files are included in the Microsoft.VC80.CRT.manifest used by lbm.dll to load the correct version of the Visual C++ 2005 runtime library.
Removing msvcp80.dll and msvcm80.dll from you bin folder should fix your problem.

Py2app does not include the Sqlite driver- "Database error: Driver not loaded Driver not loaded"

I am having the same issue described in this post on the py2app mailing list.
I have a python application that uses a sqlite database. On my machine, which has all the dependencies installed, there are no issues. However, when I bundle the application with py2app, clicking a menu that causes the database to be accessed results in this error:
Database error: Driver not loaded Driver not loaded
For the Windows installer, the files in \Qt\version\plugins\sqldrivers\*.* can be copied to \myApp\sqldrivers\*
The same files on the Mac can be found in /opt/local/share/qt4/plugins/sqldrivers (installed via Macports).
However, copying the sqldrivers directory to my application's Resources or Frameworks directories still results in the same error.
How can I add sqlite support into my application that is built using py2app?
Turns out the pyside recipe does have a way to specify which qt-plugins you need...
options=dict(py2app={
'argv_emulation': True,
'qt_plugins' : "sqldrivers",
}
),
This puts all the sqldrivers into the right directory and setups qt.conf correctly.
have you tried what he said
in this post ?
py2app setup.py usage question
it mentioned
you need to include the sqlalchemy.dialects.sqlite as a package
I managed to get this to work as follows:
After building with py2app, inside the application's Contents directory, make a new plugins directory.
Then copy sqldrivers/libqsqlite.dylib into this plugins directory.
Afterwards, install_name_tool has to be used to change the library links in libqsqlite.dylib to point to the Qt libraries in the application's Frameworks directory rather than the system Qt libraries.

Why am I getting Could not load file or assembly error on a System.Configuration DLL when using framework 4.0?

Immediately after we upgraded to visual studio 2010 and the 4.0 framework our trunk build started breaking with the Could not load file or assembly error.
We determined that a 3.5 project couldn't reference a 4.0 project else we'd get this error because, as the error states, This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
We've since resolved this and the trunk has been building fine.
I recently did a branch and tag, however, and suddenly this error has resurfaced when I try to build the branch; except the error is regarding one of our own .net 4.0 project's reference to System.Configuration DLL.
Towps.Namespace.MyService.csproj in Core.Dev\Towps\Projetcs\Application\MyService:
RG0000: Could not load referenced assembly
"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll". Caught a BadImageFormatException saying "Could not load file or assembly 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.". in ResGen(0, 0)
I tried setting the specific version property on that system.Configuration DLL ref to true. I can see in it's properties that the runtime version is v4.0.30319 and the Version is 4.0.0.0. The path to the DLL ref is C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\System.Configuration.dll which to me looks fine.
The target framework for the csproj file that CrusieControl is using MSBuild to try to build is targeting framework 4.0. Again seems fine.
It builds in the IDE for both trunk & branch. Cruise Control build it in the trunk. The branch build fails when CrusieControl tries to build.
Any ideas what could be happening?
It could be an MSBuild mismatch but I've scanned the config files and msbuild proj files that CruiseControl is using and there are no references to older MSBuilds; which makes sense since all those were updated to get the trunk working.
The branch was simply a copy of the trunk so I'm having difficulty determining what could be the difference!
It turns out that after I branched, all the .proj files in my branch build directory that cc.net uses were back to using ToolVerison="3.5".
I thought I committed all the ToolsVersion="4.0" proj and config changes to the trunk from which I made the branch; evidentially not.
The difference could easily be hint paths no longer lining up on the new branch. However there's not a log to go on in your description. What are the command line options you are passing? In ccnet.config and also any others that may get in if ccnet.config is pointing at a build script that calls msbuild instead of directly to a .sln or .csproj file.
Turn on /v:d for the msbuild on BOTH and then compare the reference resolutions (or build order, etc..) for that assembly or other ones involved/near it.
Also are you providing the path to msbuild on both?
msbuild4="C:\WINNT\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe"
<msbuild>
<executable>$(msbuild4)</executable>
in your ccnet.config?
I've seen it report the 2.0 build executable during a msbuild4 /tv:3.5:
<Message Text="MSBuildToolsPath:$(MSBuildToolsPath)" />
<Message Text="MSBuildToolsVersion:$(MSBuildToolsVersion)" />
MSBuildToolsPath:C:\WINNT\Microsoft.NET\Framework\v2.0.50727
MSBuildToolsVersion:2.0
so that didn't seem very useful.
I'd like to see the config blocks for both branch and trunk.
I know I had some paths in the buildscript that failed in my branch because there was a hardcoded path that would not be valid for the branch. I had to adjust the ccnet.config to pass in arguments for those items to override for the branch.
Please check .net framework version supported by your client. For example sharepoint2010 will not support dll built by 4.0 or higher .net framework. It will support only 3.5 or below.
A bit late I know, but if anybody else has this issue, try adding the RuntimeVersion into your .dna file if it does not already exist.
<DnaLibrary Name="PROJECTNAME" RuntimeVersion="v4.0">

Mono's XSP webserver can't find MySql.Web.dll on Linux

I'm working on getting my ASP.Net project working on Linux. I've been testing my code using XSP on windows, but now I am trying to make sure that I can develop and test on Linux as well. To that end I've gotten Ubuntu running and have MonoDevelop and MySQL running. I've downloaded the latest MySQL Connector/Net and I think I have it installed correctly.
There is no package that will automatically install the MySQL Connector/Net for distribution so I downloaded the 6.2.3 zip file from the MySQL website. Now I've already discovered the issue with case sensitivity because the zip file contains filenames in lowercase, and Mono expects them in uppercase. So I've changed the names of the files to MySql.Data.dll, and MySql.Web.dll respectively. I've also used gacutil to install both files to the GAC. Likewise I have added the files to the Mono Lib directory. The following files do exist on my machine:
/usr/lib/mono/gac/MySql.Data/6.2.3.0__c5687fc88969c44d/MySql.Data.dll
/usr/lib/mono/gac/MySql.Web/6.2.3.0__c5687fc88969c44d/MySql.Web.dll
/usr/lib/mono/2.0/MySql.Data.dll
/usr/lib/mono/2.0/MySql.Web.dll
I've also created package files so that I can add references to the the assemblies in MonoDevelop. The folder /usr/lib/mono/2.0 contains two .pc files that I added.
MySql.Web.pc:
Name: MySql.Web
Description: ASP Membership, Role and Profile providers powered by MySQL
Version: 6.2.3
Libs: -r:/usr/lib/mono/gac/MySql.Web/6.2.3.0__c5687fc88969c44d/MySql.Web.dll
MySql.Data.pc:
Name: MySql.Data
Description: Provides connectivity to MySQL databases
Version: 6.2.3
Libs: -r:/usr/lib/mono/gac/MySql.Data/6.2.3.0__c5687fc88969c44d/MySql.Data.dll
At this point I can use the assemblies in projects inside MonoDevelop. The Assemblies appear in the list of available assemblies when I edit the project references. The project now compiles without error inside MonoDevelop. However when I run the compiled web project in XSP the following error is displayed in the browser:
System.IO.FileNotFoundException: Could not load file or assembly 'MySql.Web.dll, Version=6.2.3.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D' or one of its dependencies. The system cannot find the file specified.
What is fustrating is that originally the error was that it could not load MySql.Data.dll and now the error message is that it can not load MySql.Web.dll. Which means that I somehow fixed the problem I was having with the Data dll, and now I have the problem with the Web dll. I have gone and re-done I learned to fix the problem for the Data dll, but I am unable to get the Web dll working.
Unfortunately I'm still pretty new to Linux and Mono (but not to ASP.Net) and I've run out of things to try. Likewise I haven't found anything on Google to try other than what has been described above which leaves me asking for help.
Can anyone help me find out why XSP can't find the assembly and what I can do about it?
Thanks,
-Will
You can try setting some environment variables which should tell you where all Mono is looking for assemblies:
MONO_LOG_LEVEL="debug" MONO_LOG_MASK="dll" xsp2
Not a perfect fix (I don't know why its going wrong), but if you're in a hurry, copy MySql.Web.dll to the bin directory of your app.

Qt4Dotnet on Mac OS X

I'm using Qt4Dotnet project in order to port application originally written in C# on Linux and Mac. Port to Linux hasn't taken much efforts and works fine. But Mac (10.4 Tiger) is a bit more stubborn.
The problem is: when I try to start my application it throws an exception. Exception states that com.trolltech.qt.QtJambi_LibraryInitializer is unable to find all necessary ibraries. QtJambi library initializer uses java.library.path VM environment variable. This variable includes current working directory. I put all necessary libraries in a working directory. When I try to run the application from MonoDevelop IDE, initializer is able to load one library, but the other libraries are 'missing':
An exception was thrown by the type initializer for com.trolltech.qt.QtJambi_LibraryInitializer ---> java.lang.RuntimeException: Loading library failed, progress so far:
No 'qtjambi-deployment.xml' found in classpath, loading libraries via 'java.library.path'
Loading library: 'libQtCore.4.dylib'...
- using 'java.library.path'
- ok, path was: /Users/chin/test/bin/Debug/libQtCore.4.dylib
Loading library: 'libqtjambi.jnilib'...
- using 'java.library.path'
Both libQtCore.4.dylib and libqtjambi.jnilib are in the same directory. When I try to run it from the command prompt, the initializer is unable to load even libQtCore.4.dylib.
I'm using Qt4Dotnet v4.5.0 (currently the latest) with QtJambi v4.5.2 libraries. This might be the source of the problem, but I'm neither able to compile Qt4Dotnet v4.5.2 by myself nor to find QtJambi v4.5.0 libraries. Project's page states that some sort of patch should be applied to QtJambi's source code in order to be compatible with Mono framework, but this patch hasn't been released yet. Without this patch application crashes in a strange manner (other than library seek fault).
I must note that original QtJambi loads all necessary libraries perfectly, so it might be issues of IKVM compiler used to translate QtJambi into .Net library.
Any suggestions how can I overcome this problem?
I think I ran into the same problem earlier today. As soon as I copied libikvm-native.dylib from my current Mono to my project's exe directory, it worked. Frank reminded me to do that on the list here.

Resources