Mistaken prism assembly reference in visual studio - prism

I am using prism and I get an exception that: The type 'Microsoft.Practices.Prism.Bootstrapper' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Practices.Prism.Composition, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null'
the problem is that I already have an assembly reference to Microsoft.Practices.Prism.Composition in my project
any help? thanks

It seems Microsoft.Practices.Prism.UnityExtensions need a reference to Microsoft.Practices.Prism.Composition assembly.
Just download Prism 5.0 for WPF, compile the source code of ModularityWithUnity.Desktop.sln at \Source\Quickstarts\Modularity\Desktop\ModularityWithUnity and copy all Prism assemblies from bin\Debug directory and paste it in your app's location.
This fixed my same problem.

Related

Xamarin Prism.Unity.Forms 7.0.0.396 give error on update from version 6.3

Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'Microsoft.Practices.Unity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=6d32ff45e0ccc69f'. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'Microsoft.Practices.Unity.dll'
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference reference, Mono.Cecil.ReaderParameters parameters)
Can you please suggest for solutions
Your error message tells you everything you need to know: Microsoft.Practices.Unity, Version=4.0.0.0. You have a reference to v4.0 of Unity. Prism 7 references v5.0. You need to check your dependencies as somewhere you have a reference to the old package.
Also note that due to some changes that were made in the way that Unity ships, Prism has also made a change from referencing the Unity package to the Unity.Container package as of Prism 7.1.

Wrong FSharp.Core version looked for in a Xamarin.Forms project

In a Xamarin.Forms project I am getting an error on Windows 8.1 and UWP:
Could not load file or assembly 'FSharp.Core, Version=3.259.3.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.
The actual version of F# used throughout the solution is 3.7.4.0:
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile>Profile7</TargetFrameworkProfile>
<TargetProfile>netcore</TargetProfile>
<TargetFSharpCoreVersion>3.7.4.0</TargetFSharpCoreVersion>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
There is an F# PCL project and C# platform-specific projects. The error occurs only when using F# libraries from Nuget in the PCL. These packages tend to use:
<TargetFSharpCoreVersion>3.259.3.1</TargetFSharpCoreVersion>
I have tried the following, but they do not change the error:
Putting an app.config file with a binding redirect to 3.7.4.0 in the F# project and/or the build directory
Installing the FSharp.Core Nuget package into all projects
Very grateful for any help.
Edit: in the original question there was an incompatibility between the profile (111) and the intended TargetFSharpCoreVersion (3.7.4.0) which was causing additional issues.

Working with VB.Net Assemblies

It seems that the ".Net Assembly Import" is actually a "C# Assembly Import"...
I am trying to import a VB.Net Assembly (Tools > Application Integration > .Net Assembly Import) only to find that it cannot be done.
I get the error:
"Error trying to load Microsoft.VisualBasic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a: Could not load file
or assembly 'Microsoft.VisualBasic, Version=10.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The
system cannot find the file specified."
I usually don't have problems importing C# Assemblies, so I tried to create an intermediate C# class to access the methods of the Vb.Net one.... But it also seems that I can't import C# assemblies into Gx, when they have a reference to a Vb.Net class.
How can I access the methods of a VB.Net Assembly?
Did you put the vb.net assembly .dll into bin folder of your application?
Theoretically vb.net code and c# code turns into bytecode compiled by .net framework
I found this url that convertĀ“s the code from vb.net to c# and vice versa (if you have the source, if not try decompile)
http://converter.telerik.com/
Hope that helps.
Regards, Felipe.

Fails to Compile C# project due to primary reference

I'm trying to compile the project with targeted framework as ".NETFramework 4.0". But I get the following warning:
The primary reference "XXX" could not be resolved because it has an
indirect dependency on the framework assembly
"System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089" which could not be resolved in the
currently targeted framework. ".NETFramework,Version=v4.0". To resolve
this problem, either remove the reference "Fdi" or retarget your
application to a framework version which contains
"System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089".
I found an earlier (but similar) problem: Visual Studio 2010: Reference Assemblies Targeting Higher Framework Version
Johannes Rudolph found this answer on MSDN's forums ( http://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/dfadfb34-5328-4c53-8274-931c6ae00836 ):
However, there're 2 workarounds.
Option 1:
Step1: Unload the referencing project targeting .NET 2.0
Step2: Right click the unloaded project and select edit from context menu
Step3: Add <SpecificVersion>true</SpecificVersion> to the reference.
Below is a sample from my repro solution:
<ProjectReference Include="..\HighFX\HighFX.csproj">
<Project>{8DD71CAF-BEF7-40ED-9DD0-25033CD8009D}</Project>
<Name>HighFX</Name>
<SpecificVersion>true</SpecificVersion>
</ProjectReference>
Step4: Reload the project.
Now your should be able to build within the Visual Studio 2010, there could still be a warning as below, but the build can be successful.
Warning 1 The project 'XXX' cannot be referenced. The referenced project is targeted to a higher framework version (3.5)
Option2:
Use the command line tool csc.exe to build each of your source file, which won't prevent the building.

Missing reference while Converting VS2008 project to VS2010 project

When i converted a VS2008 project to 2010 it shows an error message
The type name 'IComponentConnector' could not be found in the namespace 'System.Windows.Markup'. This type has been forwarded to assembly 'System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' Consider adding a reference to that assembly
and it was build when we add a reference System.Xaml. What would be the reason for need to add additional reference?
In .Net 3.5/3,0, IComponentConnector (namespace System.Windows.Markup) was part of WindowsBase.dll and it was moved in System.Xaml in .net 4.0 onwards.
It seems you are upgrading your project framework 3.5 to 4.0
The type was moved to the new assembly in .net 4?
You are changing you project to use .net 4 and it's telling you that you need this type from that assembly in .net 4.
if you target .net 3.5 you'll find you wont need to do this.
As a thumb rule, always add the namespace that is documented. The document says to use the namespace System.Windows.Markup. It worked in VS2008 probably because System.Xaml was internally using the namespace System.Windows.Markup.

Resources