简体   繁体   English

PetaPoco核心.cs文件在ASP.NET 5类库包中不可见

[英]PetaPoco core .cs file not visible in ASP.NET 5 Class Library package

I am building a new project in ASP.NET 5. In my solution I have added a new Class Library (Package) project. 我正在ASP.NET 5中构建一个新项目。在我的解决方案中,我添加了一个新的Class Library (Package)项目。

I right click on this project and choose for Manage Nuget packages to install PetaPoco.Core . 我右键单击此项目并选择Manage Nuget包来安装PetaPoco.Core

When I install everything seems fine except that the PetaPoco.cs file is not in my project. 当我安装一切似乎很好,除了PetaPoco.cs文件不在我的项目中。

In my references I se the PetaPoco version 5.1.171 installed. 在我的参考资料中,我安装了PetaPoco版本5.1.171。

Is this something different then a normal class library and do I need to use something else in order to use the installed PetaPoco class or is it a problem during the installation? 这是不同于普通类库的东西,我是否需要使用其他东西才能使用已安装的PetaPoco类,或者在安装过程中是否存在问题?

I have removed and reinstalled this but still the same. 我已经删除并重新安装了这个但仍然相同。

Someone that can help me out? 有人能帮帮我吗?

/Michael /迈克尔

It looks like the PetaPoco.Core package isn't setup to be used in portable class libraries (PCLs). 看起来PetaPoco.Core包未设置为在便携式类库(PCL)中使用。

Including content files in PCLs like the Models folder that PetaPoco.Core creates requires a different NuGet setup than a regular project. 在PCL中包含内容文件(如PetaPoco.Core创建的Models文件夹)需要与常规项目不同的NuGet设置。 Documentation on this can be found on NuGet . 关于此的文档可以在NuGet上找到 I downloaded their package directly and can confirm that it is not setup in the way the linked resource describes. 我直接下载了他们的软件包,并确认它没有像链接资源描述的那样进行设置。

It may be that the project requires features that are not available yet cross-platform, or they simply haven't had time to make changes to support PCLs, or some other reason that I am not aware of. 可能是项目需要跨平台不可用的功能,或者他们根本没有时间进行更改以支持PCL,或者其他一些我不知道的原因。

NuGet packages are usually installed as DLLs in the bin folder of your project, with the needed references also added automatically to the project. NuGet包通常作为DLL安装在项目的bin文件夹中,所需的引用也会自动添加到项目中。 They usually don't include source files. 它们通常不包含源文件。 You may find sources - if available - on the package/project website. 您可以在包/项目网站上找到来源(如果有)。

Visual Studio IntelliSense will pick up the DLLs and show what it can about the classes and methods inside, including comments and method signatures. Visual Studio IntelliSense将获取DLL并显示其内部类和方法的内容,包括注释和方法签名。

See here for a tutorial, including how to build your own NuGet packages. 请参阅此处获取教程,包括如何构建自己的NuGet包。

EDIT: PetaPoco is the exception that does add a .cs file... see comment below. 编辑:PetaPoco是确实增加一个cs文件......见下文评论例外。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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