Use .DLLs in JSP/PHP (HTML)
I have Divided in three Parts- Download and Setup Microsoft .NET Framework 2.0 Configuration Setup
- Visual studio project (DLL)
- JSP Page (Caller of DLL)
Setup Microsoft .NET Framework 2.0 Configuration Setup
- Download
- Click Control Panel->Administrative Tool->Microsoft .NET Framework 2.0 Configuration
- Expand My Computer by clicking the plus sign(+).
- Now Expand Runtime Security Policy
- Now Expand Runtime Security Policy
- Now Expand Machine
- Now expand Code Groups
- Now expand All_Code
- Click LocalIntranet_Zone
- Click Edit Code Group Properties
- Click Permission Set
- From the drop down select FullTrust
- Then click Ok
- Open the Internet Explorer go to tools à options à security.
Visual Studio Project
1.
Create a project windows form class library
2.
Add References of all DLLs if used like (someexternal.dll)
3.
Build application and get DLLs from debug folder
a.
If multiple DLLs created use ILMerge.exe for
making it a single DLLs.
b.
Create .SNK file
c.
Put .SNK file in IL Merge Folder (C:\Program Files\Microsoft\ILMERGE)
d.
Put all DLLs in ILMERGE Folder
4.
Make signed DLLs either using sn.exe or use ILMERGE.
I preferred ILMERGE
a.
Commands to signed DLLs using ILMERGE:
i.
ilmerge /out:softPhone.dll
/keyfile:key.snk primary.dll
SecondryOrReferenced.dll log4net.dll
b.
Now your .Net application is ready for Java
Client, Copy DLLs from ILMERGE Folder and paste in tomcat server folder.
JSP Page
Make separate folder for DLLs.
Use Object tag
<OBJECT id="Merged"
classid="myDll.dll#myDllNamespace.UserControl1" width="100%">
OBJECT>
Take
care of name space for calling DLL main class
Now
run on IE your JSP will now run.Net Application
Steps to Remember:
1.
We have made usercontrol therefore we have to
call from a client there is no exe
2.
There is different path for for config file it
is better to use my Documents folder as it is a public folder
System.Environment.GetFolderPath(Environment.SpecialFolder.Personal) + "\\naushadlog.config")
3.
Dll must be signed
4.
Microsoft .NET Framework 2.0 Configuration must
be installed and configured.
5.
Verify signed DLLs in GAC using following
command
C:\Program Files\Microsoft Visual Studio
9.0\VC> gacutil /ldl
No comments:
Post a Comment