2

I was trying repository pattern with ASP.Net 5 project and service project. I referenced my ".Service" class library project into my ".Web" project but something went wrong with the reference. I removed all referenced to other libraries, even removed my ".Service" and ".Web" projects and added new empty ones but the newly created ".Web" project still referencing the old version of deleted ".Service" project.

".Web" > ASP.Net 5 project. ".Service" > .Net Framework 4.5.1 class library project.

[URL for project on github] https://github.com/ahmedhelmy204/Publess/tree/master/Publess

Screenshot of the current issue state

  • Your repository don't `Publess.Data` which you reference and includes `Publess.Core` on the wrong place (see [here](https://github.com/ahmedhelmy204/Publess/blob/master/Publess/wrap/Publess.Core/project.json#L7-L8) and compare with https://github.com/ahmedhelmy204/Publess/tree/master/Publess/artifacts/bin/Publess.Web). Moreover the `wrap` folder contains `EntityFramework.SqlServer` and `EntityFramework` which should be removed. Could you update your repository? – Oleg Jan 17 '16 at 14:24
  • Thanks Oled, it worked after removing folders in wrap and rebuild. Please post it in answers to mark as right answer. – Ahmed Helmy Jan 20 '16 at 06:51
  • Also I would appreciate if you added a link about wrap folder and it is work. – Ahmed Helmy Jan 20 '16 at 07:08

1 Answers1

2

Your repository don't Publess.Data, which you reference and includes Publess.Core on the wrong place (see here and compare with github.com/ahmedhelmy204/Publess/tree/master/Publess/artifacts/...). Moreover the wrap folder contains EntityFramework.SqlServer and EntityFramework, which should be removed.

The directory wrap/EntityFramework.SqlServer for example contains project.json with wrong version number 1.0.0 for EntityFramework and it informs to get EntityFramework.SqlServer.dll from .../Publess.Data/bin/Debug folder

{
  "version": "1.0.0-*",
  "frameworks": {
    "net451": {
      "bin": {
        "assembly": "../../Publess.Data/bin/Debug/EntityFramework.SqlServer.dll"
      },
      "dependencies": {
        "EntityFramework": "1.0.0-*"
      }
    }
  }
}

The wrap folder will be created when you add old project or old assembly to new ASP.NET 5 project. The entries wrappedProject and bin with assembly and pdb will be created. One can use Visual Studio or dnu wrap to do this (see dnu wrap -h). See the answer, the documentation or the post.

Some additional advices can gives you the source code of dnu wrap. See here and here and here

Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798