Converting web application directly from asp.net framework 1.1 to 4.0
<p>I have converted an asp.net web application directly from asp.net 1.1 framework to asp.net 4.0 framework. It uses a third party dll which uses get and set properties to set the host and port.
Syntax- object.set_host(server_ip)
When this function within the dll is called it does not set the host as it causes some error and it returns 0.
This works fine in 1.1 framework but not in 4.0, is this a conversion issue.
How can a solve this error, please help me as this is an urgent issue?</p>

<p>Somehow I have decompiled the code  and the function in the dll to set host is :-</p>

<pre><code>public string Host
{
    get
    {
        int num2 = (int) stackalloc byte[__CxxQueryExceptionSize()];  
        try  
        {  
            ushort* numPtr;  
            SysFreeString(this.bstrPrevHost);  
            IClient* clientPtr =  _com_ptr_t&lt;_com_IIID&lt;XXCLIENTXLib::IClient,&amp;_GUID_1b8c366c_3d10_4b9f_b4c9_79a73ffd22df&gt; &gt;.-&gt;((_com_ptr_t&lt;_com_IIID&lt;XXCLIENTXLib::IClient,&amp;_GUID_1b8c366c_3d10_4b9f_b4c9_79a73ffd22df&gt; &gt; modopt(IsConstModifier)* modopt(IsConstModifier) modopt(IsConstModifier)) this.pNative);  
            if (**(((int*) clientPtr))[0x1c](clientPtr, &amp;numPtr) &gt;= 0)  
            {  
                this.bstrPrevHost = numPtr;  
                return new string((char*) numPtr);  
            }  
        }  
        catch when (?)  
        {  
            uint num = 0;  
            __CxxRegisterExceptionObject((void*) Marshal.GetExceptionPointers(), (void*) num2);  
            try  
            {  
                try  
                {  
                    goto Label_008E;  
                }  
                catch when (?)  
                {  
                }  
                if (num != 0)  
                {  
                    throw;  
                }  
            }  
            finally  
            {  
                __CxxUnregisterExceptionObject((void*) num2, (int) num);  
            }  
        }  
    Label_008E:  
        return null;  
    }  
    set  
    {  
        int num2 = (int) stackalloc byte[__CxxQueryExceptionSize()];  
        try  
        {  
            UMString str;  
            UMString.__ctor(&amp;str, value);  
            try  
            {  
                int num4;  
                _bstr_t _t;  
                _bstr_t* _tPtr = _bstr_t.__ctor(&amp;_t, std.basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt;.c_str((basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; modopt(IsConstModifier)* modopt(IsConstModifier) modopt(IsConstModifier)) &amp;str));  
                try  
                {  
                    IClient* clientPtr = _com_ptr_t&lt;_com_IIID&lt;XXCLIENTXLib::IClient,&amp;_GUID_1b8c366c_3d10_4b9f_b4c9_79a73ffd22df&gt; &gt;.-&gt;((_com_ptr_t&lt;_com_IIID&lt;XXCLIENTXLib::IClient,&amp;_GUID_1b8c366c_3d10_4b9f_b4c9_79a73ffd22df&gt; &gt; modopt(IsConstModifier)* modopt(IsConstModifier) modopt(IsConstModifier)) this.pNative);  
                    num4 = **(((int*) clientPtr))[0x20](clientPtr, _bstr_t..PAG((_bstr_t modopt(IsConstModifier)* modopt(IsConstModifier) modopt(IsConstModifier)) _tPtr));  
                }  
                fault  
                {  
                    __CxxCallUnwindDtor((void modopt(CallConvThiscall) *(void*)) __unep@??1_bstr_t@@$$FQAE@XZ, (void*) &amp;_t);  
                }  
                _bstr_t.__dtor(&amp;_t);  
                if (num4 &lt; 0)  
                {  
                    goto Label_007C;  
                }  
            }  
            fault  
            {  
                __CxxCallUnwindDtor((void modopt(CallConvThiscall) *(void*)) __unep@??1UMString@@$$FQAE@XZ, (void*) &amp;str);  
            }  
            UMString.__dtor(&amp;str);  
            return 1;  
        Label_007C:  
            UMString.__dtor(&amp;str);  
        }  
        catch when (?)  
        {  
            uint num = 0;  
            __CxxRegisterExceptionObject((void*) Marshal.GetExceptionPointers(), (void*) num2);  
            try  
            {  
                try  
                {  
                    goto Label_00D0;  
                }  
                catch when (?)  
                {  
                }  
                if (num != 0)  
                {  
                    throw;  
                }  
            }  
            finally  
            {  
                __CxxUnregisterExceptionObject((void*) num2, (int) num);  
            }  
        }  
    Label_00D0:  
        return 0;  
    }  
}  
</code></pre>
