Could not load file or assembly - when all dependency present and all sign present and assembly loading to GAC - deployment

I try to deploy COM-object to my server, I have deployed to this server a lot of objects and always all going fine, but not at this time.
Firstly, COM-object registered successfully and ProgID is present.
Secondary, all dependency is present and loading successfully.
Third point, I checked all sign and all sign is present.
Forth point I add all library to GAC.
Test is ordinary and no matter, this is simple call my COM-object.
It's look as all checkpoint done and test must be working. However, I see error
Could not load file or assembly 'HtmlRenderer.PdfSharp, Version=1.5.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)
I can not understand this trouble. What going wrong?

Related

VS2013 cannot load ajaxcontroltoolkit

I get this error when I try to run a project in VS2013
Could not load file or assembly 'AjaxControlToolkit,
Version=3.0.20820.18620, Culture=neutral,
PublicKeyToken=28f01b0e84b6d53e' or one of its dependencies. Access is
denied.
Most likely, the identity pool you are using to run this application does not have write access to .NET Temp Internet file. Remember you code run under there, not where you have source code. If you grant access to the .NET version/temp file you should be able to run the application. It could be AjaxControlTookit was the first dll it is loading hence throwing that exception but not an issue with the ddl itself.

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Xrm.Client

I am stuck on this exception already for two days.
I am using MS CRM 2011, and got this exception when I try to register CRM custom worklow activity assembly
1. through pluginregistrator tool,
2. or when I deploy the plugin though package project in Visual Studio and after it run the the workflow, and it stops with waiting status, in the details page giving this expcetion. Here is the detailed exception:
Workflow paused due to error: Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Xrm.Client, Version=5.0.9688.1154, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
at ArmenianSoftware.Crm.Spayka.ArmsoftIntegration.Workflows.CreateWorksByPlan.Execute(CodeActivityContext executionContext)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
I am registering assembly on the file system, I have loaded all needed assemblies in the folder %system root%\C$\Program Files\Microsoft Dynamics CRM\Server\bin\assembly. This workflow worked some time, but after I don't know what, next time I deployed the assembly, I got this exception when executing the workflow. This is already third time I am coming across this problem, and spoiling several hours trying to do different things (IIS reset, Async Service restarts, reloading all the assemblies again and redeploying), and after several hours, in a mysterious way, the workflow starts to work. After this works some time, and after some redeployment crashes again. And I can't determine after exactly what steps I solve the problem, and so I spend always several hours on finding out the exception source but to no purpose.
I have looked through some threads in the web but none of them was my case (here are they thread1 , thread2 , thread3)
Have anybody come across this problem? What is the reason of this exception??
Thanks in advance!
I have found the problem in my case!
First thing I have noticed was that the in the Exception the required version of the Microsoft.Xrm.Client assembly was 5.0.9688.1154, but in my project I have the reference to the assembly of version 5.0.9689.1985.
And the next thing was the open ildasm tool, and look what referenced does it have, I opened my custom workflow assembly and I've found that I have two references to Microsoft.Xrm.Client,
first of version 5.0.9688.1154, and the second: 5.0.9689.1985
And a question arose "If I have referenced a assembly the version of wich is 5.0.9689.1985, why there is another version of this assembly? ". And the answer was, definitely, that I had another referenced assembly, which referenced Microsoft.Xrm.Client assembly with version 5.0.9688.1154. I have looked through the assemblies I have reference to in my project. And GOTCHA! In my project I have updated the SDK asseblies to a newer version, but I also had the generated CRM organization Proxy classes assembly, which references Microsoft.Xrm.Client, and I haven't updated this reference to a newer version of CRM SDK. So my custom workflow assembly also needed this version. I changed the references of Proxy dll to newer version, and everything went OK!
If you are reading this post, and you don't have proxy assembly, check your other assemblies, if they all reference the same version of the CRM SDK, if not correct them!
Regards
Gagik Kyurkchyan

Webconfig error with the site online

I'm trying to publish a web site.
The publication works perfectly, but when I try to access the address it returns me the following error:
Parser Error Message: Could not load
file or assembly
'Microsoft.Web.Helpers' or one of its
dependencies. This assembly is built
by a runtime newer than the currently
loaded runtime and cannot be loaded.
Source Error:
Line 293:
Line 294:
Line 295: Line 296:
Line
297:
Source File:
C:\Windows\Microsoft.NET\Framework\v2.0.50727\Config\web.config
Line: 295
Assembly Load Trace: The following
information can be helpful to
determine why the assembly
'Microsoft.Web.Helpers' 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].
This does not happen when I'm running on the local site.
The application was developed and Sql Server WebMatrix Compac 4
If you read the error message it says "Could not load file or assembly 'Microsoft.Web.Helpers' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded." If you then look at the version of the ASP.NET that this site is attempting to run under, it is ASP.NET Version:2.0.50727.4209.
Web Pages and the Web Helpers library need Version 4.0. Make sure the site targets the correct version of ASP.NET.
For missing assemblies a simple solution is to just bundle them with your project.
Go to your project -> references -> find this microsoft web helpers ref -> open the properties panel and set Copy Local to True
Edit: Also try setting assembly binding logging.
I suspect that your web.config is fine and that there is an assembly missing from your deployment.
You probably have to include microsoft.web.helpers in your deployment package or simply copy it to the bin folder.
You might find that there are other assemblies missing but you should be able to pick them off one by one.
There is a previous question Hosting WebMatrix Page
that lists all of the dlls you have to deploy and also suggests using Webdeploy

Uninstalling an in-use shared assembly leaving WinSxs in a bad state

I am having troubles uninstalling a shared win32 SxS assembly using Wix3 on WinXP. My wix file looks pretty much like the one described in http://n2.nabble.com/Tutorial-How-to-install-files-into-WinSxS-td841475.html.
The problem is, if a module from the assembly is in use, the uninstaller completes with a success errorcode but leaves the assembly in a broken state: the manifest and security catalogue have been deleted, but the assembly directory still exists with my dlls in it. The DLLs survive reboots, so are not marked for deletion in any way. There are no obvious errors in the MSI log file.
If I try re-installing the package, it skips installation of the assembly. The components are no longer registered, so I can't get Installer to try uninstalling again. The following is shown in the msi log on subsequent installs:
MSI (c) (98:44) [11:46:56:263]: skipping installation of assembly component: {26A273E7-7F9A-4F77-9FA8-5E413A155BEC} since the assembly already exists
I can't find a way of bringing the SxS back into a good state short of manually deleting my assembly's directory, which at this point is no longer being protected by XP System Restore.
While my actual installer is much more complicated, I have been able to reproduce this with a very basic installer that has a single feature containing a single component. That component contains a dll, a manifest and a security catalogue. The dlls <File> element has KeyPath, Assembly and AssemblyManifest attributes set. Once installed, I can simulate a process loading the assembly by opening the DLL in MSVS.
Is there an extra action I should be invoking on uninstall to detect and prevent this situation? Alternatively, is there a way of forcing the install operation to be performed even though the DLLs already exist in WinSXS?
Somewhat related, I also have a problem if I try to upgrade the package that installed the assembly if the assembly is not changing. The installer decides that it does not need to reinstall the assembly (since it has not changed), but then when the SxsUninstallCA runs, it goes and removes the assembly. From Installer's point of view, the component is still installed, but the files are gone.
I'm working on something which I believe I'll run into this same problem.
My assumption at this point is that I’d have to solve this with a little mojo from the HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations regkey, and a possibly bit of file permission smacking (if the files were still locked).
Which of course, requires a reboot.
Of course, in your installer, you could check for the presence of the keys and block on install until they're gone. (ie "you need to reboot").

WCSF Random assembly manifest definition does not match assembly ref in .NET 2.0

I'm running WCSF Feb 2008 along with Enterprise Library 3.1 and noticed that randomly I get the "fun"
Could not load file or assembly Microsoft.Practices.EnterpriseLibrary.Common, Version=3.1.0.0, Culture=neutral, Public ... The located assembly's manifest definition does not match the assembly reference.
Usually this wouldn't be worth mentioning on stackoverflow, but the strange thing is that the first time I fire this up it breaks, but if I close it down and simply hit F11 again - it works .... strange. Does anyone know why this might break sometimes, but not others?
The problem was related to my version of the data access DLL I was adding. I found that if I went to the following:
C:\Program Files\Microsoft Web Client
Software Factory February
2008\Microsoft Practices Library
and imported this specific data access DLL instead of the one I compiled myself from the Enterprise Library 3.1 installer, everything worked great.