Pechkin lib throws a TypeLoadException - c#

I've tried many examples that use Pechkin and Pechkin.Synchronized but can't get it to run, because all the times, I get the following error.
An unhandled exception of type 'System.TypeLoadException' occurred in mscorlib.dll
Additional information: Could not load type 'Pechkin.GlobalConfig' from assembly 'Pechkin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
I'm using x64 Windows 7 Home Basic with VS2012 Express for Desktop and the csproj is configured to build for x86 target and installed Pechkin and Pechkin.Synchronized from using nuget PM.
The last code I tried was from here

It has been a while since you asked this question and you've already fixed your issue, but maybe it'll help someone else.
You should probably try implementing TuesPechkin instead. This is a fork of Pechkin solving many issues (Pechkin issues) and using the latest version of WKHTMLTOPDF. The developer is quite active and will probably solve any bug you may find.

I think the problem was the name of my C# Console project, it was Pechkin. When I changed it to PechkinTest, System.TypeLoadException did not arise.
Anyways, thanks.

I also got the same problem and i changed my project name from Pechkin to some other name and the problem solved !

Related

System.IO.FileLoadException on System.ServiceModel.Primitives

I am currently working on a Xamarin project, and I required something that Xamarin on it's own doesn't support, so I looked for solutions. After messing around with some NuGets, my project ended up with a bunch of weird and unexplainable compile errors, popping up and disappearing randomly.
Eventually I realized that I removed a NuGet from the shared project, but not the UWP one. After removing it from UWP, the program compiles and runs. But seems that there is some more damage done...
However, when I try to call a method of a class defined in a different file, it throws a System.IO.FileLoadException, which it previously wasn't doing. The complete Exception message is:
System.IO.FileLoadException: 'Could not load file or assembly 'System.ServiceModel.Primitives, Version=4.5.0.3, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)'
After a bit of digging, it concluded that it is probably caused by a missing nugget, which I must've deleted by a mistake. So I installed a 4.5.3 version. Didn't help. Restarted Visual Studio, no effect.
I can't install any earlier versions, as it is considered being a downgrade by something. Any clues how to deal with this?
I had the same problem in my UWP project.
My solution was to remove checking if the exception is a FaultException. It seems like FaultException is not supported. After removing the check my method works fine, I could step in etc. Hopefully this helps you too and solves your problem.
My case it solved by update the System.ServiceModel.Primitives for .NET Standard to 4.4.4. version as mentioned below,
https://github.com/dotnet/wcf/issues/3088#issuecomment-411603736

Could not load type 'Microsoft.TeamFoundation.TFStringComparer' from assembly 'Microsoft.TeamFoundation.Common'

using Microsoft.TeamFoundation.TestManagement.Client;
I've encountered - TypeLoadException was unhandled
Error Description Says:
Could not load type 'Microsoft.TeamFoundation.TFStringComparer' from
assembly 'Microsoft.TeamFoundation.Common, Version=15.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
Any help would be appreciated
I've tried Microsoft Team Foundation Server Extended Client instead of Microsoft Team Foundation Server Client. This resolved my error. Thanks #Patrick-MSFT, you provided me thoughts to resolve the issue
Base on error info, the solution is installing and refer the necessary assemblies Microsoft.TeamFoundation.Common, Version=15.0.0.0.
You can install nugget Package Microsoft.TeamFoundation.Client. After installed this Package, you can use this reference in the code.
Another workaround is copying the necessary assemblies from another machine. If the issue still persist, please re-install the VS 2017. More details please take a look at this similar question.

The type initializer for 'CrystalDecisions.Shared.ExportOptions' threw an exception

I am using SAP crystal reports in my wpf application, I am getting this exception at the time of initialization
ExportOptions _ExportOptions = new ExportOptions();
this is the error I am getting "The type initializer for 'CrystalDecisions.Shared.ExportOptions' threw an exception."
and this is inner exception says
{"Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified.":"log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"}
total inner exception including message is in this link
I tried to add the dll reference of the particular version, even though it is still showing the same issue. I am very worrying about this issue as I could not figure out the solution for a long time.
any help highly appreciated.
Thanks
Ganesh
My suspicion is that you don't have the runtime for CR installed correctly. A lot of people make the mistake and install the runtime using the msi installer instead of the exe. The msi does not integrate CR with VS, the exe does. As Raphael pointed out in his comment, this post has a very good thread and explanation by Ludek, who is one of the sharpest minds at SAP. You can download the exe here.
Hope that helps,
Chris
I had also faced same issue , i had change my projects Target framework to .NET Framwork 4 . you can change the same from project property->Application tab ->Target framework.

C# remote (exchange)powershell

i made a while back an console application(in c#) which does a few powershell commands.
i connect to the (exchange)powershell with remote powershell.
but when the application runs;
RunspaceFactory.CreateRunspace(connectioninfo)
i get the following exception:
Could not load file or assembly 'Microsoft.Management.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
the only thing i cannot figure out is why it was working before perfectly. i searched my solution, nowhere i could find a reference to that dll. i also searched my c# drive it was nowhere to be found either.
i restored my solution from my backup of 2-3 months old and the same error.
Can someone give me some pointers to what is going wrong ?
Found the problem.
apparently something is wrong on my computer(I'm guessing after installing the Beta of VS11)
anyhow, after using the project on a different machine where VS2010 is installed it worked just fine.
The error message is misleading.
I had got the error, as I used the reference to the System.Management.Automation.dll Version 3.0.0.0 (which means PowerShell 3.0).
The issue is, the Exchange Server 2007/2010 isn't compatible with PowerShell 3.0, so you must bind the reference to the System.Management.Automation.dll version 1.0.0.0 (Windows PowerShell 2.0).
Check all project references
Check app.config
Have a look here
UPDATES
Have a look here

NDjango throws TypeLoadException

I'm just trying to get started with NDjango but am having issues running a basic test app. When running the page in either debug or release the following exception is thrown:
Could not load type 'Microsoft.FSharp.Core.CompilerMessageAttribute' from assembly 'FSharp.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
This is thrown when the NDjangoHandle is created in the HttpApplication ctor. The fsharp assemblies are definitely all there in the gac (and they seem to be distributed with NDjango too) so I'm a bit confused about this one. Googling this turns up zip.
I'm using NDjango 0.9.7.0 for .NET 4.0 in vis studio 2010
Cheers
Did you install FSharpPowerPack? I am not sure if it was stated clear enough in the installation package but it is required and it does not come with the standard installation.
Also - by any chance do you have a side by side installation of VS2010/VS2008? The FSharp installation package has a bug which can cause similar problems
Let me know if you need further help. You can communicate with us directly through bug tracker and/or mailing list

Categories

Resources