Test error :Could not load file or assembly 'Castle.Core, Version=4.0.0.0, Culture=neutral - nuget-package

I installed the free startup template of ASP.NET Boilerplate with the architecture Asp.Net Mvc5.x and Single Page Web Application Angular JS
and when I run the already added test to template as an example which is called Should_Get_Current_User_And_Tenant_When_Logged_In_As_Tenant() which is found in the project
SpecificDownloadedProjectName.Tests
I get the error
Could not load file or assembly 'Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
my current version of castle.core is v4.3.1
and of Abp 3.8.3
and these versions are the last latest available ones in NuGet packages
I tried to update Castle.core via NuGet Package Manager to be 4.0.0 as the exception message mentions but I couldn't with the following error
Severity Code Description Project File Line Suppression State
Error Unable to resolve dependencies. 'Castle.Core 4.0.0' is not compatible with 'Abp 3.8.3 constraint: Castle.Core (>= 4.3.1)', 'Castle.Core-log4net 4.3.1 constraint: Castle.Core (= 4.3.1)', 'Castle.DynamicProxy 2.2.0 constraint: Castle.Core (= 1.2.0)'. 0
what should I do in order to resolve this exception

This is the issue with the Nuget, it doesn't resolve it sometime, so you have to manually add the below lines in the web.config or app.config. You have to make sure the order of the lines also.
<dependentAssembly>
<assemblyIdentity name="Castle.Core" publicKeyToken="407dd0808d44fbdc" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.0.0.0" />
</dependentAssembly>
Note: You can set the oldVersion and newVersion values as per the requirement.

Related

ServiceStack.text not Load file System.Memory

Good morning,
we are developing a dll that uses ServiceStack.Text.dll (5.4).
The installation in the project was done via nuget.
Locally the application works fine while on a server machine it has problems.
The following error occurs when loaded into memory and run on in Windows Server 2012 r2 standard .
We have the following error:
System.TypeInitializationException: The type initializer for 'ServiceStack.Text.TypeSerializer' threw an exception. ---> System.TypeInitializationException: The type initializer for 'ServiceStack.Text.JsConfig' threw an exception. ---> System.IO .FileNotFoundException: Could not load file or assembly 'System.Memory, Version = 4.0.1.0, Culture = neutral, PublicKeyToken = cc7b13ffcd2ddd51' or one of its dependencies.
The system cannot find the file specified.
But in our build folder the indicated system.memory is available and also its dependencies.
Do you have any suggestions?
You'll likely need an Assembly Binding in your Web.Config (or App.Config for non Web Apps) to reference the version of System.Memory your project has referenced, something like:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Memory"
publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>

Unresolved assembly reference with sandcastle

I am trying to generate documentation with sandcastle help file builder. While building the project in the sandcastle i am getting the following error.
MRefBuilder : error : Unresolved assembly reference: Microsoft.Owin (Microsoft.Owin, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35) required by Microsoft.AspNet.Identity.Owin [C:\Users\inkosah\Documents\Help\Working\GenerateRefInfo.proj]
Last step completed in 00:01:19.4610
Can anybody help me to resolve this issue? I also tried adding it separately to project references in the sandcastle but no help.
Solution 1 : Add missing references to a dummy project.
Create 'dummyProject' (ie class library)
In Visual Studio - Package Manager Console
Install-Package Microsoft.Owin -Version 2.1.0.0 -ProjectName dummyProject
Install-Package Microsoft.Owin.Security.OAuth -version 2.1.0.0 -ProjectName dummyProject
In Sandcastle Help Fil Builder - Project Explore, add two references
Microsoft.aspNet.identity.Owin (dll found in ..\packages\Microsoft.AspNet.Identity.Owin.2.2.0\lib\net45)
Microsoft.Owin (dll found in ..\packages\Microsoft.Owin.2.1.0\lib\net45\Microsoft.Owin.dll)
It looks like MRefBuilder found that Microsoft.AspNet.Identity.Owin relies on Microsoft.Owin (== v 2.1.0) and not Microsoft.Owin (>= 2.1.0).
The main project is still using Microsoft.Owin 3.0.1.0
Solution 2 : Ignore unresolved references
In Documentation (or SHFB) Project Properties / Plug-Ins :
Add "Assembly Binding Redirection" in "Plugs-Ins in This Project"
configure it to "ignore if Unresolved" "Microsoft.Owin" and "Microsoft.Owin.Security.OAuth"

Monotouch - Failed to resolve ExtensionAttribute

Using Xcode 5.0.1 with Xamarin studio Version 4.0.13 (build 38) and Xamarin.iOS
Version: 6.2.4.2
I am getting this error when trying to compile my project:
error MT2002: Failed to resolve "System.Void System.Runtime.CompilerServices.ExtensionAttribute::.ctor()" reference from "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
How can I solve it?
The reason for this error is that between .NET 2.0 (including Silverlight) and 4.0 the [Extension] attribute moved from System.Core.dll to mscorlib.dll.
Xamarin.iOS 6.2 (and earlier) were based on a superset of Silverlight (aka the 2.1 profile). So the [Extension] attribute was located in System.Core.dll.
Since Xamarin.iOS 6.3+ the product was re-based on Mono 3.0 and the profile was updated to use the newer 4.0/4.5 profile. Now the [Extension] attribute is located in mscorlib.dll.
In your case you had a binary assembly compiled against the newer (4.0) profile. That assembly had a reference to mscorlib, Version=4.0.0.0, ... to find [Extension] and would lead to errors if built against the older Xamarin.iOS (6.2 and earlier).
As you found out the easy solution was to update to the latest Xamarin.iOS release. Another way to solve this (without updating Xamarin.iOS) would have been to rebuild (if you have the source) the binary assemblies of your project against the assemblies (BCL) shipped with Xamarin.iOS 6.2.

The dependency ''mscorlib, Version=2.0.0.0,...' was not found

i get the following error by compiling my project:
warning MT3005: The dependency 'mscorlib, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089' of the assembly
'ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral,
PublicKeyToken=null' was not found. Please review the project's
references.
warning MT3005: The dependency 'System, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089' of the assembly
'ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral,
PublicKeyToken=null' was not found. Please review the project's
references.
warning MT3006: Could not compute a complete dependency map for the
project. This will result in slower build times because Xamarin.iOS
can't properly detect what needs to be rebuilt (and what does not need
to be rebuilt). Please review previous warnings for more details.
I've found out that the System dependency of my project uses the version 2.0.5.0 and the ZipSharp uses 2.0.0.0
What should I do?
To fix the warnings you need to get (or build from sources) a version of ZipSharp that is compiled against the BCL (mscorlib.dll, System.dll) that is shipped with Xamarin.iOS (i.e. 2.0.5.0).
Note that those are warnings, not errors, so it might work.

Reactive (Rx) build issue with .Net 4.5 and NuGet

This has caused me quite the embaressment today. While I was demoing Rx 2.x features and capabilities, I tried to build a NuGet enabled project which I copied from another computer.
Everything was downloaded correctly, the references are there! but I can't compile.
These two below assemblies are causing the issue. I am wondering if anyone has faced this issue with restroing Rx assemblies into a .Net 4.5 project.
System.Reactive.Windows.Threading
Warning 11 The primary reference "System.Reactive.Windows.Threading,
Version=2.1.30214.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35,
processorArchitecture=MSIL" could not be resolved because it has an
indirect dependency on the framework assembly "System.Threading.Tasks,
Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
which could not be resolved in the currently targeted framework.
".NETFramework,Version=v4.5". To resolve this problem, either remove
the reference "System.Reactive.Windows.Threading, Version=2.1.30214.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35,
processorArchitecture=MSIL" or retarget your application to a
framework version which contains "System.Threading.Tasks,
Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
And System.Reactive.PlatformServices
Warning 26 The primary reference "System.Reactive.PlatformServices"
could not be resolved because it has an indirect dependency on the
framework assembly "System.Runtime.Extensions, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which could not be
resolved in the currently targeted framework.
".NETFramework,Version=v4.5". To resolve this problem, either remove
the reference "System.Reactive.PlatformServices" or retarget your
application to a framework version which contains
"System.Runtime.Extensions, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a".
Couldn't compile:
Error 73 The type or namespace name 'IScheduler' could not be found
(are you missing a using directive or an assembly
reference?)
Error 74 The type or namespace name 'CompositeDisposable' could not be
found (are you missing a using directive or an assembly
reference?)
My psychic debugger says this has something to do with either mixing references to .NET 4.0 and .NET 4.5 Rx DLLs in a project, or Microsoft.Bcl.Async.

Resources