简体   繁体   English

OpenAccess nuget程序包和找不到嵌入在程序集异常中的资源EntitiesModel.rlinq

[英]OpenAccess nuget package and Cannot find resource EntitiesModel.rlinq embedded in assembly exception

We want to remove the necessity of installing OpenAccess on the client and build machine and plan to do that using OpenAccess nuget packages. 我们要消除在客户端上安装OpenAccess的必要性,并构建计算机,并计划使用OpenAccess nuget软件包进行安装。 I've been following the guide and installed OpenAccess.CodeFirst nuget packages for all projects in solution which deal with ORM. 我一直在遵循该指南,并为解决ORM的解决方案中的所有项目安装了OpenAccess.CodeFirst nuget软件包。

Unfortunately, I receive the infamous exception: 不幸的是,我收到了臭名昭著的异常:

System.TypeInitializationException: The type initializer for 'XXXl' threw an exception. ---> System.ArgumentException: Cannot find resource EntitiesModel.rlinq embedded in assembly

I've checked all the steps from this article but I'm still getting the same error. 我已经检查了本文中的所有步骤,但仍然遇到相同的错误。 What am I missing? 我想念什么?

As the Telerik OpenAccess ORM Nuget Packages provide support for the code first approach, by default settings are optimized for fluent mapping and only fluent mapping models will be enhanced. 由于Telerik OpenAccess ORM Nuget软件包提供了对代码优先方法的支持,因此默认情况下针对流利的映射优化了设置,并且仅流利的映射模型将得到增强。 In order to use different type of mapping (Xml mapping or Attributes mapping) you need to enable it following those steps: 为了使用不同类型的映射(Xml映射或属性映射),您需要按照以下步骤启用它:

  1. Unload the project containing your model and open the project file for editing. 卸载包含模型的项目,然后打开项目文件进行编辑。
  2. Enable xml mapping by adding true in the first PropertyGroup of the project file. 通过在项目文件的第一个PropertyGroup中添加true来启用xml映射。

For example: 例如:

<?xml version="1.0" encoding="utf-8"?>
<Project ...>
  ...
  <PropertyGroup>
    ...
    <UseXmlMapping>true</UseXmlMapping>
  </PropertyGroup>
  ...
</Project>

Additionally you can find an alternative approach for using Telerik OpenAccess ORM without installation described by this documentation article - http://documentation.telerik.com/openaccess-orm/developers-guide/integrating-openaccess-orm-in-your-solution/external-tools-howto-integrate-enhancer-msbuild . 此外,你可以找到使用Telerik的OpenAccess的ORM没有这个文件文章描述安装另一种方法- http://documentation.telerik.com/openaccess-orm/developers-guide/integrating-openaccess-orm-in-your-solution/外部工具如何集成增强器msbuild

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

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