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

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.

Related

Error trying to add a web reference to dotnet core project. User canceled out of save dialog (Exception from HRESULT: 0x8004000C (OLE_E_PROMPTSAVECA

I have a dotnet core project that I need to a web reference to. I select the Microsoft WCF Web Service Reference provider and select the URL and click "Go" The correct service shows up under the "services" window. I change the namespace to something like mynewservice and press "finish."
The new window show adding connected service to project.
Importing web service metadata ...
Number of service endpoints found: 2
Scaffolding service reference code ...
Warning:Warning: Reference cannot be loaded: 'System.Data.Entity', Could not load file or assembly 'System.Data.Entity, Culture=neutral, PublicKeyToken=null'. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (Exception from HRESULT: 0x80131058)
Updating project ...
Error:User canceled out of save dialog (Exception from HRESULT: 0x8004000C (OLE_E_PROMPTSAVECANCELLED))
Done.
Error:Adding Microsoft WCF Web Service Reference Provider to the project failed: User canceled out of save dialog (Exception from HRESULT: 0x8004000C (OLE_E_PROMPTSAVECANCELLED))
What do I need to do to get the reference installed? I've looked at previous examples and they usually indicate the proj file is locked but I can edit the proj file so it isn't locked. Any ideas?
I never found an answer, however the method suddenly starting working and I no longer got the error. Not sure what changed but now it installs correctly.

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.

XMSFactoryFactory.GetInstance(XMSC.CT_WMQ) returns Fatal error: Failed to initialize XMSFactoryFactory

I'm trying to connect to an IBM message queue using .net and MQ client v8.0.0.5 but I keep receiving the following error:
Fatal error. Failed to initialize XMSFactoryFactory
Could not load file or assembly 'IBM.XMS.Client.Impl, Version=8.0.0.5,
Culture=neutral, PublicKeyToken=d2666ab12fca862b' or one of its
dependencies.
The system cannot find the file
specified.":"IBM.XMS.Client.Impl, Version=8.0.0.5, Culture=neutral,
PublicKeyToken=d2666ab12fca862b
Here's what I've done so far:
Installed MQ Client v8.0.0.5 (x64) on my machine.
Referenced the following assemblies:
amqmdnet.dll
amqmdnsp.dll
amqmdxcs.dll
IBM.XMS.dll
IBM.XMS.Admin.dll
IBM.XMS.Client.Impl.dll
IBM.XMS.NLS.dll
IBM.XMS.Provider.dll
IBM.XMS.Util.dll
Now I also have version v7.5.0.4 installed on my machine and that is having no issues connecting to the queue.
One more thing I noticed is there are no assemblies for v8.0.0.5 in the GAC but the assemblies for v7.5.0.4 are present. Can that be the reason?
Unfortunately, I cannot remove v7.5.0.4 until have both the versions working normally.
Yes, MQ v8.0.0.5 XMS .NET assemblies not being in the GAC is most likely the cause.
You can look at the alternative of using redirection, update app.config file to use the correct version of assemblies your application requires. Look into your MQ installation directory for a file called NonPrimaryRedirect.config. This file contains sample configuration required for application to look for a specific version of MQ/XMS .NET assembly. Copy the contents of this file to your application's app.config file and try. You must ensure all href attributes point to correct path.

Cannot load a Strong name assembly by Assembly.LoadFrom(), call fails with 0x80004005 (E_FAIL)

I have an Adobe acrobat plugin that uses System.Reflection.Assembly.LoadFile(path) in an AssemblyResolve event that will fail anytime I try to load a signed assembly. The error is
The assembly with display name 'Microsoft.AspNet.SignalR.Client' failed to load in the 'Load' binding context of the AppDomain with ID 1. The cause of the failure was: System.IO.FileLoadException: Could not load file or assembly 'Microsoft.AspNet.SignalR.Client, Version=2.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))
I have to use AssemblyResolve event because the needed assemblies will live in a folder a couple levels beneath Acrobat's exe. Here is the code that AssebmlyResolve calls.
Assembly^ TeamMateIntegrationManagedWrapper::ResolveAssembly(Object^ sender, ResolveEventArgs^ args){
try
{
// This method will be called if an assembly cannot be found.
// The assembly should be 2 folders below the current working directory where the Adobe Acrobat executable lives.
AppDomain^ appDomain = static_cast<AppDomain^>(sender);
String^ path = appDomain->BaseDirectory;
path += "plug_ins\\MyAppName\\" + args->Name->Split(',')[0] + ".dll";
return System::Reflection::Assembly::LoadFile(path);
}
catch (Exception^ ex)
{
String^ msg = ex->Message;
}
return nullptr;}
The Acrobat plugin is in mostly C but has a CLI bridge class to wrap the managed C# Assembly that uses SignalR.
Things I've tried.
Put all the necessary dll's in the same folder as Acrobat's executable to get around using the AssemblyResolve event.
Verified the SignalR version and PublicKeyToken of the dll that I'm providing in the AssemblyResolve event matches exactly what is being requested in the ResolveEventArgs
Verified that all my assemblies (including plugin dll) are targeting .Net Framework v4.6 and the plugin dll is building for x86 and other assemblies are build for Any CPU.
Tried Assembly::LoadFrom(path) instead of LoadFile(path), same error loading assembly.
Rebuilt SignalR from the source code and removed the Strong Name, the SignalR assembly loaded successfully in the AssebmlyResolve event. Added the strong name back to the SignalR assembly and got the above error again.
Added Strong name to my C# assembly, got the same error as above just like SignalR assembly.
Looked at fusion log viewer but nothing was logged for Acrobat.
Created a C++ console application that contains the same CLI bridge wrapper class that uses the same C# assembly that consumes SignalR, same error as above. Looked at fusion logs but no log for Microsoft.AspNet.SignalR.dll under my ConsoleApplication.exe folder. Looked at fusino log for my C# assembly that uses SignalR and there is not any reference/mention of SignalR dll trying to load in the log file.
Adobe Reader has an option/preference Edit->Preferences->Security (Enhanced)->Enable Protected Mode at startup that launches the application in a protected sandbox. This protection was preventing the Strong named dll from being loaded.

Solving Assembly not Found | FileNotFoundException | Fusion Log

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.

Categories

Resources