小编Sim*_*mon的帖子

为什么,当我在WCF服务中模拟时,当我尝试运行LINQ to SQL查询时,我的服务是否可以加载System.Transactions?

我有一个WCF服务,托管在IIS 7.0中,需要运行数据库查询.为了获得正确的权限,我在服务中模仿如下:

[OperationBehavior(Impersonation = ImpersonationOption.Allowed)]
public void MyOperation(int arg)
Run Code Online (Sandbox Code Playgroud)

组态

<behavior name="ReceivingServiceBehavior">
    <!-- Other behaviors -->
    <serviceAuthorization impersonateCallerForAllOperations="true" />
</behavior>
Run Code Online (Sandbox Code Playgroud)

当我尝试连接并运行我的查询时,我得到以下内容:

Exception - System.IO.FileLoadException: Could not load file or
assembly 'System.Transactions, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' or one of its dependencies. Either a
required impersonation level was not provided, or the provided
impersonation level is invalid. (Exception from HRESULT: 0x80070542)

File name: 'System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' ---> System.Runtime.InteropServices.COMException (0x80070542): Either a required impersonation level was not provided, or the provided impersonation …

.net sql-server security wcf transactions

8
推荐指数
2
解决办法
2万
查看次数

标签 统计

.net ×1

security ×1

sql-server ×1

transactions ×1

wcf ×1