<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.iis.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:cs="http://blogs.iis.net/"><channel><title>IIS 7 - ASP.NET Administration</title><link>http://forums.iis.net/1051.aspx</link><description>Forum for getting answers to managing ASP.NET 1.1 or 2.0 on IIS 7</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Asp.net and third party unmanaged dll</title><link>http://forums.iis.net/thread/1888099.aspx</link><pubDate>Sat, 20 Dec 2008 09:59:17 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1888099</guid><dc:creator>jabbari</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1888099.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1051&amp;PostID=1888099</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;&lt;span class="Apple-style-span" style="WORD-SPACING:0px;FONT:12px Tahoma;TEXT-TRANSFORM:none;TEXT-INDENT:0px;LETTER-SPACING:normal;BORDER-COLLAPSE:separate;orphans:2;widows:2;webkit-border-horizontal-spacing:0px;webkit-border-vertical-spacing:0px;webkit-text-decorations-in-effect:none;webkit-text-size-adjust:auto;webkit-text-stroke-width:0;"&gt;Hello Mr.Nelson I have same problem. I want to import a dll in asp.net, and I have a major problem&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="Apple-style-span" style="WORD-SPACING:0px;FONT:12px Tahoma;TEXT-TRANSFORM:none;TEXT-INDENT:0px;LETTER-SPACING:normal;BORDER-COLLAPSE:separate;orphans:2;widows:2;webkit-border-horizontal-spacing:0px;webkit-border-vertical-spacing:0px;webkit-text-decorations-in-effect:none;webkit-text-size-adjust:auto;webkit-text-stroke-width:0;"&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;First i want to say that this dll works fine in a windows application written in C#, and It works fine when I use the ASP.NET development server (Local machine). &lt;/p&gt;
&lt;p&gt;But when I run the this code in Local host ( I upload it to my webserver ) ,asp.net know its Functions, but dont return anything or return wrong output adn return true output for sometimes.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Can it be something with the security rights the IIS has? or Web.config? or my way to Import? &lt;/p&gt;
&lt;p&gt;---------------------------------------------- &lt;/p&gt;
&lt;p&gt;for Example this Function code is: &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;[DllImport(&amp;quot;mydll.dll&amp;quot;)] &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;public static extern int GetTotal();&lt;/strong&gt; &lt;/p&gt;
&lt;p&gt;and when i call that ( in localhost )... &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Response.Write( GetTotal().ToString() );&lt;/strong&gt; &lt;/p&gt;
&lt;p&gt;Output is: &amp;quot;-&lt;strong&gt;1&lt;/strong&gt;&amp;quot; But when i use the ASP.NET development server (Local machine) It works fine, and Output is: &amp;quot;&lt;strong&gt;67&lt;/strong&gt;&amp;quot; &lt;/p&gt;
&lt;p&gt;---------------------------------------------------- &lt;/p&gt;
&lt;p&gt;this Function works true in both ( Localhost and LocalMachine ):&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;nbsp;[DllImport(&amp;quot;mydll.dll&amp;quot;)] &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;public static extern string ErrorDescription(int errorcode);&lt;/strong&gt; &lt;/p&gt;
&lt;p&gt;and when i call that ... &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Response.Write( ErrorDescription(3) );&lt;/strong&gt; &lt;/p&gt;
&lt;p&gt;output in Localhost and Localmachine is : &amp;quot;&lt;strong&gt;invalid Account&lt;/strong&gt;&amp;quot; !! therefore it works file in both.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;-------------------------------------------------------- &lt;/p&gt;
&lt;p&gt;this Function don&amp;#39;t return anything in local host : &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;[DllImport(&amp;quot;mydll.dll&amp;quot;)] &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;public static extern string ServerGet(int index);&lt;/strong&gt; &lt;/p&gt;
&lt;p&gt;and when i call that ... &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Response.Write( ServerGet(1) );&lt;/strong&gt; &lt;/p&gt;
&lt;p&gt;output in Localhost is &lt;strong&gt;empty&lt;/strong&gt;! but in local machine output is : &amp;quot;&lt;strong&gt;219.39.43.34:244&lt;/strong&gt;&amp;quot; &lt;/p&gt;
&lt;p&gt;------------------------------------------------------- &lt;/p&gt;
&lt;p&gt;i sure that Asp.net know this DLL well, and if its not so Asp.net show error for me but dont work fine! but don&amp;#39;t work true. do you know any solution for me? &lt;/p&gt;
&lt;p&gt;Can it be something with the IIS permissions? &lt;/p&gt;</description></item><item><title>Re: Asp.net and third party unmanaged dll</title><link>http://forums.iis.net/thread/1886779.aspx</link><pubDate>Thu, 04 Dec 2008 21:31:53 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1886779</guid><dc:creator>anilr</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1886779.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1051&amp;PostID=1886779</wfw:commentRss><description>&lt;p&gt;Are you calling the native functions using PInvoke/DllImport or using COM interop - you have probably not attributed the string parameters for the native functions correctly and CLR is probably treating them as BSTRs rather than PCWSTR (or vice-versa) - in any case, this has nothing to do with IIS and is really a .Net framework question - see &lt;a class="" href="http://msdn.microsoft.com/en-us/library/ms235282.aspx" target="_blank"&gt;this&lt;/a&gt; link for more documentation on how to call native functions from managed code.&lt;/p&gt;</description></item><item><title>Re: Asp.net and third party unmanaged dll</title><link>http://forums.iis.net/thread/1886733.aspx</link><pubDate>Thu, 04 Dec 2008 14:12:47 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1886733</guid><dc:creator>HFadeel</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1886733.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1051&amp;PostID=1886733</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;I have also the same problem, I try to use unmanage dll. and the IIS terminated in same cases.&lt;/p&gt;&lt;p&gt;When the dll function try to return string (heap beasd type - Reference type ) but it work if I call function that return int.&lt;/p&gt;&lt;p&gt;&amp;nbsp;With me the IIS terminated without any news, and it write almost the same in the Event Log.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Can Anyone tell me Where is the problem and how I can fix it? &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Asp.net and third party unmanaged dll</title><link>http://forums.iis.net/thread/1879593.aspx</link><pubDate>Wed, 17 Sep 2008 13:02:09 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1879593</guid><dc:creator>hbaradi</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1879593.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1051&amp;PostID=1879593</wfw:commentRss><description>&lt;p&gt;Hi Nelson,&lt;/p&gt;&lt;p&gt;Thanks for your answer.&lt;/p&gt;&lt;p&gt;We decide to produre an other dll using c++ marshalling, and i think it will usabale directly in .net code.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Best regards, &lt;br /&gt;&lt;/p&gt;&lt;p&gt;Baradi &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Asp.net and third party unmanaged dll</title><link>http://forums.iis.net/thread/1879582.aspx</link><pubDate>Wed, 17 Sep 2008 10:59:55 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1879582</guid><dc:creator>nrussa</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1879582.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1051&amp;PostID=1879582</wfw:commentRss><description>&lt;p&gt;Hi hbaradi,&lt;/p&gt;&lt;p&gt;nope, unfortunally didn&amp;#39;t find any solution.&lt;/p&gt;&lt;p&gt;Its probably related with third party dll code that&amp;#39;s hanging.&lt;/p&gt;&lt;p&gt;We decided not to go to Vista with current application version and we have on our development task to do ourself one component in .net that do the same as that third party.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Best regards,&lt;/p&gt;&lt;p&gt;Nelson R&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Asp.net and third party unmanaged dll</title><link>http://forums.iis.net/thread/1879575.aspx</link><pubDate>Wed, 17 Sep 2008 09:29:11 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1879575</guid><dc:creator>hbaradi</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1879575.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1051&amp;PostID=1879575</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;HI gays,&lt;/p&gt;&lt;p&gt;I have the some problem. &lt;/p&gt;&lt;p&gt;&amp;nbsp;did you found a solution ?&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thanks&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Baradi &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Asp.net and third party unmanaged dll</title><link>http://forums.iis.net/thread/1863671.aspx</link><pubDate>Thu, 14 Feb 2008 14:59:56 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1863671</guid><dc:creator>nrussa</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1863671.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1051&amp;PostID=1863671</wfw:commentRss><description>&lt;p&gt;Greetings,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;still trying to solve this problem. &lt;/p&gt;
&lt;p&gt;Can somebody point me to some kind of steps needed to use&amp;nbsp;third party&amp;nbsp;DLLs in asp.net with IIS7?&lt;/p&gt;
&lt;p&gt;Where to configure on IIS, what kind of user must have access or any other information that may help...&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve&amp;nbsp;checked lot of different places, but none solve it. Maybe I&amp;#39;m missing some kind of configuration.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Should I wait for Vista SP1?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Nelson R.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Asp.net and third party unmanaged dll</title><link>http://forums.iis.net/thread/1863224.aspx</link><pubDate>Wed, 06 Feb 2008 09:39:09 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1863224</guid><dc:creator>nrussa</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1863224.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1051&amp;PostID=1863224</wfw:commentRss><description>&lt;p&gt;Hi anilr,&lt;/p&gt;&lt;p&gt;using DebugDiag 1.1 (x86), I run it and select the default values:&lt;/p&gt;&lt;p&gt;Rule type: crash&lt;br /&gt;Target Type: All IIS/COM+ related processes&lt;br /&gt;Advanced Configuration: (just pressing next)&lt;br /&gt;Select dump location...: (just pressing next)&lt;br /&gt;Rule completed: Activate the rule now&lt;br /&gt;Finish&lt;br /&gt;&lt;br /&gt;Then I open my webpage and it crashes when accessing the third party dll method (as usual). &lt;br /&gt;I check on DebugDiag rule &amp;quot;Userdump Count&amp;quot; and its 0.&lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;br /&gt;My website isn&amp;#39;t doing anything special, it just uses dllimport to define a method and calls that method.&lt;/p&gt;&lt;p&gt;I&amp;#39;m using a third party dll, so I don&amp;#39;t think it has anything to do with code. I still think its related with security accessing unmanaged dll methods.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Using the exactly same code with the same dll&amp;#39;s works on winforms (and it works on other versions of IIS).&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;-- EDIT --&lt;br /&gt;I&amp;#39;ve noticed a news today &amp;quot;IIS7 is finished&amp;quot;, on 4 Feb. Does that means Vista is using an unfinished version of IIS 7?&lt;br /&gt;On IIS Help/About I&amp;#39;m using version 7.0.6000.16386.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thanks once again,&lt;br /&gt;&amp;nbsp;&amp;nbsp; Nelson R.&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Asp.net and third party unmanaged dll</title><link>http://forums.iis.net/thread/1863097.aspx</link><pubDate>Mon, 04 Feb 2008 19:04:16 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1863097</guid><dc:creator>anilr</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1863097.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1051&amp;PostID=1863097</wfw:commentRss><description>&lt;p&gt;That status code is STATUS_HEAP_CORRUPTION - you will need to debug through the heap usage in your code - using appverifier&amp;#39;s pageheap option can help you with debugging heap related bugs.&lt;/p&gt;</description></item><item><title>Re: Asp.net and third party unmanaged dll</title><link>http://forums.iis.net/thread/1863095.aspx</link><pubDate>Mon, 04 Feb 2008 18:46:07 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1863095</guid><dc:creator>nrussa</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1863095.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1051&amp;PostID=1863095</wfw:commentRss><description>&lt;p&gt;Hi anilr,&lt;br /&gt;thanks for your response.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve tried using DebugDiag but couldn&amp;#39;t find the source of the problem. Ill try checking it again.&lt;/p&gt;
&lt;p&gt;On &amp;quot;Problem Reports and Solutions&amp;quot; there are lots of errors on IIS Worker Process. &lt;/p&gt;
&lt;p&gt;For the latest one (can&amp;#39;t&amp;nbsp;get any useful information from it):&lt;/p&gt;
&lt;p&gt;Problem signature&lt;br /&gt;Problem Event Name:&amp;nbsp;APPCRASH&lt;br /&gt;Application Name:&amp;nbsp;w3wp.exe&lt;br /&gt;Application Version:&amp;nbsp;7.0.6000.16386&lt;br /&gt;Application Timestamp:&amp;nbsp;4549b5f8&lt;br /&gt;Fault Module Name:&amp;nbsp;StackHash_97ff&lt;br /&gt;Fault Module Version:&amp;nbsp;6.0.6000.16386&lt;br /&gt;Fault Module Timestamp:&amp;nbsp;4549bdc9&lt;br /&gt;Exception Code:&amp;nbsp;c0000374&lt;br /&gt;Exception Offset:&amp;nbsp;000af1c9&lt;br /&gt;OS Version:&amp;nbsp;6.0.6000.2.0.0.256.6&lt;br /&gt;Locale ID:&amp;nbsp;2070&lt;br /&gt;Additional Information 1:&amp;nbsp;97ff&lt;br /&gt;Additional Information 2:&amp;nbsp;6c327e2c6eabfed95d5a52c2fb78e173&lt;br /&gt;Additional Information 3:&amp;nbsp;5935&lt;br /&gt;Additional Information 4:&amp;nbsp;6542d178cca9e73635c31368e00b0030&lt;/p&gt;
&lt;p&gt;Extra information about the problem&lt;br /&gt;Bucket ID:&amp;nbsp;640949741&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Is there anything special we must do when using an unmanaged third party dll on aspnet? Any option that I maybe missing?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;br /&gt;&amp;nbsp; Nelson R.&lt;/p&gt;</description></item><item><title>Re: Asp.net and third party unmanaged dll</title><link>http://forums.iis.net/thread/1863089.aspx</link><pubDate>Mon, 04 Feb 2008 17:59:24 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1863089</guid><dc:creator>anilr</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1863089.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1051&amp;PostID=1863089</wfw:commentRss><description>&lt;p&gt;Use debugdiag or debugger tools for windows to collect crash dump for the problem - it may already be available if you go to control panel -&amp;gt; report problems and solutions - the crash dump will give more idea on what is the problem here.&lt;/p&gt;</description></item><item><title>Asp.net and third party unmanaged dll</title><link>http://forums.iis.net/thread/1863053.aspx</link><pubDate>Mon, 04 Feb 2008 10:45:54 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1863053</guid><dc:creator>nrussa</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1863053.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1051&amp;PostID=1863053</wfw:commentRss><description>&lt;p&gt;Greetings,&lt;br /&gt;&lt;br /&gt;I have an asp.net/C# application that uses third party dll to get some system information (get a unique machine id).&lt;br /&gt;&lt;br /&gt;It works well on XP, 2000 and 2003, but when tried on Vista, IIS hangs when accessing dll methods (&lt;i&gt;IIS Worker Process stopped working and was closed&lt;/i&gt;).&lt;br /&gt;&lt;br /&gt;I tried different approaches to solve this problem but I&amp;#39;m stuck without anymore ideas to try.&lt;br /&gt;&lt;br /&gt;I know asp.net is finding the dll (if I rename it, it shows an error of file not found), so I think it has to do with security.&lt;br /&gt;&lt;br /&gt;I tried to impersonate (in web.config file), giving full access on file properties to IIS_IUSRS group, .NET Trust level to full, moving project to inetpub\wwwroot folder and some other tries.&lt;br /&gt;&lt;br /&gt;If I use the dll on a winform application, it works great.&lt;br /&gt;&lt;br /&gt;I&amp;#39;ve done a little dll on vc6 and it also works great on aspnet.&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Checking event viewer, on Application tab, I can see this error about IIS process crash:&lt;br /&gt;&amp;quot;&lt;i&gt;Faulting application w3wp.exe, version 7.0.6000.16386, time stamp 0x4549b5f8, faulting module ntdll.dll, version 6.0.6000.16386, time stamp 0x4549bdc9, exception code 0xc0000374, fault offset 0x000af1c9, process id 0x1614, application start time 0x01c867115fc5d8a0.&lt;/i&gt;&amp;quot;&lt;/p&gt;&lt;p&gt;On System tab:&lt;br /&gt;&amp;quot;&lt;i&gt;A process serving application pool &amp;#39;DefaultAppPool&amp;#39; suffered a fatal communication error with the Windows Process Activation Service. The process id was &amp;#39;3832&amp;#39;. The data field contains the error number.&lt;/i&gt;&amp;quot;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Hope someone can shed some light on this subject, since I must be missing something very basic.&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;Nelson R&amp;nbsp; &lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>