Could not load file or assembly 'Microsoft.VisualStudio.QualityTools.UTFResources - c#

After moving the project for another team project i start to get the following error when, running a unit test, an assert fails:
"Could not load file or assembly
'Microsoft.VisualStudio.QualityTools.UTFResources, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
System.IO.FileNotFoundException
There is no failed references for the test project

Solved by removing :
Microsoft.VisualStudio.QualityTools.UnitTestFramework
'Microsoft.VisualStudio.QualityTools.UnitTestFramework.Extension'
and adding `Microsoft.VisualStudio.QualityTools.UnitTestFramework Version=10.1.0.0', the last version available on my instalation.
Extension dll was not even available to add.

Related

Xamrain form build task reference error in visual studio 2017

I am using visual studio 2017 and when I install xamrain from build 3.0 then I get the error bellow running application. How to resolve this problem?
Severity Code Description Project File Line Suppression State
Error The "Xamarin.Forms.Build.Tasks.GetTasksAbi" task could not be
loaded from the assembly
D:\Practics\AndroidApp\packages\Xamarin.Forms.3.0.0.561731\build\netstandard2.0\Xamarin.Forms.Build.Tasks.dll.
Could not load file or assembly 'netstandard, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its
dependencies. The system cannot find the file specified. Confirm that
the 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. AndroidApp.Android D:\Practics\AndroidApp\packages\Xamarin.Forms.3.0.0.561731\build\netstandard2.0\Xamarin.Forms.targets 36
Severity Code Description Project File Line Suppression State Error The "Xamarin.Forms.Build.Tasks.GetTasksAbi" task could not be
loaded from the assembly
D:\Practics\AndroidApp\packages\Xamarin.Forms.3.0.0.561731\build\netstandard1.0\Xamarin.Forms.Build.Tasks.dll.
Could not load file or assembly 'netstandard, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its
dependencies. The system cannot find the file specified. Confirm that
the 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. AndroidApp D:\Practics\AndroidApp\packages\Xamarin.Forms.3.0.0.561731\build\netstandard1.0\Xamarin.Forms.targets 36
Well, This is xamarin-forms v 3.0 known issue with visual studio 2017. I faced same issue on last week (ref : https://bugzilla.xamarin.com/show_bug.cgi?id=60293).
Fix : Install .NET framework 4.7.1. from Microsoft(https://www.microsoft.com/en-us/download/details.aspx?id=56116) and then restart your system.

From where would a referenced assembly's culture info be loaded? And how to set it to "neutral"?

I have a C# project to create a dll and the project is referencing the System.ComponentModel.Composition assembly. Building the project does not create any errors, but when running the application, it shows with the built dll and throws this error:
Exception ::Could not load file or assembly 'System.ComponentModel.Composition.resources, Version=4.0.0.0, Culture=en-NZ, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.
I am not sure what this error means but I think that the Culture is not supposed to be en-NZ, I think it should be neutral. Is there a way to change that to neutral?

Could not load file or assembly 'Microsoft.SqlServer.Types, Version=12.0.0.0, Culture=neutral, PublicKeyToken=myKey' or one of its dependencies.

After running an ASP.NET C# application with SQL SERVER version 2012, I get the following error message:
An error occurred during local report processing.
The definition of the report 'C:\inetpub\wwwroot\psla\Reports\PD Listing Report - Per ED.rdlc' is invalid.
An unexpected error occurred in Report Processing.
Could not load file or assembly 'Microsoft.SqlServer.Types, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
What could be the cause? I have tried searching the net and there are references to version=11.0.0.0 but there are no references to version=12.0.0.0 for 'Microsoft.SqlServer.Types'. Reviewing the reference Manager for visual studio 2015, I was only able to find up to version=11.0.0.0.
In your Package Manager download the 12 version from Nuget
https://www.nuget.org/packages/Microsoft.SqlServer.Types/
Also see that entry for this is backward compatible in web.config
In your references folder right click and set copy local = true
It appears that some library in your project is referencing Microsoft.SqlServer.Types, Version=12.0.0.0 but .NET runtime cannot find it at execution.
On the web server, where the application is running, make sure that there exists a following directory: C:\Windows\assembly\GAC_MSIL\Microsoft.SqlServer.Types\12.0.0.0__89845dcd8080cc91\
Also make sure that this directory has the file Microsoft.SqlServer.Types.dll of version 12 (12.0.2000.8). Different versions of the file can be downloaded from https://www.nuget.org/packages/Microsoft.SqlServer.Types/

Google Api - System.IO.FileNotFoundException : Could not load file or assembly 'System.Net.Http.Primitives'

I'm getting the following exception when trying to use the Google Auth API:
System.IO.FileNotFoundException : Could not load file or assembly 'System.Net.Http.Primitives, Version=4.2.28.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
----> System.IO.FileNotFoundException : Could not load file or assembly 'System.Net.Http.Primitives, Version=1.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
The exception happens in Google.Api.Core.dll.
If I check the /Bin folder I can see Sytem.Net.Http.Primitives.dll in there and the version is 4.2.28.0.
I have tried updating the Microsoft HTTP Client Libraries NuGet package but that didn't help.
Is the problem something to do with a mismatch of .dll versions? If so how can I resolve that? Or is it something else entirely?
Double check if the assembly file is there in the bin folder and if its there, then try removing the reference and again add it to your project.
The version should be the same as expected. Also check on your web.config too for what it has about this particular assembly.
In your error code, I can see two different versions for the same file. Means probably, you are getting a clash between the existing assembly and the referenced assembly. Check you web.config for which version is referenced there and make sure you have the same version added to your project.
This link might help :
Could not find assembly System.Net.Http.Primitives

Could not load file or assembly 'System.Web.Mvc In Unit Test

I have unit tests and inside them I call a method that eventually calls this line:
DataSourceResult response = lstshiftGroup.ToDataSourceResult(request);
Which throws this exception:
Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
In my test project I have reference of System.Web.Mvc, Version=4.0.0.0 and in my project I have the same assembly.
What is wrong with my test?
You need to add reference to Asp.Net MVC to your Unit Test project. You can do this with NuGet. Here is the link to NuGet for MVC. Follow the instructions there to install it into your Unit Test project: https://www.nuget.org/packages/aspnetmvc

Categories

Resources