BTSTask AddResource Fails Even with Shared Assemblies in GAC - command-line

I am trying to create a BizTalk application (App1) and add resources using the BTSTask command line utility. Some of the App1 BizTalk assemblies depend on a few SharedApp BizTalk assemblies. I added the SharedApp assemblies to the GAC using gacutil and verified they were present in the GAC. When I run BTSTask AddResource, the command fails for any App1 BizTalk assembly that depends on any of the SharedApp assemblies.
The error message tells me a specific SharedApp dll cannot be found for reference. I have verified the details (name, version, etc.) on the SharedApp assembly are correct; it is the correct assembly and is present in the GAC.
Shouldn't BizTalk be able to detect those SharedApp assemblies in the GAC and allow them to be used as reference assemblies when I call AddResource?
Any thoughts on why adding the SharedApp assemblies to the GAC did not solve my problem?
EDIT: Adding command line example text
BTSTask.exe AddApp -ApplicationName:App1 -Server:BTServer1 -Database:BTDatabase1 -Description:App1_instance
BTSTask.exe AddResource -ApplicationName:App1 -Source:"path_to_App1.Assembly.dll" -Destination:"destination_path_for_App1.Assembly.dll" -Type:BizTalkAssembly -Options:GacOnAdd,GacOnInstall -Overwrite -Server:BTServer1 -Database:BTDatabase1

Is this BizTalk 2010? In that case, it might be something to do with the 'dual cache' that was introduced with .NET 4.0.
As you might know, there are now 2 global assembly caches and assemblies from the 2.0 GAC cannot use 4.0 GAC assemblies.
So maybe your SharedApp is in the .NET4.0 cache and the resource you want to add is compiled against an older version of BizTalk?
Just thinking out loud, you never know if it helps.
Cheers

After spelunking into our automation and enabling detailed logs, I was able to get a clearer error message:
Error: Assembly "App1.Assembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxx" references the following assemblies that must be deployed before deploying this assembly: Assembly "SharedApp.Services, Version=1.0.0.0, Culture=neutral, PublicKeyToken=yyyyyyyyyyyyyyyy"
After an online search for that error, I uncovered the following from a discussion post:
If [a] DLL contains XSD (BizTalk) schemas it must also be deployed to
the BizTalk management database.
Apparently, this must be done in addition to adding the assemblies to the GAC. This is the reason why adding App1 assemblies to my application would fail; although I added the SharedApp BizTalk assemblies to the GAC, they were also needed in the BizTalk management database.
Thank you to those who took a look at this issue.

Related

Could not load file or assembly - when all dependency present and all sign present and assembly loading to GAC

I try to deploy COM-object to my server, I have deployed to this server a lot of objects and always all going fine, but not at this time.
Firstly, COM-object registered successfully and ProgID is present.
Secondary, all dependency is present and loading successfully.
Third point, I checked all sign and all sign is present.
Forth point I add all library to GAC.
Test is ordinary and no matter, this is simple call my COM-object.
It's look as all checkpoint done and test must be working. However, I see error
Could not load file or assembly 'HtmlRenderer.PdfSharp, Version=1.5.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)
I can not understand this trouble. What going wrong?

bindingRedirect for Azure Function using EF Core 2

Targeting Framework 4.6.1 and creating an Azure Function using VS2017 which uses EF Core 2. I'm getting the error:
Could not load file or assembly 'System.ValueTuple, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies.
...which I normally solve with a bindingRedirect in the app.config file. Since Azure Functions don't use app.config, is there a way to solve this? Do I need to use EF 6 instead?
Functions are loaded into the same process as Azure Functions, so you only have access to the same version of the assemblies that the runtime pre-loads.
This is a know issue and there is work being done on it. I believe they are working on some kind of "language service" where we'll have complete control over what assemblies are loaded.
Until then, there are some work-arounds:
Azure Functions binding redirect

FxCop indirect reference to System.Core version 2.0.5.0

I've got a project that uses Autofac, and the WebAPI integration
We run FxCop over our solution, and on opening autofac, I get the following:
The following indirectly-referenced assembly could not be found. This
assembly is not required for analysis, however, without it, analysis
results could be incomplete. This assemble was referenced by
Autofac.dll
System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes
This causes the following error on our CI server:
FxCop return code (516): PROJECT_LOAD_ERROR ASSEMBLY_REFERENCES_ERROR
Is there a way to tell FxCop to ignore this?
Had the same issue with AutoMapper 3.1.0 on our project. The real problem is an old version of FxCop. The last official release was FxCop 10.0, but new versions of FxCop have been bundled with Visual Studio since 2012.
I just replaced the FxCop 10.0 with the version that can be found in:
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Team Tools\Static Analysis Tools\FxCop
or
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Team Tools\Static Analysis Tools\FxCop
and the problem was solved.
This is a common FxCop thing when running with Portable Class Libraries. It's not Autofac; you just happen to see it because Autofac is the only PCL you're using. In my experience, this error doesn't seem to happen if you're building on a Windows 8 machine, but on Windows 7 or Server 2008R2 I see this a lot.
It's not a bug, and no, you won't find 2.0.5.0 on your machine. That version is actually for Silverlight and runtime .NET "stuff" handles redirection to the right assembly version. Unfortunately, FxCop is less cooperative.
I see the same thing in my build and solved it using the suggestions from questions like this: How to fix FxCop error code 512?
You must add a reference to the assembly's directory in the FxCop project file. For instance:
<Targets>
<AssemblyReferenceDirectories>
<Directory>C:/Windows/Microsoft.NET/assembly/GAC_MSIL/Microsoft.Web.Infrastructure/v4.0_1.0.0.0__31bf3856ad364e35/</Directory>
<Directory>C:/Windows/Microsoft.NET/assembly/GAC_MSIL/System.Web.Mvc/v4.0_3.0.0.0__31bf3856ad364e35/</Directory>
</AssemblyReferenceDirectories>
Workaround for this issue is to copy the missing System.Core.dll to the project output directory. I made this as a postbuild event to copy System.Core.dll from a shared folder to project\bin directory.
You can get the copy of System.Core.dll from the Silverlight SDK 2 installation.
Now fxcop runs successfully without any issues. Note that I was using Fxcop integrator for Visual Studio 2010.

asp.net MVC 4 deploy on azure Could not load file or assembly 'DotNetOpenAuth.Core'

Hello I am trying to deploy asp.net MVC 4 project on azure
but I get this problem. I searched a lot about the solution but it looks like none
suit my case, this is the Error message I get :
Could not load file or assembly 'DotNetOpenAuth.Core, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=2780ccd10d57b246' or one of its
dependencies. The located assembly's manifest definition does not
match the assembly reference. (Exception from HRESULT: 0x80131040)
Before the dotnetopenAuth have no reference in my project I downloaded
but still get the same error .
Anyone have an idea?
I know this is old, but I came across a similar problem and this question popped up as the closest case. This was my issue:
http://developers.de/blogs/damir_dobric/archive/2013/09/26/windows-azure-websites-error-could-not-load-file-or-assembly-dotnetopenauth-core.aspx
Being, a previous MVC project had been deployed, which contained these references. I deleted them by downloading the publish profile, and, with the "Remove additional files at destination" option checked, I published to Azure.
While publishing, you can select "Remove additional files at destination" and then publish again.
I ran into this issue with continuous deploy between visual studio online and azure.
I modified my build file and changed the "Do Not Delete" setting under "Deployment" in the "Process" Tab to False.
Good to go.
This is a case of version mismatch. The error itself says that manifest definition does not match.
Look carefully at the version of the referenced assembly and the version shown in error message.
In case you are not using openauth you can remove it's reference all together.

WCSF Random assembly manifest definition does not match assembly ref in .NET 2.0

I'm running WCSF Feb 2008 along with Enterprise Library 3.1 and noticed that randomly I get the "fun"
Could not load file or assembly Microsoft.Practices.EnterpriseLibrary.Common, Version=3.1.0.0, Culture=neutral, Public ... The located assembly's manifest definition does not match the assembly reference.
Usually this wouldn't be worth mentioning on stackoverflow, but the strange thing is that the first time I fire this up it breaks, but if I close it down and simply hit F11 again - it works .... strange. Does anyone know why this might break sometimes, but not others?
The problem was related to my version of the data access DLL I was adding. I found that if I went to the following:
C:\Program Files\Microsoft Web Client
Software Factory February
2008\Microsoft Practices Library
and imported this specific data access DLL instead of the one I compiled myself from the Enterprise Library 3.1 installer, everything worked great.