Could not load file or assembly 'PdfSharpCore, Version=1.3.40.0 - c#

I am using PdfSharpCore version 1.3.40 in a MVC ASP.Net netcoreapp2.1 and it works perfectly on my windows localhost, but when I publish it on a server Linux running Apache the follow exception occurs:
Could not load file or assembly 'PdfSharpCore, Version=1.3.40.0, Culture=neutral, PublicKeyTo ken=null'. The system cannot find the file specified.
I already checked that the PdfSharpCore dll is there, but the system couldn't find it.
Does anyone know what's going on?

We managed to solve the problem, we were forgetting to replace the .deps.json file that contains the dependencies with the new PdfSharpCore.dll dll included in the project. Solved!

Related

dotnet core fusion assembly logs on linux

Using Windows it is possible to enable Fusion assembly logs via registry (https://techcommunity.microsoft.com/t5/iis-support-blog/fusion-log-viewer-fuslogvw-exe/ba-p/784396) to be saved on local hard drive.
My .NET Core 3.1 application is working properly on Windows. On Docker container based on Linux I'm getting randomly "Could not load file or assembly" for some assemblies, which actually are available in proper place in build directory and for some runs they work properly.
Sample assembly error:
Could not load file or assembly 'Renci.SshNet, Version=2016.1.0.0, Culture=neutral, PublicKeyToken=1cee9f8bde3db106'. The system cannot find the file specified.
I would like to enable debug logging related to assemblies to find a root cause of described issue.
Can I enable anyhow fusion logs on Linux?

Application requires that assembly office version 12.0.0.0 be installed in GAC

I have a .csproj that I want to publish to a clickonce server.
When I publish the application from one development computer it works and the program can be started from the server without any problems.
I download the same project from svn to another computer and try to publish it. That step kinda works, i guess, since the program is published successfully without any errors.
But when I try to start the program from the server I get the error:
Application requires that assembly office version 12.0.0.0 be installed in the Global Assembly Cache(GAC) first.
Update: (also posted info in comments). I am receiving this warning on both machines though I don't know how to solve. But it's probably the cause of the problem I guess:
No way to resolve conflict between "office, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" and "office, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c". Choosing "office, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" arbitrarily.
1> Consider app.config remapping of assembly "office, Culture=neutral, PublicKeyToken=71e9bce111e9429c" from Version "12.0.0.0" [C:\Windows\assembly\GAC\office\12.0.0.0__71e9bce111e9429c\office.dll] to Version "14.0.0.0" [D:\Visual Studio\Visual Studio Tools for Office\PIA\Office14\office.dll] to solve conflict and get rid of warning.
So I finally solved this.
First I thougt I'd describe how the project looked. Under references there was no reference to the office.dll file though this actually ended up in the published directory when computer1, which was able to publish a working copy, published the project. Also under properties->publish->ApplicationFiles the office.dll was listed as exluded.
computer2, which couldn't publish a working project, had the same installed programs as computer1. So I tried to add the reference to office.ddl, set it to copy local and include it in applicationfiles. Now there was a office.dll copied to the published directory but the same error appeared. installed and re-installed a bunch of programs, no improvement. After I've been trying alot of randomstuff I ended up copying the dll from computer1, referenced it, set it to copy local and included it. And, voila, it worked?

Asp.net project building error

i am getting below error while building my project
Error 4 Reference.svcmap: Could not load file or assembly 'Orchard.Framework, Version=1.5.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
Even i have integrated orchard.core dll and orcahrd.framework dll refrence in my project,but nothing to do with orchard anything with my project but don't know why this error is coming and what's the reason behind this.
Please help me due to this i am unable to move forward in my project.
Thanks
Check that the version of the Ochard.Framework.dll i 1.5.1.0
Latest version is 1.7.2, so it might be that the web.config file specify version 1.5.1.0 while the version you have is 1.7.2.

AppHarbor background worker, could not load file or assembly WebActivator Version=1.5.2.0

I am having a problem when publishing a console application to appharbor.
Error message:
FileNotFoundException: Could not load file or assembly 'WebActivator,
Version=1.5.2.0, Culture=neutral, PublicKeyToken=null' or one of its
dependencies. The system cannot find the file specified
I have tried to add WebActivator, Version=1.5.2 through nuget and the reference is set copy local to true. I have also tried to change from .net 4.5 to 4.0.
Any suggestions?
Ok so the problem seems to be that one of my references to the console app was built with framework v 4.5. So it was working locally. Also check that you arent referencing to a MVC project which may have caused problem as well. So when I reference a pure class library framework 4.0 it seems to work. Hope this helps someone!

NSevriceBus Assembly Version Error

I have an issue when trying to load the NServiceBus assembly from a client machine. The software runs correctly from my development box but once rolled out I get the following error:
Could not load file or assembly 'NServiceBus, Version=2.0.0.1100, Culture=neutral, PublicKeyToken=9fc386479f8a226c' or one of its dependencies. The system cannot find the file specified.
The weird thing is I am not using version 2.0.0.1100, I am using the latest version 2.0.0.1219. It seems to be referencing the old version somewhere but I cannot find where. I have set the “Specific Version” flag to true on both the NServiceBus & NServiceBus.Core assemblies and have tried to explicitly set the version number in the app config, both with no luck. I don’t understand why it works fine locally but errors once rolled out. The project causing the error is a shared class library and it only appears to be erroring on some projects too.

Categories