引用的类库不写入数据库 [英] Referenced class library not writing to database

查看:64
本文介绍了引用的类库不写入数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个包含两个类库项目的解决方案(BL& DAL),这是一个工作解决方案,为未来的开发项目提供通用的错误记录平台。



在我目前正在研究的另一个解决方案中,我引用了错误记录器的BL层并调用了必要的函数并传递了数据。它似乎从来没有写过错误记录器的数据库。



有谁知道我可能错过了什么?



我尝试了什么:



我在错误记录中安装了Entity Framework包系统和我已按照通常的流程通过包管理器控制台初始化数据库。



我引用了错误记录器的BL层并调用了必要的功能,它操纵数据并将其发送到DAL进行存储。

I have created a solution with two class library projects in it (BL & DAL), which is a working solution to provide a universal 'error logging' platform for future development projects.

In the other solution I am currently working on, I have referenced the BL layer of the Error Logger and called the necessary function and passed through the data. It doesn't ever then appear to be writing anything out to the Error Logger's database.

Does anyone know what I might have missed out please?

What I have tried:

I have installed the Entity Framework package on the Error Logging system and I have initialised the database via the package-manager console as per the usual process.

I have referenced the BL layer of the Error Logger and called the necessary fucntion, which manipulates the data and sends it through to the DAL to be stored.

推荐答案

可能缺少配置。如果引用的dll中的代码依赖于任何配置,则该配置需要位于引用它们的项目的配置文件中。



类很少见简单地说什么都不做。有一个代码路径只是因某些条件而停止代码运行,或者抛出异常。您可以将项目添加到正在测试的解决方案中,而不是将它们作为dll引用,并使用调试器进入代码以更好地了解发生的情况。
It could be missing configuration. If the code in your referenced dlls relies on any configuration then that configuration needs to be in the config files of the project that is referencing them.

It's rare that a class simply "does nothing" though. Either there is a code path that is simply stopping the code running due to some condition, or an exception is thrown. You can add the projects to the solution you are testing rather than referencing them as dlls and use the debugger to step into your code to get a better idea what is going on.


这篇关于引用的类库不写入数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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