简体   繁体   中英

Copying References Asp.net MVC Project Error

I am trying to work on an asp.net project and am having some issues that I don't understand how to fix.

I am new to ASP.NET and am learning step by step.

I have watched some courses on Lynda as well as Pluralsight and wanted to try creating a full project.

I was told by the person teaching me to separate my project into 3 layers

  • Data Layer
  • View Layer
  • Service Layer

So after creating the project, I right clicked on my solution and added 2 new class libraries for the data and service layers.

Then I tried to move the code int the Models folder from the View Layer > Data Layer, and my project started showing errors and not compiling ( I assume from missing all the entity framework references).

Then I tried click References on my Data Layer library > add Reference and referencing the view layer.

That didn't work.

Then, I installed visual studio productivity power tools 2017 to enable the power commands section for copying references.

Then I went to the view layer, copy references and tried pasting into the data layer, and it generated an error saying:

Error HResult E_Fail has been returned from a call to a COM component.

I know when I did the project as 1 layer and I did enable-migrations and update-database all would work, and I assume I have to do that after I get my data layer working.

Is there anything I am doing wrong or incorrectly.

Thanks,

删除所有项目的csproj.user文件应该可以解决此问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM