Hi,

got an exception when loading class libraries with only entities from windows forms app. My solution has three entity assemblies (and very little other classes included). On top there is a windows forms project and a MVC4 webapi project. Using version 4.6.3. The web api project is able to load all assemblies without any problems and is working with the same domainconfiguration initialization and the same config.

<xtensive.orm> <domains> <domain name="MSSQLMaintenance" upgrademode="Perform" provider="sqlserver" connectionstring="Data Source=localhost\\sqlexpress;Initial Catalog=MasterData;Integrated Security=True;MultipleActiveResultSets=True"> <types> <add assembly="Business.General"/> <add assembly="Business.MasterData"/> <add assembly="Business.AccountManagement"/> </types> </domain> </domains> </xtensive.orm>

Initialization (all entities recite in different assemblies, businessEntity is base class for all entities and thus also used in the other assemblies):

            _domainconfiguration = DomainConfiguration.Load("MSSQLMaintenance");
            _domainconfiguration.Types.Register(typeof(BusinessEntity).Assembly);
            _domainconfiguration.Types.Register(typeof(Zipcode).Assembly);
            _domainconfiguration.Types.Register(typeof(Account).Assembly);

            _domain = Domain.Build(_domainconfiguration);

Now the windows forms app (while the mvc web api services work fine) throws an exception on the code above:

Could not load type 'Business.MasterData.Entities.Country' from assembly 'Business.MasterData, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8ebc56055ae5b98e'.

Country recites in the masterdata assembly together with zipcode. I am really lost with this one, tried many things but the only thing that seems to make a difference is to re-create the entire masterdata project (create new and copy all sources into it works for a while until something happens and its broken again).

Happened couple of times now and getting tired of it :), Anybody knows what I am doing wrong?

PS: inner exception doesn't provide any additional info.

Regards, Robin

asked Sep 16 '13 at 17:44

Robin's gravatar image

Robin
5111

Just some questions - are you referencing anything in your libraries that your main project isn't referencing? Are you using the same framework versions everywhere? Are you using the version of the referenced assemblies everywhere? Do you have any of your assemblies in GAC also?

(Sep 17 '13 at 17:10) Onkelborg Onkelborg's gravatar image

All projects use .NET 4.5 (changed it for all except the webapi service to 4 because 4.5 doesn't seem to be officially support but doesn't seem to make a difference). Main project is referencing all entities class libraries and 3 xtensive assemblies orm, core and aspects and postsharp ) which are also referenced by entity class libraries. Checked references and all point to the same location. Checked GAC (32 & 64) but no trace of xtensive or postsharp. Using visual studio 2012 on windows 7 64 bit. Did a standard [next next next] installation of DO latest distribution.

(Sep 18 '13 at 01:38) Robin Robin's gravatar image

My research indeed also points to something with the csproj file of the main project since after manually setting up a new empty project, linking references and add sources it works again until the next time. I think it must have something to do with changes i made to the entity class libraries messing up some versioning or reference in the main project but have no clue.

(Sep 18 '13 at 01:38) Robin Robin's gravatar image

Hello Robin,

it's hard to give exact advice on your situation.

Try fusion log viewer tool http://msdn.microsoft.com/en-us/library/e74a18c4.aspx to see assembly binding issues. This could give some important information.

It's also worth checking DataObjects.Net assembly versions (Orm, Aspects, Core). They obviously should match.

Since you're using code from ASP.NET application in WinForms application it's also worth checking if assemblies you use are available in "client profile" of .NET framework. Since ASP.NET is not included in "client profile" you probably should use "full profile".

(Sep 18 '13 at 10:42) Denis Krjuchkov Denis%20Krjuchkov's gravatar image

By the way we officially support .NET Framework 4.5 using the same assembly set as for .NET 4.0. Any issues regarding .NET 4.5 usage are handled with the same thoroughness.

(Sep 18 '13 at 10:43) Denis Krjuchkov Denis%20Krjuchkov's gravatar image
Be the first one to answer this question!
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

Subscription:

Once you sign in you will be able to subscribe for any updates here

Tags:

×1

Asked: Sep 16 '13 at 17:44

Seen: 5,920 times

Last updated: Sep 18 '13 at 10:43

Related questions

powered by OSQA