Maybe someone have same problem
When I try to set data context type of view to desired View Model. The error appears:
Could not load the assembly System.Reactive.Windows.Threading because
the following errors occurred: Method 'Schedule in type
'System.Reactive.Concurrency.DispatcherScheduler' from assembly
*System.Reactive.Windows.Threading, Version=1.0.10621.0, Culture=
neutral, RublicKeyToken=31b13856ad364e35' does not have an
implementation.
Any thoughts? I have looked at disassembled code, and the method has implementation.
Try adding a file reference to System.Reactive.Windows.Threading.dll to your project.
I've had a similar error and that fixed it.
Related
I have the following defined in my XAML file:
xmlns:databaseDesign="clr-namespace:My_Namespace;assembly=My Assembly Name
Intellisense picks it up without any issue and I can use autocomplete to grab classes and whatnot from that assembly in my XAML. However, when I go to build, I get the following error:
Error MC1000: Unknown build error,
''clr-namespace:My_Namespace;assembly=My Assembly Name' mapping URI is
not valid. Line 14 Position 14.' (14, 14)
The only thing I can think of that is different from my previous similar projects is that I am referencing an assembly from a private nuget repo rather than directly from the solution.
Using .NET Core 3.1 for both this project and the referenced library.
Any thoughts on what might be going wrong?
Turns out, assembly names with spaces aren't handled, with no indicator that this is the issue. Really, Microsoft?
I'm getting this following error when try to load a workflow from its definition:
Compilation failures occurred:
Line 0: Unable to load assembly 'PI.Shared.WF.Activities.Tests'. Line 581: The type 'System.Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
Complete results are contained in the Data property of this exception. Please correct the errors in the source and retry the Load.
My code simple loads it from a byte[] memory stream that is the content of the XAML file.
What should it do? This 'PI.Shared.WF.Activities.Tests' project is just a class library that I use to draw the workflows. After that, the file itself is serialized into a byte[] and save on azure storage. When we need to load it, just get the byte[] and pass to:
activity = ActivityXamlServices.Load(new MemoryStream(workflowDefinition.Definition), settings);
Where definition is the byte[] with the file data.
What should I possibly being missing? The 'PI.Shared.WF.Activities.Tests' is not even used anyway inside the Workflow host application.
Thanks
Found the problem. It is the PCL libraries that is using fake/facade assemblies that redirects to mscorlib after 4.5 framework and workflow compiler doesn't know(yet) about this.
Have a look on this issue on MS Connect, and there is a workaround there:
http://connect.microsoft.com/VisualStudio/feedback/details/800070/pcl-reference-in-a-workflow-project-destroys-intellisense
I renamed my WPF application's assembly from DBce_TEST2 to AMS, then attempted to build it to see what would happen. I ran it, and it wouldn't build for obvious reasons but now after renaming it back to DBce_TEST2 I get the following error:
Managed Debugging Assistant 'BindingFailure' has detected a problem in 'G:\C# Projects\Asset Management System\DBce_TEST2\bin\Debug\DBce_TEST2.vshost.exe'.
Additional Information: The assembly with display name 'AMS' failed to load in the 'Load' binding context of the AppDomain with ID 1. The cause of the failure was: System.IO.FileNotFoundException: Could not load file or assembly 'AMS' or one of its dependencies. The system cannot find the file specified.
The error can be fishy. Use Fusion log viewer to understand what has gone wrong.
How to enable assembly bind failure logging (Fusion) in .NET
Figured it out. Renamed the assembly again to some random text, attempted to run it, then renamed back to original assembly name and the error disappeared. Guess some generated files were messed up by visual studio a little bit, and this fixed it.
I am using a "custom" object builder (Autofac) so I can re-use the registration of many types that I have done in a common assembly. When I run the service, hosted within NServiceBus.Host.exe, I get the following error:
SerializationException was unhandled:
Type 'Autofac.Core.Registration.ComponentNotRegisteredException' in assembly 'Autofac, Version=3.0.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da' is not marked as serializable.
This seems odd to me because NServiceBus uses Autofac by default and doesn't have this same issue.
I am using Autofac v 3.1.1 and NServiceBus 4.0.3
It's true that the ComponentNotRegisteredException is not marked serializable - Portable Class Libraries don't support the SerializableAttribute and Autofac 3.0+ is a PCL.
I'm guessing the larger issue you're running into isn't the SerializationException so much as the problem causing it - that something in your custom code isn't registered, so when some type is getting resolved it can't be built and, thus, Autofac throws that ComponentNotRegisteredException and NServiceBus is trying to serialize it.
Instead of trying to solve the serialization problem, I'd start looking at the source of the ComponentNotRegisteredException and focus on that.
The simplest way to diagnose these kind of issues is to turn on break on all exception in Visual Studio and see where it booms out first time.
9/10 is a problem with the initialization code.
I ran into a similar error while adding NServiceBus.Distributor.Msmq (4.4.2) to an old solution using NServiceBus 4.4.2. Turned out I'd forgotten to set up the NSB license for the new project. Trying to start the distributor threw this until I included a valid License.xml file in the build output:
Unhandled Exception: System.Runtime.Serialization.SerializationException: Type 'Autofac.Core.DependencyResolutionException' in assembly 'NServiceBus.Core, Version=4.4.0.0, Culture=neutral
PublicKeyToken=9fc386479f8a226c' is not marked as serializable.
I am getting the following error in Quartz.net
The assembly with display name 'Quartz.XmlSerializers' failed to load
in the 'LoadFrom' binding context of the AppDomain with ID 1. The
cause of the failure was: System.IO.FileNotFoundException: Could not
load file or assembly 'Quartz.XmlSerializers, Version=2.0.1.100,
Culture=neutral, PublicKeyToken=null' or one of its dependencies. The
system cannot find the file specified.
It's very odd since Quartz.XmlSerializers does not exist anywhere in any code I'm using. It's not in the Quartz source code, my code, and none of my dependencies best I can tell. It only occurs when I debug my project, but not when I download the Quartz 2.0.1 source code and run the server from there.
I am using topshelf as the service install library.
It occurs during deserialization on line 226 of XMLSchedulingDataProcessor.cs of the Quartz source.
// deserialize as object model
System.Xml.Serialization.XmlSerializer xs = new System.Xml.Serialization.XmlSerializer(typeof(QuartzXmlConfiguration20));
Any clue to solving this would be helpful as I'm stumped by this error.
In applications that use XmlSerialization, you can get a first-chance exception in outside code when the application looks for a cached serialization assembly. You can find more information in this question.