Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Assembly not found
Message
De
24/12/2009 13:08:02
 
 
À
24/12/2009 10:33:10
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:
01440559
Vues:
24
Viv,

thanks for all your help. I seem to have got past the problem now (I added some more functionality into my Members.Library and rebuilt the solution and the problem went away, go figure).

I'm off until the new year so may not get back to this until then.

Merry Christmas and enjoy the festivities.


>>>>>Snip: Error : The type reference cannot find a public type named 'Members.MembershipTypes'.
>>>>>
>>>>>Your reference in XAML is : x:Type Members.MembershipTypes
>>>>>Is that the right namespace? Should it be : Members.Library.MembershipTypes ?
>>>>
>>>>I thought that this line meant I could refer to it as Members alone:
>>>>
>>>>xmlns:Members="clr_namespace:Members.Library;assembly=Members.Library"
>>>>
>>>>Maybe I'm misunderstanding what this does, but I thought it was like a using Members.Library, but giving it an alias called "Members".
>>>>
>>>>Is that right?
>>>
>>>No. If you are using the xmlns alias it should be a colon (so I just realized I was wrong in suggesting the correction I did).
>>>If your xmlns is Members="Members.Library...." then the line should be:
x:Type Members:MembershipTypes
>>>(assuming you are referencing Members.Library.MembershipTypes)
>>>
>>
>>OK, I changed it to use a colon
>>
>>
ObjectType="{x:Type Members:MembershipTypes}"
>>
>>but I'm getting this error:
>>
>>The type reference cannot find a public type named 'MembershipTypes'.
>>
>>In case it helps, here is my code for MembershipTypes:
>>
>>
>>using System;
>>using Csla;
>>using Csla.Data;
>>using Csla.Security;
>>
>>namespace Members.Library
>>{
>>    [Serializable]
>>    public class MembershipTypes : BusinessListBase<MembershipTypes, MembershipType>
>>    {
>>        #region Business Methods
>>
>>        public void Remove(Guid id)
>>        {
>>            foreach (MembershipType item in this)
>>            {
>>                if (item.Id == id)
>>                {
>>                    Remove(item);
>>                    break;
>>                }
>>            }
>>        }
>>
>>        public MembershipType GetMembershipTypeById(Guid id)
>>        {
>>            foreach (MembershipType item in this)
>>            {
>>                if (item.Id == id)
>>                {
>>                    return (item);
>>                }
>>            }
>>            return null;
>>        }
>>
>>        protected override object AddNewCore()
>>        {
>>            MembershipType item = MembershipType.NewMembershipType();
>>            Add(item);
>>            return item;
>>        }
>>        #endregion
>>
>>        #region Validation Rules
>>
>>        //protected override void AddBusinessRules()
>>        //{
>>        //    // TODO: add validation rules
>>        //}
>>
>>        #endregion
>>
>>        #region Authorization Rules
>>
>>        //protected override void AddAuthorizationRules()
>>        //{
>>        //    // TODO: add authorization rules
>>        //}
>>
>>        private static void AddObjectAuthorizationRules()
>>        {
>>            // TODO: add object-level authorization rules
>>        }
>>
>>        #endregion
>>
>>      #region  Factory Methods
>>
>>      public static MembershipTypes GetMembershipTypes()
>>      {
>>        return DataPortal.Fetch<MembershipTypes>();
>>      }
>>
>>      private MembershipTypes()
>>      {
>>        this.Saved += MembershipTypes_Saved;
>>        this.AllowNew = true;
>>      }
>>
>>      protected override void OnDeserialized()
>>      {
>>        base.OnDeserialized();
>>        this.Saved += MembershipTypes_Saved;
>>      }
>>
>>      #endregion
>>
>>      #region  Data Access
>>
>>      private void MembershipTypes_Saved(object sender, Csla.Core.SavedEventArgs e)
>>      {
>>        // this runs on the client and invalidates
>>        // the RoleList cache
>>        MembershipTypeList.InvalidateCache();
>>      }
>>
>>      protected override void DataPortal_OnDataPortalInvokeComplete(Csla.DataPortalEventArgs e)
>>      {
>>        if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Server &&
>>            e.Operation == DataPortalOperations.Update)
>>        {
>>          // this runs on the server and invalidates
>>          // the RoleList cache
>>          MembershipTypeList.InvalidateCache();
>>        }
>>      }
>>
>>      private void DataPortal_Fetch()
>>      {
>>        this.RaiseListChangedEvents = false;
>>        using (var ctx = ContextManager<Members.DalLinq.MembersDataContext>.GetManager(Members.DalLinq.Database.Members))
>>        {
>>          foreach (var value in ctx.DataContext.getMembershipTypes())
>>            this.Add(MembershipType.GetMembershipType(value));
>>        }
>>        this.RaiseListChangedEvents = true;
>>      }
>>
>>      [Transactional(TransactionalTypes.TransactionScope)]
>>      protected override void DataPortal_Update()
>>      {
>>        this.RaiseListChangedEvents = false;
>>        using (var ctx = ContextManager<Members.DalLinq.MembersDataContext>.GetManager(Members.DalLinq.Database.Members))
>>        {
>>          Child_Update();
>>        }
>>        this.RaiseListChangedEvents = true;
>>      }
>>
>>      #endregion
>>
>>    }
>>}
>
>I've no idea whether this may affect anything but I see that you have a private default constructor for the class which means it cannot be instantiated directly - but the XAML may try to do this. What happens if you make that constructor public (as a test)
>(This is a bit of a left-field response - haven't really thought it through)
>
>About to knock off and crack a festive bottle - so any subsequent replies I make (if any) may be even less useful :-}
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform