Bug #55847 [Ver->Csd]: DOTNET .NET 4.0 GAC new location

From: Date: Sat, 22 Aug 2020 10:42:41 +0000
Subject: Bug #55847 [Ver->Csd]: DOTNET .NET 4.0 GAC new location
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-228709@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=55847&edit=1

 ID:                 55847
 Updated by:         cmb@php.net
 Reported by:        cosmin dot nicula at gmail dot com
 Summary:            DOTNET .NET 4.0 GAC new location
-Status:             Verified
+Status:             Closed
 Type:               Bug
 Package:            COM related
 Operating System:   Windows XP SP3
 PHP Version:        5.3.8
 Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=e6044d4455d7fbaced7f3a6ac28172d963017e51
Log: Fix #55847: DOTNET .NET 4.0 GAC new location


Previous Comments:
------------------------------------------------------------------------
[2020-08-06 17:07:43] cmb@php.net

The following pull request has been associated:

Patch Name: Fix #55847: DOTNET .NET 4.0 GAC new location
On GitHub:  https://github.com/php/php-src/pull/5949
Patch:      https://github.com/php/php-src/pull/5949.patch

------------------------------------------------------------------------
[2020-08-06 17:05:37] cmb@php.net

> Hmm, regasm and using COM instead of DOTNET may be likely
> workaround to solve CLR version issue.

Indeed, a viable workaround.

> com.dotnet_runtime = "v4.0.30319" ; in php.ini

I think an INI setting would be the best solution, because it
might be impossible to detect which version to use.

------------------------------------------------------------------------
[2013-02-19 11:20:34] user at kkdf2 dot sakura dot ne dot jp

I'v tested regasm.

The class library built on .NET 4.0 can be loaded and accessed via "new COM".

Also it seems that .NET runtime 2.0 and 4.0 can work separately in one process memory.

t.php
---
<?php

$v20 = new COM("ClassLibrary1.Class1");
print $v20->Hello();
print "\n";

$v40 = new COM("ClassLibrary40.Class1");
print $v40->Hello();
print "\n";

?>
---

Output of t.php
---
Hello from v2.0.50727 with System.String, mscorlib, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089
Hello from v4.0.30319 with System.String, mscorlib, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089
---

Class1.cs in ClassLibrary1(.NET 3.5)
---
using System;
using System.Runtime.InteropServices;

namespace ClassLibrary1 {
    [ComVisible(true), Guid("ddfe022c-eaf7-4a6a-9429-0f1846af7be7")]
    public class Class1 {
        public string Hello() { return "Hello from " +
System.Reflection.Assembly.GetExecutingAssembly().ImageRuntimeVersion + " with " +
typeof(String).AssemblyQualifiedName; }
    }
}
---

Class1.cs in ClassLibrary40(.NET 4.0)
---
using System;
using System.Runtime.InteropServices;

namespace ClassLibrary40 {
    [ComVisible(true), Guid("ebd2758d-96b9-4b20-afaa-d67c2c99998f")]
    public class Class1 {
        public string Hello() { return "Hello from " +
System.Reflection.Assembly.GetExecutingAssembly().ImageRuntimeVersion + " with " +
typeof(String).AssemblyQualifiedName; }
    }
}
---

------------------------------------------------------------------------
[2013-02-18 12:34:15] user at kkdf2 dot sakura dot ne dot jp

Hmm, regasm and using COM instead of DOTNET may be likely workaround to solve CLR version issue.
Check the note at dotnet_load function:
http://www.php.net/manual/en/function.dotnet-load.php

------------------------------------------------------------------------
[2013-02-17 13:59:39] user at kkdf2 dot sakura dot ne dot jp

Is it a problem on php settings, or need an extension to php dotnet?

If it is as a new feature, 
how about access to the newer .NET runtime?

new DOTNET4("...")

or

com.dotnet_runtime = "v4.0.30319" ; in php.ini

new DOTNET("...")

Have a good idea?

Thanks

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=55847


--
Edit this bug report at https://bugs.php.net/bug.php?id=55847&edit=1


Thread (7 messages)

« previous php.bugs (#228709) next »