Could not load file or assembly Microsoft.Expression.Interactions and GalaSoft.MvvmLight.Extras.WPF4 - visual-studio

I am facing unknown problem while using Prism 4. We implement business solution in MVVM pattern. For that I have used
1. Microsoft.Expression.Interactions
2. System.Windows.Interactivity
3. GalaSoft.MvvmLight.Extras.WPF4
for Interaction.Triggers, CallMethodAction and EventToCommand.
<SWI:Interaction.Triggers>
<SWI:EventTrigger SourceObject="{Binding ElementName=txtName}" EventName="GotFocus">
<MEI:CallMethodAction TargetObject="{Binding Path=DataContext,ElementName=txtName}" MethodName="txtName_GotFocus"></MEI:CallMethodAction>
</SWI:EventTrigger>
<SWI:EventTrigger SourceObject="{Binding ElementName=txtName}" EventName="KeyUp">
<GMEWCMD:EventToCommand Command="{Binding Path=DataContext.cmdtxtNameKeyUpEvent,ElementName=txtName}" PassEventArgsToCommand="True">
</GMEWCMD:EventToCommand>
</SWI:EventTrigger>
</SWI:Interaction.Triggers>
Everything is working fine but now we required to make whole system loosely couple we choose prism 4. We already achieved this but above code create following problem as below.
Could not load file or assembly 'Microsoft.Expression.Interactions, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
If I comment above code everything is working fine. I don't know what an issue. Does PRISM 4 not support above assemblies?
Please help us to get rid from this problem.
Thank you

This commonly happens to me when I reference both Microsoft.Expression.Interactions and System.Windows.Interactivity in a view that belongs to a module, but I fail to also add those references to the project that acts as the shell.

I had a similar problem with Prism in Visual Studio 2012. The XAML editor would fail with the same exception.
The solution was to install Microsoft Expression Blend SDK. The assembly should be part of SDK. Allegedly, it is necessary for binding between control events and commands in XAML and some code may require it.

I had the same problem during a Prism 6.1 composite app using .NET 4.5.2, where i was referencing in one of the modules (class library) the Microsoft.Expression.Interactions & System.Windows.Interactivity.
Eventually i had to reference the same dlls in the Desktop project (where bootstrapper and Shell belong)

Related

Resource-related error condition in Windows Forms C++ application

I am working on a legacy Windows Forms application using VS 2008 under C++ and face a weird problem. The form uses an ImageList object, to which two bitmap images have been added. At run-time, I get the following error in Debug mode (in the Release mode, the application just doens't launch):
An unhandled exception of type 'System.Resources.MissingManifestResourceException' occurred in mscorlib.dll
Additional information: Could not find any resources appropriate for the specified culture or the neutral culture.
Make sure "MyApp.Form1.resources" was correctly embedded or linked into assembly "MyApp" at compile time,
or that all the satellite assemblies required are loadable and fully signed.
The crash occurs at the first line of this block:
this->imageList1->ImageStream = (__try_cast<System::Windows::Forms::ImageListStreamer* >(resources->GetObject(S"imageList1.ImageStream")));
this->imageList1->TransparentColor = System::Drawing::Color::Transparent;
this->imageList1->Images->SetKeyName(0, S"Nok32.png");
this->imageList1->Images->SetKeyName(1, S"Ok32.png");
This is pretty puzzling, because I copied the application from an existing one which works fine. I just changed the namespaces. And if I remove the two images from the list, the application works.
I found several posts on forums about this or similar problems, but none could really help me. I don't think that Visual Studio can be blamed. I tried with frameworks 2.0 and 3.0, to no avail. Fully comparing the sources of both applications, I can't see a significant difference.
Any hint ?
Solved: there was an old namespace left in the project file (.vcproj) !

Mono.Android reference in PCL project in VS 2017 Mac

I have created a project in Visual Studio 2017 Windows. Now I am trying to work on it from Mac. While tried to build the project I can see reference to Mono.Android is not available. Also System.ComponentModel is unavailable. How I can add the reference for both of it?
I also facing the same issue mono.android is missing, finally it work by adding mono.android.dll. I did something like this in my project, in Deploy.cs file add this line
class Deploy
{
[Android.Runtime.Register("getExternalStoragePublicDirectory", "(Ljava/lang/String;)Ljava/io/File;", "")]
it show missing mono.android.dll library is missing need to add into the project. Problem solved later I comment this line.
From the picture above you can see that the reference is made to a particular file on your Windows computer which on the Mac is obviously not on that path. If you want to make the project work you should find those files on the Mac and reference them. Copying them from Windows somewhere and referencing them should work too.
But as people noted, the point of PCL project is not to contain references like this so whole the architecture of your app is wrong and that's why you see the problems. So you may want to resolve the root of the problem as this probably won't be the last thing that you encounter by doing the things in the wrong way.

Cannot access DLL inside Shared Project

I have a Xamarin.Forms Shared project.
I need to add a reference to System.Net.Http and after some research I found out it should be done via the regular right click -> select assembly (at every regular project), done that.
But now, if I go to any class on my shared project and try to use that DLL I can't (see image)
What am I doing wrong?
I've added the reference to every other project (iOS, Android and WinPhone) but can't access it on my Shared Project classes.
EDIT
After much try-and-error I figured it out...
I have 3 projects (iOS, Android AND WP8.1).
I was able to add System.Net.Http to iOS and Android projects but when I tried to do that at the WP project I got a message saying all needed DLLs were already in the SDK (how presumptuous!).
Anyway, I decided to unload WP project and it worked =/
So the problem now is: How can I add that DLL to the WP project, since I want to support it, but I NEED System.Net.Http?
Thanks.
You can not add a reference to a project type of SharedProject. Instead you have to add this reference to the project you referenced the SharedProject to.
Consider the following:
You have a solution with a console project and a - lets call it core project - as a SharedProject.
Your console project references core. If you now want to use System.Net.WebClient you have to add the reference to System.Net to the console project.
Well, I figured it out.
The way I solved it was by unloading the WP project and reloading it. Perfect, it worked =)
After reloading the project I checked the .NET for Windows Phone reference and System.Net.Http is indeed there. Maybe this was just a cache thing, I don't know.
All I know is unloading the project and reloading it did the trick.

Reference dll in xamarin

I am using Xamarin and I am new to it. I need to reference a dll which already uses System.Drawing due to which I am getting error. I know we can't use it because it is built aroung GDI+.
So plz let me know what should I do to successfully refer my dll. Even if I remove reference of System.Drawing from my dll then it is getting errors as it is using Bitmap, Image,Size etc. If I have to remove System.Drawing dll then how should I resolve the errors. Is there something else that can be used instead of Bitmap,Image,Size etc.
Plz help me and guide me with simple explanation as I am a beginner
As you found out there is no System.Drawing in Xamarin on mobile. Thus you might reuse sources (I assume you have those) into android(?) library and instead of Drawing types use Android (or iOS) ones. That would require code changes though.
Xamarin Droid already has such classes in framework. You don't need to reference external dll's. All you need to do to start using them is using Android.Graphics; in your class.

How to change VS2010 Add Reference box filter?

I'm getting used to the new IDE (it's vc# express), but the first contact is somewhat confusing. When I open the Add Reference dialog and switch to the .NET tab, a label above the assembly list states: "Filtered to:.NET Framework 4". And it's true - I can reference .NET 4.0 assemblies only plus things like XNA 3.1. However I can't see older assemblies i.e. Managed DirectX libs, which are obviously installed on my computer as there was no trouble with adding a ref to them in vc#08.
What is this? How to change the filter? The label is read-only. These sound like dull guy's questions, but I'm out of luck in finding an answer and there is no intuitive solution.
Thanks in advance.
Change your new application to target the .NET Framework 4 and not .NET Framework 4 Client
"When you create a new application, some projects target the .NET Framework 4 Client Profile by default."
http://msdn.microsoft.com/en-us/library/cc656912.aspx
"If you are targeting the .NET Framework 4 Client Profile, you cannot reference an assembly that is not in the .NET Framework 4 Client Profile. Instead you must target the .NET Framework 4. "
We've created a tool that will help you to achieve your goal. Muse VSReferences will allow you to add a Global Assembly Cache reference to the project from Add GAC Reference menu item.
Regards
s
How to change the filter?
Very simple - you must change the Target .NET Framework for your project, as whole. It's not pain :) just RMB on project name in Solution Explorer->Properties->Application tab->Target Framework(combobox). Select what you want. Change combobox == change filter in Add Reference dialog. ;)
I was having a similar problem until I noticed that the older .NET assemblies were actually in the list, there's just some really strange sorting going on. If you sort by assembly name, you should see them in the proper order.
Another possibility is to go into your project’s Properties page and change the Target Framework from 4.0 to your desired Framework. You will then need to reload you application. Now your Reference should be there. Once you have added the Reference you want, change back to 4.0 and again reload.
Hope this helps.
If, for instance, your project is Framework 4 and you want to reference say Microsoft.Deployment.WindowsInstaller (which is not in the filtered list of the .NET tab), then go to the Browse tab and enter the path to the reference item e.g. C:\Program Files\Windows Installer XML v3.5\SDK\Microsoft.Deployment.WindowsInstaller.dll

Resources