在Asp.NET Core MVC 6中使用PetaPoco [英] Using PetaPoco in Asp.NET Core MVC 6

查看:93
本文介绍了在Asp.NET Core MVC 6中使用PetaPoco的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我开始尝试新的ASP.NET 5平台,并在Project.json中具有以下依赖项

so i started trying out the new ASP.NET 5 Platform and have the following dependencies in my Project.json

"dependencies": {
    "System.Collections": "4.0.10-beta-23019",
    "System.Linq": "4.0.0-beta-23019",
    "System.Threading": "4.0.10-beta-23019",
    "System.Runtime": "4.0.10-beta-23019",
    "Microsoft.CSharp": "4.0.0-beta-23019",
    "PetaPoco.Core": "5.1.141-beta"
},

"frameworks": {
    "dnx451": { "dependencies": { "Microsoft.AspNet.Identity.EntityFramework": "3.0.0-beta5" } },
    "dnxcore50": { "dependencies": { "Microsoft.AspNet.Identity.EntityFramework": "3.0.0-beta5" } }
}

一切正常,但是当我尝试从PetaPoco命名空间访问任何内容时.一切都失败,并显示该消息.

Everything builds fine but when i try to access anything from the PetaPoco namespace. Everything fails with the message.

找不到类型或名称空间PetaPoco,因为您缺少using指令或程序集引用.

我知道这是什么意思,但是即使尝试导入名称空间也会导致相同的问题,我可以在DNX4.5.1和DNX5.0参考中看到该库

I know what this means but even trying to import the namespace causes the same issue and I can see the library right there in the DNX4.5.1 AND DNX5.0 References

请问我在这里想念什么

预先感谢

推荐答案

您应该可以将PetaPoco与dnx451一起使用.但是,您需要使用已编译的 nuget包作为项目结构已更改,单个文件部署不会将源文件复制到有效位置(我的猜测).

You should be able to use PetaPoco with dnx451. However, you'll need to use the compiled nuget package, as the project structure has changed and the single file deploy won't be copying the source file to a valid location (My guess).

此外,根据我的评论,dnxcore50(现在为.Net Core 1.0)缺少ado堆栈中的一两个组件,这意味着PetaPoco无法正常工作.但是,定位dnx451应该可以.

In addition and as per my comment, dnxcore50 (now .Net Core 1.0) is missing a component or two from the ado stack, which means PetaPoco won't work. However, targeting dnx451 should work.

最后,在发布RC2之后,我们很可能会看到PetaPoco为.NET/Asp.Net Core 1.0构建.

Lastly, we'll mostly likely see PetaPoco builds for .NET/Asp.Net Core 1.0 after they release the RC2.

这篇关于在Asp.NET Core MVC 6中使用PetaPoco的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆