Using HtmlAgilityPack with MonoTouch app gives reference error

孤者浪人 提交于 2019-12-02 03:42:59

Are you compiling from source or using the DLL directly?

You will need to make a new MonoTouch library project and add all the files for it to work.

Using a DLL directly likely won't work, since it was not compiled for MonoTouch.

Darkevil

You have to compile it from code Download the source

go into

\htmlagilitypack-99964\Branches\1.4.0\HtmlAgilityPack

Edit the csproj change to

<Import Project="$(MSBuildExtensionsPath)\Novell\Novell.MonoDroid.CSharp.targets" />

Save and load

Fix errors

Trace -> Debug

Remove block

 if (!SecurityManager.IsGranted(new DnsPermission(PermissionState.Unrestricted)))
        {
            //do something.... not at full trust
            try
            {
                RegistryKey reg = Registry.ClassesRoot;
                reg = reg.OpenSubKey(extension, false);
                if (reg != null) contentType = (string)reg.GetValue("", def);
            }
            catch (Exception)
            {
                contentType = def;
            }
        }

Remove block

 if (SecurityManager.IsGranted(new RegistryPermission(PermissionState.Unrestricted)))
        {
            try
            {
                RegistryKey reg = Registry.ClassesRoot;
                reg = reg.OpenSubKey(@"MIME\Database\Content Type\" + contentType, false);
                if (reg != null) ext = (string)reg.GetValue("Extension", def);
            }
            catch (Exception)
            {
                ext = def;
            }
        }

Use the dll in the bin/debug folder

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