Difference between revisions of "User:Pgmurphy/PerlDotNet"
Jump to navigation
Jump to search
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | Based on http://www.perlmonks.org/?node_id=392275. | ||
+ | |||
# Create strong name key.<pre>sn -k <name>.snk</pre> | # Create strong name key.<pre>sn -k <name>.snk</pre> | ||
# Add strong name key to project. | # Add strong name key to project. | ||
Line 6: | Line 8: | ||
##* Change the path to the SN key to the central copy (<AssemblyOriginatorKeyFile>). | ##* Change the path to the SN key to the central copy (<AssemblyOriginatorKeyFile>). | ||
# Build project | # Build project | ||
− | # Register .dll<pre>gacutil /i <file>.dll</pre><pre>regasm <file>.dll</pre> | + | # Register .dll. Must be repeated every time the library is changed.<pre>gacutil /i <file>.dll</pre><pre>regasm <file>.dll</pre> |
# Call library in Perl | # Call library in Perl | ||
− | + | <pre>use Win32::OLE; | |
− | + | ||
− | + | $hello = new Win32::OLE('HelloDot.HelloWorld') or die $!; | |
+ | $hello->sayHello();</pre> |
Latest revision as of 15:28, 28 March 2007
Based on http://www.perlmonks.org/?node_id=392275.
- Create strong name key.
sn -k <name>.snk
- Add strong name key to project.
- Right click on the project in VS, choose Properties
- In Signing tab, enable signing and browse to .snk
- Close project and text edit the .csproj file.
- Change the path to the SN key to the central copy (<AssemblyOriginatorKeyFile>).
- Build project
- Register .dll. Must be repeated every time the library is changed.
gacutil /i <file>.dll
regasm <file>.dll
- Call library in Perl
use Win32::OLE; $hello = new Win32::OLE('HelloDot.HelloWorld') or die $!; $hello->sayHello();