Microsoft.FxCop.Sdk.InvalidMetadataException : Could not resolve member reference - c#

I am running a team city build, which is failing continuously because of FXCope unable to resolve the reference.
Getting following error:
The following error was encountered while reading module 'project': Could not resolve member reference: [dllNamespace, Version=1.0.0.238, Culture=neutral, PublicKeyToken=null]dllNamespace.IoC::Setup.
The actual version of the dll is 1.0.0.238 and it is present in the teamcity build and all my tests are getting passed but at the end of the build Fxcope throw the above error.

Related

WCF Async Web Services issues

I'm having several issues with my WCF client in that the client Reference.cs is empty and the only error I get on the build is the useless generic message:
Severity Code Description Project File Line Suppression State
Warning Custom tool warning: Cannot import wsdl:portType
Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporter
Error: The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
XPath to Error Source: //wsdl:definitions[#targetNamespace='http://tempuri.org/']/wsdl:portType[#name='IBrokerWcf'] MyWeb.Setup C:\Users\me\Projects\MyWeb 3.x\MyWeb v3.x\MyWeb.Setup\Service References\BrokerWcfSvc\Reference.svcmap 1
When I load the Service in the WCF Test Client, all of the advertised async methods error out (see image) with "This Operation is not supported in the WCF Test Client because it uses type System.Threading.Tasks.Task'1"
All of this previously worked fine. Not sure what changed to send it all sideways.
System.ServiceModel.Description.DataContractSerializerMessageContractImporter
Error: The located assembly's manifest definition does not match the
assembly reference.
As the error says, the manifest definition of the locating assembly does not match the assembly reference.
You need to check the components. Did you click "Reuse types in referenced assemblies" when adding a service reference.
This Operation is not supported in the WCF Test Client because it uses
type System.Threading.Tasks.Task'1"
The "error" you are seeing is just a limitation of the test tool that comes with visual studio, both functions call the same server side function so there is no compelling force to make Microsoft add support. There is no actual error. If you really want to test the async version you will need to write your own test client that calls the function.
Error : not supported in WCF Test client because it uses type System.Threading.Tasks

Web Assembly not compiling with linker error [Uno Platform]

So, I have been trying to compile a project in web assembly with Uno Platform, but I have not been able to successfully compile due to a linker error, This error is something like this:
Fatal error in Mono IL Linker
Mono.Linker.MarkException: Error processing method: 'System.Void Microsoft.Xaml.Interactivity.Behavior::.cctor()' in assembly: 'Microsoft.Xaml.Interactivity.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve Uno.Diagnostics.Eventing.IEventProvider Uno.Diagnostics.Eventing.Tracing::Get(System.Guid)
I thought that maybe the Uno.Diagnostics.Eventing was missing or something, so, I've installed but after doing that the error persists.
I don't know what the error could be or if it is related to something else, anyone can give a hand?
Well, it seems that for my specific version of Uno.WebAssembly (3.0.17) I needed the package Uno.Microsoft.Xaml.Behaviors.Uwp.Managed to be on version 2.0.2-uno.79 to work. Simple as that

AddictedCS SoundFingerprinting giving netstandard error

I am attempting to use AddictedCS SoundFingerprinting (https://github.com/AddictedCS/soundfingerprinting).
When I download any recent version and build with Visual Studio 2019 I get the expected output with no errors or warnings (SoundFingerprinting.dll).
The issue is that when I attempt to call functionality from the DLL in a .net console application I get errors relating to netstandard referencing.
I've attempted to add a new reference manually as the error message suggests, but get no further - same error occurs.
Here is my code, taken straight from the SoundFingerprinting example:
var hashedFingerprints = await FingerprintCommandBuilder.Instance
.BuildFingerprintCommand()
.From("C:/Users/Asher/Desktop/testSound.wav")
.UsingServices(audioService)
.Hash();
Here is the error log I am getting when compiling my console app with either mcs or csc:
C:\Users\Asher\Desktop\Raw_0.1>mcs TestProg.cs
-r:SoundFingerprinting.dll -r:protobuf-net.dll TestProg.cs(46,40): error CS0012: The type System.Object' is defined in an assembly that
is not referenced. Consider adding a reference to assembly
netstandard, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=cc7b13ffcd2ddd51'
C:\Users\Asher\Desktop\Raw_0.1\SoundFingerprinting.dll (Location of
the symbol related to previous error) Compilation failed: 1 error(s),
0 warnings
I attempted this on my desktop PC running Windows 10, and on my Surface Pro 6 running Windows 10. I also attempted this using VS2017. The result was the same each time.
Also tried to use the library in Unity3D which caused a crash with no prompt or stacktrace output.
To Reproduce
Use: Windows 10, Visual Studio 2019
Steps to reproduce the behavior:
Download latest release (v7.2.0-beta3)
Build libraries
Attempt to call functionality from SoundFingerprinting.dll via a console application
I encountered exactly the same problem today. What fixed it for me was simply downloading the latest version of protobuf-net from nuget:
Install-Package protobuf-net -Version 3.0.101
Also, please don't paste pictures of code but the code itself next time.

The mysterious "Couldn't not load file or assembly 'System.ServiceModel, Version=4.0.0.0..." error

Scenario: I have a WCF endpoint (endpoint Manufacturing) that connects another WCF endpoint (endpoint DataAPIClient) as ConnectedService. The constructor of an entity in A instantiate the "client" (see below). On top of all these, I have a xUnit test project testing A.
// Manufacturing constructor
public Manufacturing() {
client = new DataAPIClient();
}
// Instantiating in the xUnit project
Manufacturing endpoint = new Manufacturing();
Problem: Something changed (and I couldn't figure out what) that when the test project tries to instantiate Manufacturing. I got this error:
Message: System.IO.FileNotFoundException : Could not load file or assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified.
I have verified the System.ServiceModel.dll in both endpoints. DataAPIClient has 4.0.30319 and manufacturing has 4.0.0.0.
P.S. I did change the name of the Manufacturing project...not sure if that caused that, but I thought it might be worth of mentioning.
Any help is greatly appreciated...I've been googling and found nothing.
per howcheng's suggestion, I noticed that since I was using xUnit Test Project (.NET Core), I couldn't (or maybe I just didn't know how) add any reference to System.ServiceModel.dll. So I created a Unit Test Project (.NET Framework) and added the xUnit Nugets and System.ServiceModel.dll assembly. The error went away.

strange compilation error vs 2012

The error
Error 102 Code Analysis detected errors. See Code Analysis results window or log file for details. KickOffTitan
Code Analysis results window
CA0001 Error Running Code Analysis
CA0001 : The following error was encountered while reading module 'KickOffTitan':
Method type parameter in position 0 is not valid.
[Errors and Warnings] (Global)
I have some inkling that this might have to do with using vs2012 + .net 4.0 + Microsoft.Bcl.Async
If I remove async/await but leave in TaskEx
I get many Method type parameter in position 0 is not valid and 1
CA0001 Error Running Code Analysis CA0001 : Could not resolve reference to System.Threading.Tasks, Version=1.5.11.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. [Errors and Warnings] (Global)
If i remove any stuff from async package(async/await/TaskEx) it compiles

Categories

Resources