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
Related
when I upload the website on the host below error accrue I don't have any problem in localhost but when I upload it on a host this error accrues:
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Reference.svcmap: Could not load file or assembly 'Microsoft.SqlServer.SqlEnum, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
Source Error:
[No relevant source lines]
Source File: /App_WebReferences/XMLForSMSServiceReference1/ Line: 1
Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.SqlServer.SqlEnum, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' could not be loaded.
what should I do?
Best Regards
Neda
Possible duplicate of : C# SMO and SqlEnum references error
Short answer is the binaries you are deploying on to target server are missing referenced binaries (I am guessing the Sql server SMO library).
When you deploy a project to the destination you have to ensure the destination has the shared components (such as SQL SMO) already installed there, if not you have to include such shared binaries through your msi/deployment.
In your case there are two possible workarounds depending upon how you want to achieve it.
Create the msi and include all binaries (including the once those go in global cache - strongly signed libraries) - this is the more sensible way of handling standard deployment scenarios.
Only deploy your project binaries but ensure the referenced packages are already installed on destination.
What I'm trying to do
I'm trying to create a library (Arduino.dll) to interact with my Bluetooth device from a laptop (Windows 10). This library is intended to be used by a desktop application.
To achieve that, I had to reference both Windows.winmd and System.Runtime.WindowsRuntime.
What's working
I did write the library and tested it on a console application which was on another project in the same solution. To make it work, I had to reference the project and Windows.winmd in the test project. Note that this test project is used to test all of my libraries, so it is heavily manipulated and I tinkered with the settings a lot for years.
What's not working
I finished to write my dll, and wanted to use it in my desktop application. Therefore, I referenced both Arduino.dll and Windows.winmd as in my test project, expecting to work the same way. Sadly, on running the application, I got a "dll not found" when instantiating a class for Arduino.dll :
An unhandled exception of type 'System.IO.FileNotFoundException' occurred in LuxAFX4.exe
Additional information: Could not load file or assembly 'System.Runtime.WindowsRuntime, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.
Strange, but well, I tried to reference the (same) System.Runtime.WindowsRuntime as in Arduino.dll but no luck, I now got an even weirder error :
An unhandled exception of type 'System.BadImageFormatException' occurred in LuxAFX4.exe
Additional information: Could not load file or assembly 'System.Runtime.WindowsRuntime, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (Exception from HRESULT: 0x80131058)
During my search for a solution, I understood that I shouldn't try to load this "reference library" and if it is not found, it must be because it is not installed on the system. But then, why would it work in my test project?
Another thing I may have understand, is that if my library doesn't expose members of referenced 'sub'-libraries, they won't be needed when referencing my library. Should I try to 'hide' all references? If so, is there a way to catch all exposed members? Source : How to to avoid referencing a dll's referenced dll
Side note : I use C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5.1\System.Runtime.WindowsRuntime.dll and C:\Program Files (x86)\Windows Kits\10\UnionMetadata\Windows.winmd.
May be related : Could not load file or assembly Windows.winmd and How to reference Windows.winmd from a .NET Core library?
After some more research, and with the hint given by Hans Passant, I finally understood that I had chosen the wrong System.Runtime.WindowsRuntime.dll to start with. Changing it to use C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Runtime.WindowsRuntime.dll instead in both the project with the DLL and the project using it, resolved my problem.
I got the new file location here : C# “await” error when using WinRT from Desktop app
I'm trying to read data from a json file in WP8 and after installing nuget displays the following error:
error :
Cannot resolve reference assemblies. Please check the reference assemblies. Cannot resolve dependency to assembly 'System.Runtime.InteropServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.
Could anyone tell me a solution for this?
Add System.Runtime.InteropServices to your project references;
it's in the global assembly cache; the Add References dialog shows it under the ".NET" tab.
If this doesnt solve the problem following the directions here should allow you to remove the recursion that happens.
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.
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.