Unhandled exception (4.1.15.0, postsharp.4.0-x86.exe, CLR 4.0.30319.378758, Release): PostSharp.Sdk.CodeModel.AssemblyLoadException - postsharp

I have updated PostSharp from v 4.1.3-alpha to v 4.1.15. There is no issue when I build on my local developer box, but when queueing a gated build it's failing on build server with the following error:
Unhandled exception (4.1.15.0, postsharp.4.0-x86.exe, CLR 4.0.30319.378758, Release): PostSharp.Sdk.CodeModel.AssemblyLoadException: Cannot find assembly 'mscorlib, version=2.0.5.0, culture=neutral, publickeytoken=7cec85d7bea7798e'. [Public key mismatch]
I updated to the same version from v 4.1.6-alpha in a different solution and build server could build it successfully.
Can any one help me in understanding why PostSharp is looking for mscorlib v 2.0.5.0 when all the projects in the solution are targeting .NET v 4.5.1?
How can I resolve this issue?

Related

how to get nuget unity

I referred to this one
https://learn.microsoft.com/en-us/visualstudio/cross-platform/unity-scripting-upgrade?view=vs-2017#taking-advantage-of-net-compatibility
i attempted to get nuget npgsql and microsoft office
but this error is occured.
Assembly 'Assets/Plugin/Microsoft.Office.Interop.Excel.dll' will not be loaded due to errors:
Unable to resolve reference 'office'. Is the assembly missing or incompatible with the current platform?
Reference validation can be disabled in the Plugin Inspector.
Unable to resolve reference 'Microsoft.Vbe.Interop'. Is the assembly missing or incompatible with the current platform?
it was same to happen exactly like npgsql
how to get nuget in unity
You might want to check out this asset: https://github.com/GlitchEnzo/NuGetForUnity

Xamarin PCL compile issues

I am getting XAML compiler error in my PCL project
Cannot resolve Assembly or Windows Metadata file 'System.Core.dll
Type universe cannot resolve assembly: System.Runtime,
Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
error CS0518: Predefined type 'System.Object' is not defined or
imported
Could you please help me or tell me any workaround for this.
Am using VS 2017 Enterprise edition and doing Xamarin Mac.

SqlPackage.exe command throwing errors after upgrade

We use PowerShell scripts to deploy SQL database. This scripts are using SqlPackage.exe utility to publish our main database, it was working fine until we upgraded SSDT to it's latest release SSDT 2015 when it stated to throw the error below.
PowerShell Script Line:
& "C:\Program Files (x86)\Microsoft SQL Server\120\DAC\bin\SqlPackage.exe" /Action:Publish /SourceFile:"$DatabaseDacpacLocation" /TargetServerName:$DataServerSqlInstance /TargetDatabaseName:$Database /Variables:master="$MasterDatabase" /v:DatabaseName="$pDatabaseName" /p:ExcludeObjectType=Sequences
Error:
Unhandled Exception: System.TypeInitializationException: The type
initializer for 'Microsoft.SqlServer.Dac.DacPackage' threw an
exception. ---> System.TypeInitializationException: The type
initializer for 'Microsoft.SqlServer.Dac.DacServices' threw an
exception. ---> System.TypeInitializationException: The type
initializer for 'SqlSchemaModelStaticState' threw an exception. --->
System.IO.FileNotFoundException: Could not load file or assembly
'Microsoft.SqlServer.TransactSql.ScriptDom, Version=12.0.0.0,
Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its
dependencies. The system cannot find the file specified.
It looks like your deployment environment is missing SqlDom version 12 (Microsoft.SqlServer.TransactSql.ScriptDom.dll), which is expected to be in the GAC. You can download it from the SQL Server 2014 Feature Pack page here: https://www.microsoft.com/en-us/download/details.aspx?id=42295
There are two files you should download and install - the x64 and x86 versions of SqlDom.msi.
It appears that you're currently using the SQL Server 2014 version of the data-tier application framework. Note that if you update to the SQL Server 2016 version of the data-tier application framework (DacFX), you'll need to ensure that the newer version (v13) of DacFX's dependencies (SqlSysClrTypes.msi and SqlDom.msi) are also installed.

CRM 2013: Error Custom Workflow Assembly Profiler

I'm trying to debug my custom workflow assembly using the plugin registration tool for the first time. We are using CRM 2013 on-premise version.
However in setting up the profiler, I got this error below about my mismatched version of 'Microsoft.Xrm.Sdk.Workflow'.
Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Xrm.Sdk.Workflow, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)........................
I see that my Microsoft.Xrm.Sdk.Workflow version in the reference property is actually 5.0.0.0. However when I delete and re-add the reference (from the CRM 2013 SDK), then it shows a different version 5.0.9690.3739.
I read other questions about this, but I don't exactly understand how to synch the correct version together. Could someone please let me know how to do this step-by-step - if I need to change the one on the CRM server.
Notice the difference version between the two pics.

Which is the right version for Fasterflect using SNAP?

When using autofac with snap, I encounter the following exception:
Test method Halcyon.Mall.Logging.LogCallTests.FooLogCallInterceptor_ShouldBeCalled threw exception:
Autofac.Core.DependencyResolutionException: An exception was thrown while executing a resolve operation. See the InnerException for details. ---> System.IO.FileLoadException: Could not load file or assembly 'Fasterflect, Version=2.0.1.0, Culture=neutral, PublicKeyToken=a64e1179c81b1e25' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
The autofac (2.5.2.830) is installed as a nuget package manually.
The fasterflect (2.0.4429.39723) is installed automatically as a dependent package of SNAP (1.7.3)
I had the same problem today with Snap 1.7.7 -- the latest version. Snap.StructureMap appears to require Fasterflect 2.0 but a NuGet of Snap 1.7.7 retrieves the latest Fasterflect, which is 2.1. I was able to solve it by downloading Fasterflect 2.0.2 using NuGet in a separate project (PM> Install-Package Fasterflect -version 2.0.2), then deleting the existing reference to Fasterflect from my main project, then browsing to and adding a file-based reference to the older Fasterflect 2.0.2 DLL.