Error compiling C# project with Protractor.dll as reference - protractor-net

We are developing a framework on top of Protractor/Selenium framework. Our projects are all C# signed projects. So, we need to reference signed Protractor and Selenium dlls.
I used the signed WebDriver.dll and Webdriver.Support.dll (version 2.46) from here.
But, when I compile my project, I am getting the below error -
"The type 'OpenQA.Selenium.Internal.IWrapsDriver' is defined in an assembly that is not referenced. You must add a reference to assembly 'WebDriver, Version=2.46.0.0, Culture=neutral, PublicKeyToken=null'."
How can I address this error and get my code running?

Related

How to add a reference to NetStandard2.0 or 2.1?

I have a WinForms application using .NET Framework 4.7.2, which uses a library that targets NetStandard2.0 and 2.1. While the library does seem to load, I get an exception when the library is called, saying "Error could not find assembly netstandard2.1 file not found". I assume that I need to add a reference from the application to NetStandard2.1. Is that correct? How do I do this?

VS2019 Reference a foreign project and its packaged assemblies in .Net 5.0

To recap how .net framework references work: Assume I have a .net framework class project called ProjectFw which references a .dll called Grpc.dll. When I create a new Solution as a .net framework console project called ProjectFwRef which adds a reference to ProjectFw.dll the build automatically brings the .dll Grpc.dll into the release folder of ProjectFwRef.
But .net 5.0 does not do that: Assume I have a .net 5.0 class project called ProjectNet which references a package called Grpc. When I create a new Solution as a .net 5.0 console project called ProjectNetRef which adds a reference to ProjectNet.dll the build DOES NOT automatically bring the Grpc.dll nor Grpc package into the release folder of ProjectNetRef.
This fundamental difference in how foreign .dlls are imported into a .net 5.0 project begs the question of the best way to deal with it. One obvious answer is to manually add the package Grpc to ProjectNetRef. Am I missing a better solution? What if I do not know the .dll's a foreign project references? Do I have to wait for the dreaded 'Cannot load file or assembly' error to find out what package I should have added?

Xamarin iOS - Binding Project - Warning

Am using
Xamarin Studio - 4.0.4 (build 2)
Mono - 2.10.11
Xamarin.iOS - 6.3.5.43
Mac OS X - 10.8.2
When building the wrapper binding class, I get a warning saying 'System.Runtime.CompilerServices.ExtensionAttribute' is present in multiple assemblies. Its just a warning, but builds the .dll file.
Target GenerateBindings:
Tool /Developer/MonoTouch/usr/bin/btouch execution started with arguments: /unsafe /d:DEBUG ApiDefinition.cs /s:StructsAndEnums.cs /tmpdir:obj/Debug/ios/ /sourceonly:obj/Debug/ios//sources.list
warning CS1685:
The predefined type System.Runtime.CompilerServices.ExtensionAttribute' is defined in multiple assemblies. Using definition frommscorlib'
/Developer/MonoTouch/usr/lib/mono/2.1/mscorlib.dll (Location of the symbol related to previous warning)
/Library/Frameworks/Mono.framework/Versions/2.10.11/lib/mono/2.0/System.Core.dll (Location of the symbol related to previous warning)
But when using the created binding class in another project, it gives the error saying
Compiling to native code -
'error MT5202: Native linking failed. Please review the build log.'
In the build log
ld: file not found: /var/folders/w4/xsz8x8vx0_51hjxj474r1_fxhlq7x3/T/tmp9aef74.tmp/libPrint.a
collect2: ld returned 1 exit status
Note : libPrint.a is my static library
-Update-
When binding the libPrint.a file to the wrapper class, the .a file should be added to the project and not inside the 'Resources' folder. This solved the issue am facing.
Does libPrint.a support the architecture you are building your iOS project for?
IOW, if you are compiling for Simulator, your libPrint.a needs to support i386.
If you are compiling for device, it needs to support whatever ARM arch you are targeting.
The warning is because of the ambiguity for System.Runtime.CompilerServices.ExtensionAttribute' in multiple assemblies.
Keeping the warning aside, the real problem is when adding libPrint.a file.
Its a small silly mistake. The docs of xamarin clearly explain it.
It should be added to the project and not inside the 'Resources' folder.
This solved the error I'm getting when using the .dll file for a project.

MvvmCross Tutorial - Portable Class Library assembly reference error - MonoDroid

I am really eager to get started with MvvmCross - it looks like a very promising framework for cross-platform solutions. Anyway, I am having a build error as I'm going through the tutorial, https://github.com/slodge/MvvmCross/wiki/Tutorial-Part-1. The error arises in building the Android project component. This is the error:
Error 1 The type 'Android.App.Activity' is defined in an assembly that is not referenced. You must add a reference to assembly 'Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=c4c4237547e4b6cd'. C:\Users\Steven\documents\visual studio 2010\Projects\Tutorial\Tutorial.UI.Droid\Views\MainMenuView.cs
I saw some similar questions posted (Portable Class Library strong assembly reference problems in MonoTouch/MonoDroid) and followed the suggested solutions but without success. This was in VS2012, so I tried it in VS2010 and encountered the same problem. Has anyone come across this error? The PCL portion (Tutorial.Core) builds fine on its own. I checked the PCL csproj file and saw it is using Profile 104 and I did already create the MonoAndroid xml file that sits in that directory:
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETPortable\v4.0\Profile\Profile104\SupportedFrameworks\MonoAndroid,Version=v1.6+.xml
The reference for Mono.Android in the Tutorial.UI.Droid project appears to be fine. The path for the dll is C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v2.2\Mono.Android.dll and VS reports Resolved=True and Strong Name=True for this reference.
Any help would be greatly appreciated.
Your problem has nothing to do with PCL. Starting version 4.2, Mono for Android assemblies are strong-named i.e. assemblies shipped by Xamarin will be signed with a Xamarin key. Earlier the assemblies were either not signed or only delay-signed. This change affects the strongnames of some Xamarin assemblies.
Like in your case, it is asking you to add reference to:
Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=c4c4237547e4b6cd
which is strong-named. At present you'd be using:
Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
which is not strong-named.
So all you need to do is re-build all your assemblies (in MVVMCross as well as any other projects you may have) that refer Mono.Android with the new strong-named assembly.
That should fix your problem.

Adding Ninject.MVC3 to existing MVC(4) project

I am working on a project with MVC4, and have decided that I wish to add some dependency injection via Ninject. After download/install via NuGet, I find this error in the NinjectWebCommon.cs (Line 23):
The type 'System.Web.IHttpModule' is defined in an assembly
that is not referenced. You must add a reference to assembly
'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
and then a bit later (line 44):
The type or namespace name 'IHttpModule' could not be found
(are you missing a using directive or an assembly reference?)
I expect that this Normally works, but that I've done something that doesn't work when adding Ninject to the project after the fact.
Edit: The above errors are only thrown by the test project....
Make sure you specify the System.Web reference in both the main and test project. The test projects have their own list of references to maintain. I expect you don't have System.Web in the test project.
Make sure Ninject didn't add web references to your model project.

Resources