Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Assembly not found
Message
De
24/12/2009 08:03:12
 
 
À
24/12/2009 07:35:11
Information générale
Forum:
ASP.NET
Catégorie:
Windows Presentation Foundation (WPF)
Versions des environnements
Environment:
C# 3.0
Divers
Thread ID:
01439842
Message ID:
01440511
Vues:
21
>>Don't forget that intellisense is listing in namespace order. Double check that the namespaces used in the assembly are what you thought/are looking for (I've made that mistake before.....)
>>>
>
>I checked my Members.Library project properties and it had the Assembly Name and default namespace set to Members. I've changed both to Members.Library, but it hasn't made a difference. All my code in my class library all had Members.Library as the namespace.
>
>>>>To narrow things down a bit I'd try temporarily adding a new project and trying to reference the Members.Library assembly from there (initially without actually making use of the assembly elswhere in XAML)
>>>>
>
>I added a new Winforms project and put using Members.Library in the Program.cs and it didn't complain (it also showed me the intellisense for Library after I had typed in Members.)
>
>I then added a new WPF Application and in the default Window1.xaml tried to add the xmlns:Members= and Members.Library was not in the intellisense list.
>
>This is the code:
>
>
<Window x:Class="TestWpf.Window1"
>    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
>    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
>        xmlns:Members="Mem"
>    Title="Window1" Height="300" Width="300">
>    <Grid>
>        
>    </Grid>
></Window>
>
Hmmm. Works for me. Given this file in a project named Members:
namespace Members.Library
{
    public class Class1
    {
    }
}
then the following WPF XAML shows the Library.Members namespace in Intellisense and ends up like this:
<Window x:Class="WpfApplication1.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Members="clr-namespace:Members.Library;assembly=Members" >
</Window>
But I have come across occasions where it was neccessary to remove and re-add the Members project to the WPF apllication references before Intellisense picked it up (but I think this has already beem suggested).

What happens if you try adding a 'using Members.' in the windows code-behind - does Intellisense kick in there with the 'Library' part?

And just to be clear : Can you confirm that you are adding the reference to the Members assembly as a reference to the project in the same solution rather than a reference to the DLL?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform