Regarding MS Enterprise Lib version issue - enterprise-library

Our project is using a common class library project which reference enterprise library 3.0 for logging. We want to upgrade the EL to 5.0. For this, we installed Enterprise Library 5.0, added new logging block in the web.config file using the config tool.
We removed the previous references to 3.0 dlls in the project. After that we added the following dlls from location - C:\Program Files\Microsoft Enterprise Library 5.0\Bin
1.Microsoft.Practices.EnterpriseLibrary.Logging.dll
2.Microsoft.Practices.EnterpriseLibrary.Common.dll
We also registered the latest dlls (5.0) in GAC and uninstalled previous versions there.
However, we are getting the following error while running the app:
"Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Common, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. "
Please help :)

It appears that you have still references to version 3.1.0.0 of the Enterprise Library assemblies in the config.
Try the following:
Use a text editor to completely remove the Version, Culture, and PublicKeyToken attributes from every Enterprise Library element that contains these attributes.
Open your configuration file in the Enterprise Library version 5.0 configuration editor and then save it. This will add the correct version, culture, and public key token values to each element.
Also, check out the Migration Guide.

Related

Autofac System.Diagnostics exception

I am using Autofac 6.0 in a .Net Framework 4.8 based solution which has multiple projects in it.
During the startup Autoface is throwing exception "System.IO.FileLoadException: Could not load file or assembly 'System.Diagnostics.DiagnosticSource, Version=4.0.5.0"
Throughout the solution, where ever there is reference of this DLL, it is of version 5.0. I have double checked binding redirection in App.config as well.
Once the solution is build, all the binaries are copied into a single folder. Inside this folder the version of System.Diagnostics.DiagnosticSource is 5.0
Not sure why Autofac is not getting this DLL with version 5.0 and looking for a version 4.x dll?
Is Autofac trying to look for this System.Diagnostics.DiagnosticsSource DLL from some other path and not the current folder from where the exe is running?

Visual Studio 2022 can't find nuget package

What am I doing wrong here?
I have a DLL in .net Standard 2.0, and a console application, also in .net standard 2.0. The DLL is going to eventually be a custom nuget package for internal use by my dev team.
I installed System.Text.Json version 6.0.0 and I get the following runtime error:
"Could not load file or assembly 'System.Text.Json, Version=6.0.0.0".
I can see the nuget package in the location that Visual Studio 2022 is looking in.
Any thoughts on how I debug this?
I tried to explicitly install each of the dependencies, but that did not work.
***EDIT: I just realized that I no longer get that FileNotFound Exception if I explicitly copy that package's DLL into the console app's execution directory, but then I get a new FileNotFound exception for one of its dependencies. When I explicitly copy that DLL, I get another FileNotFound exception for the next dependency, and so on. I just assumed that the dependent nuget packages would get encapsulated in the dll that's using them. Copying each of the dependent DLL's is not really an acceptable solution.
After some investigation, I thought my issue might be related to:
Dependent DLLs of a NuGet package not copied to output folder
or related to:
MSBuild doesn't copy references (DLL files) if using project dependencies in solution
but that was not the case.
The output of my console app project was a DLL, even though it was clearly set to "Console Application". I just assumed that this was a new runtime method for VS2022, but that's not it. My console application Target was set to ".Net Standard 2.0", which is intended for DLL's. Once I set the Target to ".Net 6.0", everything worked as expected, and all the DLL's and packages were copied over correctly.
My DLL, which is being turned into a Nuget package, was properly set to ".net Standard 2.0".

BizTalk Server Application Project fails to compile with .NET 4.7.2

In my newly created BizTalk 2020 Dev environment when I'm adding a BizTalk Server Application Project (.btaproj) to the solution, the dialog window where you set the name of the project is showing the .NET framework selector and it defaults to version 4.7.2 as expected.
However when the project is added to the solution I can see in the properties for the project that it is targeting .NET 4.6.1. Has anyone seen this? is it a bug or something wrong with installation?
Naturally I change it to version 4.7.2 as the regular BizTalk project and everything compiles fine in Visual Studio.
But on our build server the same project fails. We use Azure Devops for CICD.On the build server we have the same version of VS installed (2019 enterprise) and BizTalk Server Extention (v3.12.1.0) is installed as well as msbuild tools from BizTalk server installation.
In the logs I first get a Warning:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2106,5): warning MSB3274: The primary reference "A.dll" could not be resolved because it was built against the ".NETFramework,Version=v4.7.2" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.6.1". [B.btaproj]*
And further down in the log the btaproj will not find the assemblies to include in the .zip package.
Message above implies that I have different target versions but I don't.
Now the strange thing is that I can log on to the build server and clone the same project and compile it with VS just fine.
The only way to make the build server compile the project successfully (or any other BizTalk project with .btaproj for that matter) is to change .NET to 4.6.1 (for both .btproj and .btaproj) and it all compiles nicely and deploys to BizTalk environment.
I have checked project files and files checked in to Git and everything seems OK with the sources files. The clean flag I set to clean sources and output directory. I Can compile a regular BizTalk project and .NET application with 4.7.2 on build server just fine it's only when I involve a .btaproj project where it starts to misbehave.
Can anyone point out where to start to look? the .btaproj seems fishy to begin with but it can also be isolated to the msbuild on build server and it differs from compiling with Visual Studio.
Since the BizTalk Server Application project e.g .btaproj defaults to target framework moniker 4.6.1 when added to the solution you will need to manually change the version manually for BOTH debug and release.
Do not get misled by the create project dialog where it defaults to version 4.7.2
As a workaround ,you can specify /p:TargetFrameworkVersion=v4.7.2 in the MSBuild Arguments column of the MSBuild task.
MSBuild lets you set properties on the command line by using the -property (or -p) switch. These global property values override property values that are set in the project file. This includes environment properties, but does not include reserved properties, which cannot be changed.
For details ,please refer to this document.

Crystal Report Version=11.5.3700.0

Error is:
Could not load file or assembly 'CrystalDecisions.CrystalReports.Design, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified.
My web.config is:
This is a existing project. i already tried to sort out the problem using
http://www.businessobjects.com/jump/xi/crvs2010/us2_default.asp link. but i ineed Version=11.5.3700.0 assembly.
Please give me any solution.
You are compiling against a different version to the one that you are getting from that installation (that one is probably newer). This usually means that you have a version of the dlls in the GAC which is causing compilation to be against those dlls. You probably need to remove the dlls from the GAC and then install the version that you can redistribute on all of the development machines.
On the useful page SAP WIKI it's not clearly visible,
but CR 11.5 R2 SP6 has two assembly versions,
11.5.3300 for .NET 1.1 and 11.5.3700 for .NET 2.0.

ASP.NET MVC2 with Mono 2.6.7 and MonoDevelop 2.6

When I edit my web project references, I can't find the System.Web.MVC2 assembly in the GAC.
That's not what I expected since the Synaptic Package Manager reports that libmono-system-web-mvc2.0-cil package is installed properly.
Assemblies in MonoDevelop's Edit References list are not taken from the GAC. This is also true of VS and .NET. The GAC is only meant to be used at runtime, not compile time.
When targeting Mono, MonoDevelop uses a system called "pkgconfig" for discovering assemblies. When targeting .NET, it uses the same "Assembly Folders" keys in the registry that VS does.
Note that in MD Preferences you can also add additional folders to be searched for pkgconfig files or assemblies - this is intended as an easier alternative to properly installing them onto the system.
Since you use Ubuntu, which breaks Mono into many tiny packages, it's possible that Mono's pkgconfig file for the assembly has been split off into a separate -dev package, so you might try looking for that (though I'm not sure whether 2.6.7 included the pkgconfig file - maybe you'd need 2.8).
Also, MonoDevelop 2.6 does not yet exist - you probably mean 2.4.
Try installing it to the GAC manually.
Not all assemblies need to be in the GAC. There may be a reason the ASP.NET MVC assembly is not installed in the GAC (ease of deployment?)
You are probably missing the libmono-cil-dev package.