in VS2017 C# ,I create x64 dll activex ,to debug it in IE F12 ,the object cann't load. RRS feed

  • Question

  • Hi,

    I create a 'hello world' dll x64 activex project using VS2017 C#,and create a html demo file. 

    if I open as IE load the html demo file,it  worked well.

    if I open as IE press F12(IE11 F12 Developer Tools) To debug the html demo file,it don't work.

    os:Microsoft Windows [Version 10.0.18363.535] , win10 pro 64bit.



    vs2017 pro version 15.9.1

    source code:


    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Runtime.InteropServices;
    namespace ClassLibrary1
        public class Class1
            public String SayHello()
                return "helloworld";

    <?xml version="1.0" encoding="utf-8"?>
    <Project ToolsVersion="15.0" xmlns="/////////////////////">
      <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
        <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
        <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
      <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
      <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
        <Reference Include="System" />
        <Reference Include="System.Core" />
        <Reference Include="System.Xml.Linq" />
        <Reference Include="System.Data.DataSetExtensions" />
        <Reference Include="Microsoft.CSharp" />
        <Reference Include="System.Data" />
        <Reference Include="System.Xml" />
        <Compile Include="Class1.cs" />
        <Compile Include="Properties\AssemblyInfo.cs" />
        <None Include="miyao.pfx" />
      <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />





              <title>DemoCSharpActiveX webpage</title>


           <OBJECT id="DemoActiveX" classid="clsid:731632A9-05F4-4B8E-A34E-BCA8168843B9"></OBJECT>   


            <script type="text/javascript">

                try {
    var obj = document.DemoActiveX
                    if (obj) {


                    } else {

                        alert("Object is not created!");


                } catch (ex) {

                    alert("Some error happens, error message is: " + ex.Description);







    register dll:

    c:\Windows\Microsoft.NET\Framework64\v4.0.30319\regasm.exe /register /codebase "C:\Users\Dell\Desktop\ClassLibrary1\ClassLibrary1\bin\Debug\ClassLibrary1.dll"

    Windows Registry Editor Version 5.00

    [HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main]



    NOT Press F12:

    Press F12 To Debug HTML Code:


    1.Run IE

    2.press F12

    3.F12 Develop Tools says "Object doesn't support property or method 'SayHello'". it indecates that the activex Object load failed.

    then I suspect this is Microsoft's  bug. What do you think of the problem? If it's a problem with my code, how do I fix it? 
    • Edited by vczxh Sunday, December 29, 2019 10:55 AM
    • Moved by CoolDadTx Monday, December 30, 2019 2:57 PM ASP.NET related
    Sunday, December 29, 2019 10:49 AM

All replies

  • Hi vczxh,

    Thank you for posting here.

     I have some questions want to confirm.

    1. Is this an ordinary class library project? How does it relate to html files?

    2. You showed the csproj file. Did you modify it?

    I encountered this problem for the first time, so I need more information to reproduce this problem.

    Please tell me how to do it.

    Looking forward to your reply.

    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, December 30, 2019 3:20 AM
  • 1.

    register dll:

    c:\Windows\Microsoft.NET\Framework64\v4.0.30319\regasm.exe /register /codebase "C:\Users\Dell\Desktop\ClassLibrary1\ClassLibrary1\bin\Debug\ClassLibrary1.dll"


    Windows Registry Editor Version 5.00

    [HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main]

    2.I refer to this web page :


    Monday, December 30, 2019 7:27 AM
  • You already asked this questions once. As said before, please post questions related to web development in the ASP.NET forums.

    Michael Taylor http://www.michaeltaylorp3.net

    Monday, December 30, 2019 2:57 PM