Type 'ClientAssertionCertificate' exists in both '...ActiveDirectory.Platform' & '....ActiveDirectory' - msbuild

I have a cproj which uses the method ClientAssertionCertificate from Microsoft.IdentityModel.Clients.ActiveDirectory. When I do a msbuild at the project level, I'm seeing this strange error.
error CS0433: The type 'ClientAssertionCertificate' exists in both 'Microsoft.IdentityModel.Clients.ActiveDirectory.Platform, Version=3.12.0.827, Culture=neutral, PublicKeyToken=31bf3856ad364e35' and 'Microsoft.IdentityModel.Clients.ActiveDirectory, Version=4.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e3`
I'm sure that I'm referring only the PackageReference Microsoft.IdentityModel.Clients.ActiveDirectory and no references to any other package/assembly which has Microsoft.IdentityModel.Clients.ActiveDirectory.Platform.dll.
Please let me know if any of you are aware of this and can guide me on where in the code should I do the troubleshoot.

I could figure out the issue. A project reference within my project was using a PackageReference to 'IpamAsrExports-master'. This package has the assembly "Microsoft.IdentityModel.Clients.ActiveDirectory.Platform.dll" included within. After I upgraded the package 'IpamAsrExports-master' to a newer version, it resolved the issue.

Related

MT0136: Cannot find the assembly in Xamarin.ios build time

I created an added a nuget package to my xamarin.ios project. but im getting the following build error
warning MT0136: Cannot find the assembly 'MeasureLrngth,
Version=1.0.8179.36735, Culture=neutral, PublicKeyToken=null'
referenced from
'/Users/username/Library/Caches/Xamarin/mtbs/builds/My.Abc.Startup.iOS/35d46187c89082493b5f3b5fd3d82ea9edcda431f63e4902fd/bin/iPhone/Debug/my.project.iOS.dll'.
what is the reason for this and how can I resolve this? please help me

system.design reference issue of WixSharp on .net 4

I'm trying to use WixSharp with .net 4, but I got this warning:
Warning The currently targeted framework ".NETFramework,Version=v4.0,Profile=Client" does not include "System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which the referenced assembly "WixSharp, Version=1.0.39.0, Culture=neutral, PublicKeyToken=3775edd25acc43c2, processorArchitecture=MSIL" depends on. This caused the referenced assembly to not resolve. To fix this, either (1) change the targeted framework for this project, or (2) remove the referenced assembly from the project.
I checked that System.Design is not referenced. When I tried to add reference to it, it's actually grayed out in add reference dialog.
As a result, just as the warning says, WixSharp is not resolved, and all namespaces in WixSharp has a missing of reference error.
How should I fix this? compile WixSharp from source?
Fei

Where is the version and publickey token information stored in an application?

I load a project from TFS to my local machine. But it need log4Net libary, and I download it from internet. It is rebuilt successfully. But when it runs, the exception comes.
Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral,
PublicKeyToken=1b44e1d426115821' or one of its dependencies.
The located assembly's manifest definition does not match the assembly reference.
(Exception from HRESULT: 0x80131040)
I know this is the problem of mixing the version and publickey token. But my question is, when the code runs in visual studio, how can it know that it need log4net in version1.2 ? Anyone can help? Thank you.
What you have here is an assembly in your project that is referencing the log4net assembly with this version; it can be a direct reference, or an indirect reference (your project references A.dll that references log4net.dll)
Look through your projects to find the referencing assembly, and either satisfy the reference (get the correct version through nuget, that's the easiest) or change it. The referenced assemblies are contained in the project file (*.csproj or whatever extension is applicable to your language) with a Reference tag
When you include a reference, the naming strength will depend on what settings you chose:
<Reference Include="name">
<!-- here no version is specified because no specific version is needed -->
<Reference Include="name, Version=xxx, Culture=neutral, processorArchitecture=MSIL">
<-- version is specified, perhaps because a specific version was referenced at one time -->
Some more info can be found on this very site

Using ILMerge to merge multiple dll files into one dll, some of the dll files cannot be used

I have a library project that is working properly, and it is using the fluent nhibernate, npgsql, enyim.caching dll files, I use the ilmerge to combine all files into one, and after that the merged dll file is referenced by another project, then it doesn't work, it complains cannot find assembly of enyim.caching.dll, and the missing configuration of nhibernate
The command I am using for merging is below
ilmerge /targetplatform:v4 /target:library /out:testmerged.dll Release/Enyim.Caching.dll Release/FluentNHibernate.dll Release/Iesi.Collections.dll Release/log4net.dll Release/Mono.Security.dll Release/NHibernate.Caches.SysCache.dll Release/NHibernate.dll Release/Npgsql.dll Release/mylib.dll
The error from the project referencing it:
Message = "'FluentNHibernate.Automapping.IAutoClasslike, testmerged, Version=2.12.0.0, Culture=neutral, PublicKeyToken=null' is missing a parameterless constructor."
Message = "Could not load file or assembly 'Enyim.Caching' or one of its dependencies. The system cannot find the file specified."
I pay attention to those 2 dll files are using the runtime version v2.0.50727, and all files under runtime version v4.0.30319 are working correctly.
So, can you guys give any suggestion how to fix this issue?
Thanks
Ok, finally, I found the solution to enyim.caching.dll
I have to add
<sectionGroup name="enyim.com">
<section name="memcached" type="Enyim.Caching.Configuration.MemcachedClientSection, testmerged"/>
</sectionGroup>
<section name="memcached" type="Enyim.Caching.Configuration.MemcachedClientSection, testmerged"/>
in my configuration file

Where could I get mono's TPL.Dataflow?

I am working with mono-3.0.10 on a Macbook. In the mono 3.0 release note, Tpl.Dataflow is mentioned, and I also noticed that the source code of Tpl.Dataflow is there in mono's github repo master branch.
But I couldn't find it in my local mono install.
logan#Logans-MBA /Library/Frameworks/Mono.framework
{13-06-04 3:47:48} $ find . -name "*.Dataflow.*"
./Versions/3.0.10/lib/mono/4.5/System.Threading.Tasks.Dataflow.dll
logan#Logans-MBA /Library/Frameworks/Mono.framework
{13-06-04 3:59:55} $ file ./Versions/3.0.10/lib/mono/4.5/System.Threading.Tasks.Dataflow.dll
./Versions/3.0.10/lib/mono/4.5/System.Threading.Tasks.Dataflow.dll: broken symbolic link to ../gac/System.Threading.Tasks.Dataflow/4.0.0.0__b77a5c561934e089/System.Threading.Tasks.Dataflow.dll
I have tried reinstall the mono from installer, but no luck.
Then, I tried the dlls downloaded from nuget, the following errors comes:
/Users/logan/Workspace/Camp/Dragon/ClientEventHandlerDemos/DataflowBlockClientEventHandler.cs(11,13): error CS0012: The type `System.Object' is defined in an assembly that is not referenced. Consider adding a reference to assembly `System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
/Users/logan/Workspace/Camp/Dragon/ClientEventHandlerDemos/DataflowBlockClientEventHandler.cs(11,34): error CS0012: The type `System.Action`1<TInput>' is defined in an assembly that is not referenced. Consider adding a reference to assembly `System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
There are 3 editions from nuget, net45, netcore45 and portable-net45. I tried them all, but still no luck.
So, where could I find the right update to date Tpl.Dataflow works with mono?