Could not load file or assembly 'CefSharp.Core.Runtime.DLL' or one of its dependencies. The specified module could not be found - cefsharp

We have installed CerfSharp using the NuGet Pakage Manager and created a class library which loads a ChromiumWebBrowser, it works fine on VisualStudio-2019,
When we deployed the class library(DLL) into target location along with required cefsharp supported files as mentioned the readme.txt, which throws following exception
Error Message: Could not load file or assembly 'CefSharp.Core.Runtime.DLL' or one of its dependencies. The specified module could not be found.
Stack Trace: at CefSharp.Cef.get_IsInitialized()
could anyone help us on this issue?
Added following cefsharp supported files in the target deployment location:
CEF core library.
libcef.dll
Crash reporting library.
chrome_elf.dll
Unicode support data.
icudtl.dat
V8 snapshot data.
snapshot_blob.bin
v8_context_snapshot.bin
[System Info]:
CefSharp Version=91.1.230.0
OS: Windows 7 x64
Visual Studio Version:
Microsoft Visual Studio Enterprise 2019
Version 16.7.8
.NET Framework: 4.8
Thanks,

Related

error: GenerateFeatureFileCodeBehindTask task could not be loaded from the assembly

We have ported our project from .NET to .NET Core in order to use an AWS pipeline with Docker containers which requires Linux.
The application builds successfully on our local computers (which run Windows) but in the AWS pipeline the build steps shows this error - GenerateFeatureFileCodeBehindTask ... task could not be loaded from the assembly ... SpecFlow.Tools.MsBuild.Generation.dll:
Full error:
/root/.nuget/packages/specflow.tools.msbuild.generation/3.0.225/build/SpecFlow.Tools.MsBuild.Generation.targets(78,5): error MSB4062: The "SpecFlow.Tools.MsBuild.Generation.GenerateFeatureFileCodeBehindTask" task could not be loaded from the assembly /root/.nuget/packages/specflow.tools.msbuild.generation/3.0.225/build/../tasks/netcoreapp2.0/SpecFlow.Tools.MsBuild.Generation.dll. Assembly with same name is already loaded Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements
Microsoft.Build.Framework.ITask. [/codebuild/output/src814/src/s3/00/ProjectFoo/ProjectFoo.csproj]
I have found 2 links mentioning this error but no solution - https://ci.appveyor.com/project/SpecFlow/specflow-kx1o3/build/build1119 and https://www.gitmemory.com/issue/techtalk/SpecFlow/1699/520196304.
I have checked and I have no <UsingTask> in my csproj files. Any idea what this SpecFlow task is, and why it is throwing this error?
The GenerateFeatureFileCodeBehindTask is contained in the SpecFlow.Tools.MSBuild.Generation package. It is used to generate the code-behind files of your feature files.
You don't find a <UsingTask> because it is done in the NuGet package.
The GitHub issue for this is: https://github.com/techtalk/SpecFlow/issues/1699/
Currently I have no idea why this error is thrown. But we are currently fixing our build/tests for Linux.

Could not load assembly Microsoft.Threading.Tasks.dll

I am receiving the following error on iOS and Android project. Anybody has any workaround for this issue? This post recommends a workaround but the steps are vague.
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2,2): Error: Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'Microsoft.Threading.Tasks.dll'
at Xamarin.Android.Tuner.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(ICollection1 assemblies, AssemblyDefinition assembly, Boolean topLevel)
at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(ICollection1 assemblies, AssemblyDefinition assembly, Boolean topLevel)
at Xamarin.Android.Tasks.ResolveAssemblies.Execute() (Braemar.Vers.Mobile.Droid)
I think that these two paths should have this file but I couldn't find it.
C:\Program Files (x86)\Reference
Assemblies\Microsoft\Framework\MonoAndroid\v1.0
C:\Program Files (x86)\Reference
Assemblies\Microsoft\Framework\MonoTouch\v1.0
Xamarin Studio:
Version 5.10.2 (build 56)
Installation UUID: 88f72eda-5030-43e9-8d1b-7658e8a17627
Runtime:
Microsoft .NET 4.0.30319.42000
GTK+ 2.24.23 (MS-Windows theme)
GTK# 2.12.30
Xamarin.Android:
Version: 6.0.1.10 (Business Edition)
Android SDK: C:\Android\android-sdk
Supported Android versions:
2.3 (API level 10)
4.0.3 (API level 15)
4.1 (API level 16)
4.2 (API level 17)
4.3 (API level 18)
4.4 (API level 19)
4.4.87 (API level 20)
5.0 (API level 21)
5.1 (API level 22)
6.0 (API level 23)
SDK Tools Version: 24.4.1
SDK Platform Tools Version: 23.1.0 rc1
SDK Build Tools Version: 23.0.2
Java SDK: C:\Program Files (x86)\Java\jdk1.7.0_71
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) Client VM (build 24.71-b01, mixed mode, sharing)
Build Information:
Release ID: 510020056
Git revision: bb74ff467c62ded42b7b7ac7fdd2edc60f8647b0
Build date: 2016-01-26 15:49:39-05
Xamarin addins: 8b797d7ba24d5abab226c2cf9fda77f666263f1b
Build lane: monodevelop-windows-cycle6-c6sr1
Operating System:
Windows 10.0.10586.0 (64-bit)
Project Information:
PCL 4.5 - Profile 7
I had such problem. It was caused by missing nuget packages in Droid project. Some of my subprojects referenced packages which had "Microsoft.Threading.Tasks" in references (PCLStorage, Restsharp portable). But in main Droid project I did not added this packages. After adding missing packages (PCLStorage, Restsharp portable) to Droid everything started work.
Is there any reason you are using Profile7?
I would recommend you create a project with profile 259, that is the default one for Xamarin Forms projects.
Otherwise you need to get a reference to that DLL. Normally I try installing the BCL NuGet package as my first port of call, but it might not be included in there: https://www.nuget.org/packages/Microsoft.Bcl/
Update
If you are having linker issues, you can skip certain assemblies: https://developer.xamarin.com/guides/ios/advanced_topics/linker/#Skipping_Assemblies
Sometimes the linker is more aggressive than anticipated.
I had the same problem.
Right click and select Options for the Android project.
Go to Build->General and uncheck "Use MSBuild build engine (recommended for this project type)"
Now I could build again!

RewrittenPath Class is missing in monox

I hope to build a social network website through monox. I downloaded monoX_5_1_40_5107. When I compiled monox project in visual studio, there are errors of missing RewrittenPath class. I searched the keyword "RewrittenPath" in the entire project, I can't find any definition about it. But when I like to continue and run the last successful build, the website runs well, I can create import the database into local database, and even can create new account info through website.
the compilation erorrs is as below: :
Error 3 The type or namespace name 'RewrittenPath' could not be found (are you missing a using directive or an assembly reference?) Documents\Visual Studio 2013\Projects\WebApplication1\WebApplication1\MonoX\T4Templates\RewrittenPaths.cs 27 13 WebApplication1
The latest version monoX_5_1_40_5150 was just released,and the problem is fixed in this version.So just update project with the latest version.

WebGrease error on Styles.Render call in _Layout.cshtml in Mvc4

I'm trying to add bundling to my Mvc4 web project. The steps I took:
Added a reference to my project to System.Web.Optimization
Added #Styles.Render("~/Content/css") within <head> of my _Layout.cshtml
Added BundleConfig.RegisterBundles(BundleTable.Bundles); to Global.asax.cs
Added BundleConfig.cs to my App_Start folder with bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css")); within RegisterBundles(...) method
Added a simple site.css within my Content folder.
The error that I get on the line from step #2 above is Could not load file or assembly 'WebGrease, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
Am I missing a DLL reference or something? Note that I started originally from a blank Mvc4 project.
Over the last day or so I was having this issue too but I figured out a solution. Basically you need to just update "webgrease".
Here's what I did to update webgrease:
right click your project solution in your solution explorer.
Click "Manage NuGet Packages for Solution"
Go to the updates section on the left
Search "WebGrease"
Then update "WebGrease"
This worked for me when I built my solution.
I had the same problem after having added ASP.NET MVC 5 to my old ASP.NET web application, running WebForms. I want to add new features and build them on the MVC platform, so it is important that I get MVC and the traditional web application to run side by side. I'm writing this answer here because all the solutions I have found on stackoverflow and other places, including the solution selected to the topic you're reading now, didn't help me. Maybe my findings will help someone out there...
When I added MVC 5 to the web application project, it installed a bunch of references, for example System.Web.Mvc, System.Web.Razor, etc. The NuGet package called Microsoft.AspNet.Web.Optimization was also installed, which has a reference to WebGrease; the reference you and I had problems with.
The version of the Optimization dll that was installed in my web project, is Microsoft.AspNet.Web.Optimization 1.1.3, which is the latest version as of right now. WebGrease version 1.5.2 comes with it.
The funny thing is that the error message I got when executing the #Styles.Render("~/Content/css") statement in _Layout.cs, referred to WebGrease version 1.5.1. I have no idea where it got the 1.5.1 version from, because 1.5.2 was installed in my web project. I tried uninstalling WebGrease and reinstalling, tried upgrading WebGrease to the latest version (1.6.5135). I made certain that none of these dlls were installed in the GAC (which they weren't). I deleted all temporary files in "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\", but all to no avail.
I used the program called Fuslogvw.exe to log all binding information when I ran my web application, in the hope that I would spot a logical reason for why my application insisted on trying to load an old, non-existing version of WebGrease when running my application. Interestingly, the log's output showed me what the application was doing, but unfortunately didn't tell me why. The log told me that despite me having installed Microsoft.AspNet.Web.Optimization version 1.1.3 with WebGrease version 1.5.2, it tried to load Microsoft.AspNet.Web.Optimization version 1.1.0.0, which also comes with an older version of WebGrease. Why it did this? I have no idea, as I've never added Optimization to any project on my PC before.
My solution was to remove both Microsoft.AspNet.Web.Optimization and WebGrease (in that order), and then run the following command in Package Manager Console to install Microsoft.AspNet.Web.Optimization version 1.1.0:
Install-Package Microsoft.AspNet.Web.Optimization -Version 1.1.0
This resulted in WebGrease version 1.3.0 being installed, which didn't cause any problems when loading my MVC razor view which uses the _Layout.cshtml page.
For those of you who are interested: below you can see the output from the log produced by Fuslogvw.exe, where it clearly states that it tried to load the non-existing 1.1.0 version of Optimization:
*** Assembly Binder Log Entry (26.11.2018 # 13:19:59) ***
The operation failed.
Bind result: hr = 0x80131040. No description available.
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
Running under executable c:\windows\system32\inetsrv\w3wp.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: DisplayName = WebGrease, Version=1.5.1.25624, Culture=neutral, PublicKeyToken=31bf3856ad364e35
(Fully-specified)
LOG: Appbase = file:///C:/Projects/MyProject/Web/
LOG: Initial PrivatePath = C:\Projects\MyProject\Web\bin
LOG: Dynamic Base = C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\myproject\1db399c5
LOG: Cache Base = C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\myproject\1db399c5
LOG: AppName = 3f7f1cb1
Calling assembly : System.Web.Optimization, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Projects\MyProject\Web\web.config
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Post-policy reference: WebGrease, Version=1.5.1.25624, Culture=neutral, PublicKeyToken=31bf3856ad364e35
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/ipmvcang/1db399c5/3f7f1cb1/WebGrease.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/ipmvcang/1db399c5/3f7f1cb1/WebGrease/WebGrease.DLL.
LOG: Attempting download of new URL file:///C:/Projects/MyProject/Web/bin/WebGrease.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\Projcets\MyProject\Web\bin\WebGrease.dll
LOG: Entering download cache setup phase.
LOG: Assembly Name is: WebGrease, Version=1.6.5135.21930, Culture=neutral, PublicKeyToken=31bf3856ad364e35
WRN: Comparing the assembly name resulted in the mismatch: Minor Version
ERR: The assembly reference did not match the assembly definition found.
ERR: Setup failed with hr = 0x80131040.
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

Moving to JSON.NET 4.0.3 broke my app

I have a Windows Phone 7.1 (Mango) application that was using JSON.NET 4.0.2.
I upgraded it to 4.0.3 and now I get all kinds of error.
A deserialized class that was working before is now throwing this error :
Could not load type 'System.Dynamic.IDynamicMetaObjectProvider' from assembly 'System.Core, Version=3.7.0.0, Culture=neutral, PublicKeyToken=969DB8053D3322AC'.
I also make use of the Linq feature by using JArray and now I get this message:
{"Could not load type 'Newtonsoft.Json.Linq.JArray' from assembly 'Newtonsoft.Json, Version=4.0.3.0, Culture=neutral, PublicKeyToken=30AD4FE6B2A6AEED'."}
I tried cleaning the solution. I tried copying the DLLs one more time.
Any suggestions?
The problem is that Windows Phone 7.1 defaults to the Silverlight 4 build if no explicit Silverlight 4 WP build is specified. Silverlight 4 has features that aren't available on WP which is why this causes Json.NET to break.
This will be fixed in 4.0.5 by having the current Windows Phone 7.0 dll used for 7.1 but for now to fix the problem just change the dll reference to the Newtonsoft.Json.dll file in the sl3-wp directory.

Resources