2016-05-12 95 views
0

我使用NuGet中的一個包,它在localhost上工作,在生產服務器上工作,但在最近一次移動後到不同的生產服務器,我收到以下錯誤:ASP.NET試圖通過訪問字段'System.Data.SqlClient.xxx._connection'的方法失敗

Attempt by method 'EntityFramework.BulkInsert.Extensions.TypeExtensions.GetPrivateFieldValue(System.Object, System.String)' to access field 'System.Data.SqlClient.SqlConnection._connectionString' failed.

包是:https://efbulkinsert.codeplex.com/我不認爲這是特定的軟件包,因爲使用其他包批量插入,我收到了類似的錯誤:

Attempt by method 'Z.Utility.SqlBulkOperation.SetCommonSetting()' to access field 'System.Data.SqlClient.SqlBulkCopy._connection' failed.

這裏常見的事情是System.Data.SqlClient.xxx._connection failed

是否有任何IIS設置我需要看?我很難過。

+0

也許提供一些你的代碼? –

+0

實際上,使用第一個軟件包'db.BulkInsert(records);',使用第二個軟件包'db.SqlBulkInsert(records);'就沒有什麼了。代碼工作,只是不在特定的服務器上。 – Fergal

回答

0

我不得不在IIS中將.NET信任級別從Medium改爲Full。

相關問題