ADODBCould not load type 'ADODB.FieldsToInternalFieldsMarshaler' from assembly

梦想的初衷 提交于 2019-11-28 21:18:14

It's on the individual references - not in the project properties. In the solution explorer window, open "References" (under the project), and click on the reference in question. The properties window will have an option for Embed Interop Types (for each reference).

In Visual BAsic 2010:

To turn off Embed Interop Types:

Project menu > Show All Files, Solution Explorer: > References: > ADODB > Embed Interof types = False. Microsoft.Office.Interop.Access > Embed Interof types = False

You will now be able to publish and also ADODB will appear in the: Project Menu > Project Properties… Publish TAB > Application Files

Sushant Rath

Solved:

Solution Explorer --> Show all files (Menu Item) --> Referances --> Adodb -->(properties) -->Embed Interop Types --> False.

See what I found on this question here. I referenced yours, but still couldn't get the ADODB to work.

Little one to add:

SolutionExplorer --> View All Files. For ADODB: - Embed... = False; - Copy Local = True.

Got the same problem in VS 2013, and the solution for that is that you go to References and select ADODB, on properties you will see Embed Interof types = True then change it to false.

Okay, I figured how to do this:

Presentation.Category categorySvc = new Presentation.Category();
ADODB.Recordset categories = categorySvc.ListAll("BE", "DUE", "EN", 128);
categories.MoveFirst();
while(!categories.EOF)
{
    var fields = ((dynamic)categories).Fields;
    for (int i = 0; i < fields.Count; i++)
    {
        var field = fields[i];
        var name = field.Name;
        var value = field.Value;
        // ...
    }
    categories.MoveNext();
}

I got this problem clearing temporary file(VS 2017). Solution for this exception you need to change Solution Explorer > References > adodb > "Then Right click and choose properties" > Embed Interop Types, set "True" to "False"

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!