Solving Assembly not Found | FileNotFoundException | Fusion Log - c#

I am trying to deploy my solution package (wsp) to SharePoint 2007 environment. The WSP contains a feature which loads the feature receiver class to deploy a timer job at run time.
While deploying this WSP, I am consistently getting
Feature
'fb631f6c-2c46-4ab5-b7b3-f3d0c949c5f0'
could not be installed because the
loading of event receiver assembly
"XXX, Version=1.0.0.0,
Culture=neutral,
PublicKeyToken=bad6857072694970"
failed:
System.IO.FileNotFoundException
I have double checked everything (public key token, assembly name etc) is correct. I have deployed many WSP in past and I am confused why this one is failing.
To debug this , I am using Assembly Binding Log Viewer. I have selected "Log in exception text" and given custom log path. Neither I am getting any log messages and the exception text is consistently giving this message:
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].
Any ideas why this could be happening ? How to enable Assembly Binding Log viewing?

To turn the logging on use Regedit and updated the registry entry in the error message.
It could be that your program requires a dll that is not included in the package.
Sometimes it just needs an IISRESET to realise that the dll is available in the GAC.

Related

GenerateReference error when building C# among us mod

I started with Among Us mod making a few days ago, I set everything up and followed the instructions listed on this page (https://docs.reactor.gg/docs/) and everything worked. I could build my mods and it would work as intended. 2 days ago, out of the blue all of my imports (like the UnityEngine import and other external imports) were throwing 'does not exist in this current context errors' The root of this (I found) was this:
Severity Code Description Project File Line Suppression State
Error MSB4018 The "GenerateReferences" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load file or assembly 'Mono.Cecil, Version=0.11.2.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e' or one of its dependencies. The system cannot find the file specified.
File name: 'Mono.Cecil, Version=0.11.2.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e'
at Il2CppDumper.DummyAssemblyExporter.Export(Il2CppExecutor il2CppExecutor, String outputDir, Boolean addToken)
at Il2CppDumper.Il2CppDumper.PerformDump(String gameAssemblyPath, String metadataDatPath, String outputDirectoryPath, Config config, Action`1 reportProgressAction)
at Reactor.OxygenFilter.MSBuild.GenerateReferences.Execute() in /home/js6pak/Development/AmongUs/Reactor.OxygenFilter/Reactor.OxygenFilter.MSBuild/GenerateReferences.cs:line 56
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext()
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].REDACTED.REDACTED]
I have tried reimporting, and redoing everything from scratch (like redownloading BepinEx, Reactor, Among Us) and have also tried building a fresh project, but even new projects don't seem to build. Is there something wrong on my part?
Turns out, I had to downgrade my Among Us version. The way I downgraded the version was using Docker, but I suppose any other way could work.

Could not load file or assembly 'LinqToExcel, Version

I am trying to read an xlsx file.
I got exception that
The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine. c#
then I installed it from here
http://www.microsoft.com/en-us/download/details.aspx?id=13255
then I changed the platform target to x64
now i got this exception:
BadImageFormatException was unhandeled
{"Could not load file or assembly 'LinqToExcel, Version=1.9.0.0, Culture=neutral, PublicKeyToken=9c8ea65a58f03f1f' or one of its dependencies. An attempt was made to load a program with an incorrect format."}
Update 1
I already installed the linq_to_excel
using
Install-Package LinqToExcel
and then add the lib files to references
You have two options to solve
Enable IIS to run 32 bits app
Install LinqToExcel_x64
if change 32 bit app in iis From false to true,all conflicts about exteltolinq version solve
Please install Microsoft office in your machine it will automatically solve your problem. It worked for me as well.

how to disable delay signed in c#.net web projects

I am getting these error as
Build (web): Could not load file or assembly 'PetShop.DBUtility, Version=4.0.0.0, Culture=neutral, PublicKeyToken=a7987b61c51ca872' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)
So i figure it out that i need to disable the delay signal of that dll which i am using in my project
i am using vsexpress10 c# edition for development
Waiting for your solution
For enabling delay signing following lines are used:
[assembly:AssemblyKeyFileAttribute("myKey.snk")]
[assembly:AssemblyDelaySignAttribute(true)]
setting the 2nd attribute as false will disable the delay signing.

Test run errors with MSTest in VS2010

When I run my Unit Tests, all tests pass, but instead of "Test run succeeded" or whatever the success message is, I get "Test run error" in the little bar that tells me how many of my tests pass, even though all my tests passed.
When i click the text, I'm taken to a page that tells me the following two things happened:
Warning: conflict during test run deployment: deployment item '[...]\Booking.Web.dll' directly or indirectly referenced by the test container [...]\Booking.Web.Tests.dll cannot be deployed to 'Booking.Web.dll' because otherwise the file '[...]\Booking.Web.dll' would override deployment item '[...]\Booking.Web.dll' directly or indirectly referenced by '[...]\Booking.Web.Tests.dll'
Error: Cannot initialize the ASP.NET project 'Booking.Web'
Exception was thrown: The website could not be configured correctly; getting ASP.NET proccess information failed. Requesting 'http://localhost:54131/VSEnterpriseHelper.axd' returned an error: The remote server returned an error: (500) Internal Server Error.
I don't understand half of what it's complaining about. How do I get rid of these errors?
(And for reference: Booking.Web is an ASP.NET MVC 2 project, Booking.Web.Tests is a Test project, [...] is the full local path to the projects in my environment, in most of the cases above to the /bin/debug/ folder inside the Booking.Web project)
Update: As instructed, I looked for more info in Event Viewer. Here's what I found:
3008
A configuration error has occurred.
5/8/2010 2:26:15 AM
5/8/2010 12:26:15 AM
4ffbe9180c3d4c02adb9ac4d61dd0928
1
1
0
4484bbf4-1-129177519750954331
Full
/
D:\...\Booking.Web\
AASLOEG
1876
WebDev.WebServer40.EXE
Aasloeg\Tomas
ConfigurationErrorsException
Could not load file or assembly 'Ninject.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=79764a4ef1548af1' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045) at
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) at
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() at
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) at
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) at
...stack trace in absurdum.
First of all - you have Code Coverage enabled. You can read here about it. So there is no problems with Unit Tests. This is code coverage problem.
Second thing - this warning is ok - never mind about it.
Third thing - this error - this is the key problem.
There can be different problems - most common is that you should refference more assemblies. To find out what exactly should be loaded you must go to Event Viewer and look at at Windows Logs->Application
I had the same error related to MS-Test complaining that a DLL could "override deployment item blah.dll".
This was happening because I was running MS-Test for multiple DLL's at once like so:
mstest.exe /testcontainer:Tests.web.dll /testcontainer:Tests.svcs.dll /testcontainer:Tests.core.dll
When MS-Test was running this, it tried to take all the output DLL's from the tests and place them in out /Out directory of the test run. In my case, Tests.svcs.dll and Tests.core.dll both referenced the same assembly (Core.dll) and therefore it tried to copy that DLL to the same spot twice (thus causing the warning).
To resolve this, I separated the test runs for each assembly which gave each test run it's own /Out folder for output DLL's
mstest.exe /testcontainer:Tests.web.dll
mstest.exe /testcontainer:Tests.svcs.dll
mstest.exe /testcontainer:Tests.core.dll

Understanding LinkDemand Security on a webserver

After deployment an ASP.Net application on a webserver, I get this error message by using code from a external assembly: "LinkDemand The type of the first permission that failed was: System.Security.PermissionSet The Zone of the assembly that failed was: MyComputer the error ".
The assembly is include in the \bin folder and not in the GAC.
I try to know what linkdemand exactly is and why this message will raised. But looking for more information, I don't get exactly the problem.
I try also to add the PermissionSetAttribute on the class where the exception message happens:
[System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Name = "FullTrust")]
Then the exception will be raised on another class of the assembly. And so on..
My questions ares:
what exactly is going wrong here? Is it true that what I understand this error message displayed when the Jit cannot check the code security?
Is there maybe a security policy that block this (machine.config) or directly change the security?
Can I set the PermissionAttribute for all classes between a assembly?
Go to administrative tools and local security policy. Whilst, I do not know the exact reason you are getting the error, basically you are trying to execute code that is not allowed in the current security policy. Check your paths and your security policy and the permission requirements of the module. Some paths like desktop will run in reduced security by default.

Categories

Resources