Nightmare with rabbitmq.client versions - easynetq

I have a problem with the rabbitmq.client version when using easynetq but I do not know what EXACTLY is causing it! My solution contains a project for a WindowsService (exe file) and several library projects, all built against .NET 4.6.2.
In my exe.conf (of the service executable) file I see the following entry:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="RabbitMQ.Client" publicKeyToken="89e7d7c5feba84ce" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
This causes a crash with the following exception:
2017-10-20 09:58:49,185; [9]; INFO ; MqService1Log; [AppHost.Configure]; - Registering RabbitMQ server using the EasyNetQ library....
2017-10-20 09:58:49,260; [9]; ERROR; MqService1Log; [Program.Main]; - System.IO.FileLoadException: Die Datei oder Assembly "RabbitMQ.Client, Version=5.0.0.0, Culture=neutral, PublicKeyToken=89e7d7c5feba84ce" oder eine Abhängigkeit davon wurde nicht gefunden. Die gefundene Manifestdefinition der Assembly stimmt nicht mit dem Assemblyverweis überein. (Ausnahme von HRESULT: 0x80131040)
Dateiname: "RabbitMQ.Client, Version=5.0.0.0, Culture=neutral, PublicKeyToken=89e7d7c5feba84ce" ---> System.IO.FileLoadException: Die Datei oder Assembly "RabbitMQ.Client, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89e7d7c5feba84ce" oder eine Abhängigkeit davon wurde nicht gefunden. Die gefundene Manifestdefinition der Assembly stimmt nicht mit dem Assemblyverweis überein. (Ausnahme von HRESULT: 0x80131040)
Dateiname: "RabbitMQ.Client, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89e7d7c5feba84ce"
=== Zustandsinformationen vor Bindung ===
LOG: DisplayName = RabbitMQ.Client, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89e7d7c5feba84ce
(Fully-specified)
LOG: Appbase = file:///D:/Projects/BizBusMQSamples/MqService1/MqService1/MqService1/bin/Debug/
LOG: Ursprünglicher PrivatePath = NULL
Aufruf von Assembly : EasyNetQ, Version=2.0.4.0, Culture=neutral, PublicKeyToken=null.
===
LOG: Diese Bindung startet im default-Load-Kontext.
LOG: Die Anwendungskonfigurationsdatei wird verwendet: D:\Projects\BizBusMQSamples\MqService1\MqService1\MqService1\bin\Debug\MqService1.vshost.exe.Config
LOG: Die Hostkonfigurationsdatei wird verwendet:
LOG: Die Computerkonfigurationsdatei von C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config wird verwendet.
LOG: In der Anwendungskonfigurationsdatei wurde eine Umleitung gefunden. 4.0.0.0 wird nach 5.0.0.0 umgeleitet.
LOG: Verweis nach der Richtlinie: RabbitMQ.Client, Version=5.0.0.0, Culture=neutral, PublicKeyToken=89e7d7c5feba84ce
LOG: Die gleiche Bindung ist bereits aufgetreten und hat den Fehler hr = 0x80131040 verursacht.
bei System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
bei System.Reflection.RuntimeMethodInfo.FetchNonReturnParameters()
bei System.Reflection.RuntimeMethodInfo.GetParameters()
bei System.Diagnostics.StackTrace.ToString(TraceFormat traceFormat)
bei System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
bei System.Exception.GetStackTrace(Boolean needFileInfo)
bei System.Exception.ToString(Boolean needFileLineInfo, Boolean needMessage)
bei System.Exception.ToString(Boolean needFileLineInfo, Boolean needMessage)
bei System.Exception.ToString()
bei System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
bei System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
bei System.String.Format(String format, Object arg0, Object arg1)
bei MqService1.AppHost.Configure(Container container) in D:\Projects\BizBusMQSamples\MqService1\MqService1\MqService1\AppHost.cs:Zeile 51.
bei ServiceStack.ServiceStackHost.Init()
bei MqService1.Program.Main(String[] args) in D:\Projects\BizBusMQSamples\MqService1\MqService1\MqService1\Program.cs:Zeile 30.
Something seems to require RabbitMQ.Client 5 while something else wants Version 4. Since EasyNetQ seems not to support 5.0.1 (I get an unknown method error in the connection factory when connecting), I did NOT upgrade to 5.0.1 and stay with RabbitMQ.Client 4.1.3.
If I change bindingRedirect to oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" (change version from 5 to 4) in the .conf file everything works fine. The problem is, that every time I build the project this is changed back to 5 again!
Maybe I have to add the following information: The solution contains a library project that contains some management functions. This project includes EasyNetQ.Management.Client but according to the NuGet information it has NO dependencies. However when I remove this library project from my solution, the config file is not changed.....
Any idea what is going on here and how I can solve it? Any help is greatly appreciated.
EDIT
If I remove the library project from the solution, it still changes my config file to version 5. It must be caused by something else.

Update #ThommyB : I just released EasyNetQ 2.2.0, care to try?
I have not seen this behavior before, I suspect there's still references or packages to RMQ 5.
Would you mind updating to this version? https://www.nuget.org/packages/EasyNetQ/2.3.0-alpha0002
That will get you the RabbitMQ 5 client. Not many other things have changed so I don't consider it a big risk.

Related

Renaming package causes crash; java.lang.UnsatisfiedLinkError: No implementation found for void

i tried to rename my package and the app crashes at the startup. This is the error measage, can someone plase help and tell me how can I fix it?
FATAL EXCEPTION: SDLThread
Process: com.MYAPP.demo, PID: 3967
java.lang.UnsatisfiedLinkError: No implementation found for void com.MYAPP.demo.MainActivity.initEnv() (tried Java_com_MYAPP_demo_MainActivity_initEnv and Java_com_MYAPP_demo_MainActivity_initEnv__)
at com.MYAPP.demo.MainActivity.initEnv(Native Method)
at com.MYAPP.demo.MainActivity._initEnv(MainActivity.java:71)
at org.libsdl.app.SDLMain.run(SDLActivity.java:1679)
at java.lang.Thread.run(Thread.java:919)

Windows Forms "Deploy Task" failing with "The process cannot access the file because it is being used by another process." in .NET5

I've just migrated my .NET 4.8 Windows Forms application to .NET 5. The process was incredibly easy. The only problem I'm having is with Deploy. I've been using Click Once deploy with my application for years but after changing it to .NET5 and recreating the deploy, I'm getting this error. I also get the same error if I use the simpler Folder (non Click Once) deploy option. I'm deploying to a server share folder (\\HYDRA\Data\SL\IceTool) which is writable (the deploy task does actually copy the application executable into the share folder - but nothing else).
The error appears in a dialogue box containing the following text:
Publish has encountered an error.
Publish has encountered an error. We were unable to determine the cause of the error. Check the output log for more details.
A diagnostic log has been written to the following location:
"C:\Users\Chris\AppData\Local\Temp\tmpF29C.tmp"
The tmpF29C.tmp file contains:
17/12/2020 01:05:34
System.AggregateException: One or more errors occurred. ---> Microsoft.WebTools.Shared.Exceptions.WebToolsException: Publish has encountered an error. We were unable to determine the cause of the error. Check the output log for more details.
--- End of inner exception stack trace ---
---> (Inner Exception #0) Microsoft.WebTools.Shared.Exceptions.WebToolsException: Publish has encountered an error. We were unable to determine the cause of the error. Check the output log for more details. <---
Microsoft.WebTools.Shared.Exceptions.WebToolsException: Publish has encountered an error. We were unable to determine the cause of the error. Check the output log for more details.
===================
Checking the output build log shows that the solitary Ice.exe file is "being used by another process":
2>Native image obj\Release\net5.0-windows\win-x64\R2R\Ice.dll generated successfully.
2>Skipping target "_CreateR2RSymbols" because it has no outputs.
2>Though the target has declared its outputs, the output specification only references empty properties and/or empty item lists.
2>Task "NETSdkError" skipped, due to false condition; ('#(_ReadyToRunCompilationFailures)' != '') was evaluated as ('' != '').
2>Task "NETSdkInformation" skipped, due to false condition; ('$(_ReadyToRunCompilerHasWarnings)' != '') was evaluated as ('' != '').
2>Target "GeneratePublishDependencyFile" skipped, due to false condition; ('$(GenerateDependencyFile)' == 'true' and '$(_UseBuildDependencyFile)' != 'true') was evaluated as ('true' == 'true' and 'true' != 'true').
2>Target "ComputeDependencyFileCompilerOptions" skipped, due to false condition; ('$(PreserveCompilationContext)' == 'true') was evaluated as ('' == 'true').
2>Building target "GenerateSingleFileBundle" completely.
2>Input file "C:\Workspaces\Framework\Main\Source\Core\Ice\obj\Release\net5.0-windows\win-x64\apphost.exe" is newer than output file "\\HYDRA\Data\SL\IceTool\Ice.exe".
2>Task "NETSdkError" skipped, due to false condition; ('$(IncludeAllContentForSelfExtract)' == 'true' And '$(IncludeNativeLibrariesForSelfExtract)' != 'true') was evaluated as ('false' == 'true' And 'false' != 'true').
2>Using "GenerateBundle" task from assembly "C:\Program Files\dotnet\sdk\5.0.101\Sdks\Microsoft.NET.Sdk\targets\..\tools\net472/Microsoft.NET.Build.Tasks.dll".
2>The "GenerateBundle" task failed unexpectedly.
2>System.IO.IOException: The process cannot access the file '\\HYDRA\Data\SL\IceTool\Ice.exe' because it is being used by another process.
2> at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
2> at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
2> at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
2> at System.IO.File.OpenWrite(String path)
2> at Microsoft.NET.HostModel.Bundle.Bundler.GenerateBundle(IReadOnlyList`1 fileSpecs)
2> at Microsoft.NET.Build.Tasks.GenerateBundle.ExecuteCore()
2> at Microsoft.NET.Build.Tasks.TaskBase.Execute()
2> at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
2> at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
2>Target "_SGenCheckForOutputs" skipped, due to false condition; ('$(_SGenGenerateSerializationAssembliesConfig)' == 'On' or ('#(WebReferenceUrl)'!='' and '$(_SGenGenerateSerializationAssembliesConfig)' == 'Auto')) was evaluated as ('Auto' == 'On' or (''!='' and 'Auto' == 'Auto')).
2>Comparison path is "C:\Workspaces\Framework\Main\Source\Core\Ice".
2>Comparison path is "bin\Release\net5.0-windows\win-x64\".
2>Comparison path is "obj\Release\net5.0-windows\win-x64\".
========== Build: 1 succeeded, 0 failed, 4 up-to-date, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========
The deploy target folder (initially empty) contains just the single Ice.exe file. The same file that is "in use".
Here is my ClickOnceProfile.pub.xml file:
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>3.0.0.*</ApplicationVersion>
<BootstrapperEnabled>True</BootstrapperEnabled>
<Configuration>Release</Configuration>
<GenerateManifests>True</GenerateManifests>
<Install>true</Install>
<InstallFrom>Unc</InstallFrom>
<InstallUrl>\\HYDRA\Data\SL\IceTool\</InstallUrl>
<IsRevisionIncremented>True</IsRevisionIncremented>
<IsWebBootstrapper>False</IsWebBootstrapper>
<ManifestCertificateThumbprint>(removed!)</ManifestCertificateThumbprint>
<MapFileExtensions>true</MapFileExtensions>
<OpenBrowserOnPublish>false</OpenBrowserOnPublish>
<Platform>Any CPU</Platform>
<ProductName>IceTool</ProductName>
<PublishDir>\\HYDRA\Data\SL\IceTool\</PublishDir>
<PublishUrl>\\HYDRA\Data\SL\IceTool\</PublishUrl>
<PublishProtocol>ClickOnce</PublishProtocol>
<PublishReadyToRun>True</PublishReadyToRun>
<PublishSingleFile>True</PublishSingleFile>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>False</SelfContained>
<SignatureAlgorithm>sha256RSA</SignatureAlgorithm>
<SignManifests>True</SignManifests>
<TargetCulture>en-GB</TargetCulture>
<TargetFramework>net5.0-windows</TargetFramework>
<UpdateEnabled>True</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
</PropertyGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.NetCore.DesktopRuntime.5.0.x64">
<Install>true</Install>
<ProductName>.NET Desktop Runtime 5.0.1 (x64)</ProductName>
</BootstrapperPackage>
</ItemGroup>
</Project>
Could this be a bug in a relatively new framework release? (Parallel task condition?) or any I doing something wrong. Thanks.

SQL Server 2016: Error when selecting from sys.messages

Since roughly one week, after a reboot of my server hardware, I have a strange error when trying to execute the following command:
USE master;
SELECT * FROM sys.messages;
The error, in german, says the following:
Fehler beim Laden der Formatzeichenfolge für Fehler "997", Sprachen-ID "1033". Betriebssystemfehler: 317(Das System hat keinen Meldungstext für die Meldungsnummer 0x997 in der Meldungsdatei 1033 gefunden.). Überprüfen Sie, ob die Ressourcendatei mit der ausführbaren Datei von SQL Server übereinstimmt und ob die Ressourcendatei im lokalisierten Verzeichnis mit der Datei im englischen Verzeichnis übereinstimmt. Überprüfen Sie auch die Speicherauslastung.
Roughly translated:
Error loading the format string for error 997 with the language ID 1033, operating system error 317 (The system could not find a message string for error number 0x997 in message file 1033). Check if the resource file matches with the executable file of SQL server and if the resource file in the localized folder matches the one in the english directory. Check the memory usage.
The memory usage can't be the issue here, there is plenty of both RAM and disk space available.
I checked the resource files in the 1033 folder (this one: C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Binn\Resources\1033 ), there were no change dates newer than 2016 (and the server has had many reboots since then).
I also replaced those resource files with ones from a fresh installation of the same patch level, where I can do the query without issues but it didn't help us out.
I tried restoring the master database, which also didn't yield any positive result (I restored it to a backup one day before that reboot).
Does anybody have any other ideas about what could be done? I tried searching for articles and issues about this same problem but the only posts I found were many years old and the linked solutions no longer exist.

datomic "index creation failed" "merge-db failed"

After adding a new index in datomic I got this Error.
The very same problem occured on one of my systems some Years ago and is still not fixed:
2018-11-27 10:23:37.580 WARN default datomic.update - {:message "Index creation failed", :db-id "xxx-8eb416be-ec26-4bff-b4ce-503bb734026b", :pid 29822, :tid 15}
java.io.IOException: Datei oder Verzeichnis nicht gefunden
at java.io.UnixFileSystem.createFileExclusively(Native Method) ~[na:1.8.0_191]
at java.io.File.createTempFile(File.java:2024) ~[na:1.8.0_191]
at datomic.external_sort$temp_file_io$reify__5949.make_temp_file(external_sort.clj:22) ~[datomic-transactor-pro-0.9.5656.jar:na]
at datomic.external_sort$file_system_sorter$fn__6044.invoke(external_sort.clj:113) ~[datomic-transactor-pro-0.9.5656.jar:na]
at clojure.core$map$fn__5587.invoke(core.clj:2747) ~[clojure-1.9.0-RC1.jar:na]
at clojure.lang.LazySeq.sval(LazySeq.java:40) ~[clojure-1.9.0-RC1.jar:na]
at clojure.lang.LazySeq.seq(LazySeq.java:49) ~[clojure-1.9.0-RC1.jar:na]
at clojure.lang.RT.seq(RT.java:528) ~[clojure-1.9.0-RC1.jar:na]
2018-11-27 10:23:37.602 WARN default datomic.index - {:message "merge-db failed", :pid 29822, :tid 15}
java.io.IOException: Datei oder Verzeichnis nicht gefunden
at java.io.UnixFileSystem.createFileExclusively(Native Method) ~[na:1.8.0_191]
at java.io.File.createTempFile(File.java:2024) ~[na:1.8.0_191]
at datomic.external_sort$temp_file_io$reify__5949.make_temp_file(external_sort.clj:22) ~[datomic-transactor-pro-0.9.5656.jar:na]
at datomic.external_sort$file_system_sorter$fn__6044.invoke(external_sort.clj:113) ~[datomic-transactor-pro-0.9.5656.jar:na]
Seems like datomic not being able to write down some cache for the indexing process.
It crashes always shortly after restart trying to do the indexing job.
Last time this occurred on one of my systems I contacted support #marshall from datomic. With his help I dumped the datebase, grabbed the backup, reduced the amount of data, assigned a lot of ram ... and it worked. This time that's is not possible.
found the SOLUTION
the transactor indexer ignores the path settings in the config file ("datomic.version" "0.9.5656" and before tested) and tries to save on actual relative file path.
I made the datomic-pro folder accessible and voilà it creates a ..../data directory and indexing works
in detail:
in my debian setup i have set the database path to data-dir=/var/lib/datomic
all the db and tmp files are correctly stored in /var/lib/datomic
the datomic pro installation is in /usr/local/share/datomic/datomic-pro-0.9.5656/
My relative path starting the transactor (via start-stop-daemon) is also /usr/local/share/datomic/datomic-pro-0.9.5656/.
indexing works in my case after:
chown datomic:datomic /usr/local/share/datomic/datomic-pro-0.9.5656/
or better
mkdir /usr/local/share/datomic/datomic-pro-0.9.5656/data
chown datomic:datomic /usr/local/share/datomic/latest/data
you can watch datomic creating a /usr/local/share/datomic/latest/data/indexer folder
Hope that helps!

probing privatePath and resource dictionary

I have two problems with apparently different symptoms, which I think may be the same problem. Both problems occur on one machine, but not on others.
In one case a .NET library is loaded in an old C++/MFC application. This library opens a WPF window, which generates the following error:
Set property 'System.Windows.ResourceDictionary.Source' threw an exception.
Cannot locate resource 'resourcedictionaries/images/bitmaps_32_32.xaml'.
The second error occurs on starting a WPF application. The program crashes on loading and writes the following error into the windows event log:
Anwendung: Cs3SystemManager.exe
Frameworkversion: v4.0.30319
Beschreibung: Der Prozess wurde aufgrund einer unbehandelten Ausnahme beendet.
Ausnahmeinformationen: System.IO.IOException
bei MS.Internal.AppModel.ResourcePart.GetStreamCore(System.IO.FileMode, System.IO.FileAccess)
bei System.IO.Packaging.PackagePart.GetStream(System.IO.FileMode, System.IO.FileAccess)
bei System.IO.Packaging.PackWebResponse+CachedResponse.GetResponseStream()
bei System.IO.Packaging.PackWebResponse.GetResponseStream()
bei System.IO.Packaging.PackWebResponse.get_ContentType()
bei MS.Internal.WpfWebRequestHelper.GetContentType(System.Net.WebResponse)
bei MS.Internal.WpfWebRequestHelper.GetResponseStream(System.Net.WebRequest, MS.Internal.ContentType ByRef)
bei System.Windows.ResourceDictionary.set_Source(System.Uri)
bei System.Windows.Baml2006.WpfSharedBamlSchemaContext+<>c.<Create_BamlProperty_ResourceDictionary_Source>b__342_0(System.Object, System.Object)
bei System.Windows.Baml2006.WpfKnownMemberInvoker.SetValue(System.Object, System.Object)
bei MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(System.Xaml.XamlMember, System.Object, System.Object)
bei MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(System.Object, System.Xaml.XamlMember, System.Object)
Ausnahmeinformationen: System.Windows.Markup.XamlParseException
bei System.Windows.Markup.WpfXamlLoader.Load(System.Xaml.XamlReader, System.Xaml.IXamlObjectWriterFactory, Boolean, System.Object, System.Xaml.XamlObjectWriterSettings, System.Uri)
bei System.Windows.Markup.WpfXamlLoader.LoadBaml(System.Xaml.XamlReader, Boolean, System.Object, System.Xaml.Permissions.XamlAccessLevel, System.Uri)
bei System.Windows.Markup.XamlReader.LoadBaml(System.IO.Stream, System.Windows.Markup.ParserContext, System.Object, Boolean)
bei System.Windows.Application.LoadComponent(System.Object, System.Uri)
bei Cs3SystemManager.App.InitializeComponent()
bei Cs3SystemManager.App.Main()
This application refers to the same resource dictionary which is referenced in the first error message. My strong suspicion is that it is the same basic error.
The resource dictionary is referenced with the syntax:
<ResourceDictionary Source="/McWpfResources;component/ResourceDictionaries/Images/Bitmaps_32_32.xaml" />
I have also tried the following syntax, but it did not make any difference.
<ResourceDictionary Source="pack://application:,,,/McWpfResources;component/ResourceDictionaries/Images/Bitmaps_32_32.xaml" />
Our installation stores executable files (.exe) into a directory called bin, and the DLL's into a subdirectory called bin\interop (some of them are interop wrappers for COM components).
For each .exe file, there is a matching .exe.Config file which speficies the privatePath, for example:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="interop"/>
</assemblyBinding>
</runtime>
</configuration>
If I copy the exe files down into the interop directory, neither of the problems occurs.
Clearly, the privatePath parameter is not working in this specific case (at least not working as I expect), but it does seem to work on other machines and in other applications.
Obviously, I can fix the error by putting everything in one directory, but apart from that, how can I fix the error?
Forget it. This was my error.
From a previous installation, the bin directory contained an old version of a DLL which is now installed into the interop subdirectory. This old DLL was being loaded in preference to the DLL in the subdirectory.
I might delete this question (or I might leave it as a cautionary tale).

Resources