Using VS2022, I cannot change C# code in debug mode (ENC1002) - c#

Any code modification is forbidding me to continue debugging, raising this error:
ENC1002 Cannot apply changes -- unexpected error: 'The given key 'TSUNAMI, Version=1.0.0.65535, Culture=neutral, PublicKeyToken=null' was not present in the dictionary.'
What is this dictionary?
Tsunami is the name of my project in version 1.0.0.
I couldn't find something related to this dictionary anywhere.

Related

How to disable code signing on Azure Dev Ops - Still getting “Error signing output with public key from file mssharedlibsn1024.snk - File not found”

We've disabled our code signing in our dev branch build pipe, and it fails with the following error:
Error CS7027: Error signing output with public key from file
'......\SigningCertificates\mssharedlibsn1024.snk' -- File not found.
It keeps looking for the file even after we removed it from the solution and the project and the source control.
When I tried enabling the code signing to overcome this error, I got a different one instead (because of the code signing that occurred):
Error: The process 'C:\Program Files (x86)\Microsoft Visual
Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe'
failed with exit code 1 Initialization method
Microsoft.Crm.Sales.ProductivityBot.Test.Cards.EntityCardArgsTests.Setup
threw exception. System.IO.FileLoadException: Could not load file or
assembly 'Microsoft.Crm.Sales.ProductivityBot, Version=0.1.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its
dependencies. Strong name validation failed. (Exception from HRESULT:
0x8013141A) ---> System.Security.SecurityException: Strong name
validation failed. (Exception from HRESULT: 0x8013141A).
The above error comes from the test project which is not signed.
So it goes down to 2 questions:
How do we get rid of the snk file error and truly disable the code signing?
In case the code signing runs (such as cases we do want to run the tests), how do we configure the tests project to use the signed tested "main" project?

Could not load file or assembly 'Microsoft.Bot.Builder.Autofac,

My Bot ran fine just yesterday, and without changing anything, for some reason it gives the following error:
Exception while executing function: Functions.messages -> One or more errors
occurred. -> Could not load file or assembly 'Microsoft.Bot.Builder.Autofac,
Version=3.12.2.4, Culture=neutral, PublicKeyToken=31bf3856ad364f39' or one
of its dependencies. The system cannot find the file specified.
I have no idea why it is suddenly happening, without any changes.
Please help..
Assuming you are using Functions v2, this could be the reason for "worked yesterday, not today anymore":
https://github.com/Azure/app-service-announcements/issues/106
This also describes how to revert back to a previous version which should fix it.
Further discussions: https://github.com/Azure/app-service-announcements-discussions/issues/46

Re-named assembly, application won't build

I renamed my WPF application's assembly from DBce_TEST2 to AMS, then attempted to build it to see what would happen. I ran it, and it wouldn't build for obvious reasons but now after renaming it back to DBce_TEST2 I get the following error:
Managed Debugging Assistant 'BindingFailure' has detected a problem in 'G:\C# Projects\Asset Management System\DBce_TEST2\bin\Debug\DBce_TEST2.vshost.exe'.
Additional Information: The assembly with display name 'AMS' failed to load in the 'Load' binding context of the AppDomain with ID 1. The cause of the failure was: System.IO.FileNotFoundException: Could not load file or assembly 'AMS' or one of its dependencies. The system cannot find the file specified.
The error can be fishy. Use Fusion log viewer to understand what has gone wrong.
How to enable assembly bind failure logging (Fusion) in .NET
Figured it out. Renamed the assembly again to some random text, attempted to run it, then renamed back to original assembly name and the error disappeared. Guess some generated files were messed up by visual studio a little bit, and this fixed it.

Strange error in Quartz: Quartz.XmlSerializers not found

I am getting the following error in Quartz.net
The assembly with display name 'Quartz.XmlSerializers' failed to load
in the 'LoadFrom' binding context of the AppDomain with ID 1. The
cause of the failure was: System.IO.FileNotFoundException: Could not
load file or assembly 'Quartz.XmlSerializers, Version=2.0.1.100,
Culture=neutral, PublicKeyToken=null' or one of its dependencies. The
system cannot find the file specified.
It's very odd since Quartz.XmlSerializers does not exist anywhere in any code I'm using. It's not in the Quartz source code, my code, and none of my dependencies best I can tell. It only occurs when I debug my project, but not when I download the Quartz 2.0.1 source code and run the server from there.
I am using topshelf as the service install library.
It occurs during deserialization on line 226 of XMLSchedulingDataProcessor.cs of the Quartz source.
// deserialize as object model
System.Xml.Serialization.XmlSerializer xs = new System.Xml.Serialization.XmlSerializer(typeof(QuartzXmlConfiguration20));
Any clue to solving this would be helpful as I'm stumped by this error.
In applications that use XmlSerialization, you can get a first-chance exception in outside code when the application looks for a cached serialization assembly. You can find more information in this question.

Expression Blend 4 failing when tries to load Reactive assembly

Maybe someone have same problem
When I try to set data context type of view to desired View Model. The error appears:
Could not load the assembly System.Reactive.Windows.Threading because
the following errors occurred: Method 'Schedule in type
'System.Reactive.Concurrency.DispatcherScheduler' from assembly
*System.Reactive.Windows.Threading, Version=1.0.10621.0, Culture=
neutral, RublicKeyToken=31b13856ad364e35' does not have an
implementation.
Any thoughts? I have looked at disassembled code, and the method has implementation.
Try adding a file reference to System.Reactive.Windows.Threading.dll to your project.
I've had a similar error and that fixed it.

Categories