Hi,

Still trying to setup my first test with DataObjects.NET on my project.

Relevant to this scenario I have:

  • A Domain Layer
  • DataObjects.NET
  • Another project called Domain.Tests

Other relevant info:

On Domain.Tests.RandomTestClass

[TestInitialize]
public void SetUp()
{
    DomainConfiguration aDomainConfiguration = DomainConfiguration.Load("Default");
    aDomainConfiguration.Types.Register(typeof(Domain.RandomClass).Assembly, typeof(Domain.RandomClass).Namespace);
    CurrentDomain = Domain.Build(aDomainConfiguration);
    AccessSession = CurrentDomain.OpenSession();
}

On Domain.Tests.App.Config

<domains>
  <domain name="Default" upgradeMode="Recreate" connectionUrl="sqlserverce://localhost/mockDb.sdf" />
</domains>

On both Domain.Tests.csproj and Domain.csproj

I have: DontImportPostSharp=True

And I don't have: SkipPostSharp

When I try to run the unit test, I get:

Assembly 'Domain, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not processed by PostSharp. See section 2 of Manual for details.

What am I messing up? From what I've seen in other questions, it looks like it's the way it's meant to be.

Thanks!

asked Jun 05 '12 at 09:51

pgoes's gravatar image

pgoes
216610

edited Jun 05 '12 at 10:04

Dmitri%20Maximov's gravatar image

Dmitri Maximov
22111211


One Answer:

Pedro, consider using Project tool for the project.

answered Jun 05 '12 at 10:00

Dmitri%20Maximov's gravatar image

Dmitri Maximov
22111211

edited Jun 05 '12 at 10:01

Dmitri, I did use it. And I don't remember modifying .csproj after using it. Is there anything wrong with my .csproj? Tks!

(Jun 05 '12 at 10:04) pgoes pgoes's gravatar image

Pedro, do you have DataObjects.Net installed or not?

(Jun 05 '12 at 10:05) Dmitri Maximov Dmitri%20Maximov's gravatar image

It was installed using the package available on the website. I'm using VS 11, so I don't have project templates available. I used the Project Tool to create the references and stuff in my projects inside the solution.

I was able to get it working on a single project first-test (everything was on the same project, 1 assembly, just as a test case and everything worked). When I moved to my "real" project I started getting these issues I can't pinpoint the solution.

(Jun 05 '12 at 10:08) pgoes pgoes's gravatar image

I've been even comparing my test project (working) with the real one (showing this issue) [comparing .csproj, references, etc] and they seem the same, so I'm clearly missing something.

(Jun 05 '12 at 10:11) pgoes pgoes's gravatar image

Dmitri, tks for the help so far, but hold on that... I think I got it to advance rewriting stuff from my CSPROJ of the test project. It's not clear what was wrong, but I was screwing something up it seems.

(Jun 05 '12 at 10:22) pgoes pgoes's gravatar image

Pedro, if you send us the solution we could check what is wrong, fix it and send back to you. E-mail is support at x-tensive dot com

(Jun 05 '12 at 10:38) Dmitri Maximov Dmitri%20Maximov's gravatar image
1

Dmitri,

Tks for the help. I've found the error. Short answer: I screwed up. Long answer: for some reason the <import project="$(MSBuildExtensionsPath)\\DataObjects.Net\\v4.5\\DataObjects.Net.targets"/> line was missing on the UnitTest project I was running. Added it, everything worked.

(Jun 05 '12 at 12:17) pgoes pgoes's gravatar image

Pedro, thanks for informing us that the issue is solved!

(Jun 05 '12 at 14:22) Dmitri Maximov Dmitri%20Maximov's gravatar image
Your answer
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

powered by OSQA