Click here to Skip to main content
12,887,625 members (36,988 online)
Rate this:
Please Sign up or sign in to vote.
See more: ASP.NET PHP
Hello everyone!

I want to call a .Net method through a scheduler.
This scheduler provided by the web host can run php scripts.

So now, I need to call the .Net method MyMethod() of Class MyClass belonging to namespace MyNamespace everyday at 00:00 hrs.

This can be possible if it is called from a php script scheduled to be run by the scheduler.

I have added a php script as follows to call the method. But cant see any result.
Please check if correct. And point out the mistakes.

$Obj = new COM ('MyNamespace.MyClass');

Please help.
Posted 9-Nov-12 2:03am
Updated 9-Nov-12 2:29am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I'm not exactly sure what the issue is, but you can check what you've done against the following guide:[^]

Failing that, you might also want to take a look at:[^]

You create the key file on your development machine and sign the project with it. You'd have to ask your web host if you can deploy something to the GAC - they might be iffy with this, but maybe there is another solution - if you need to call a .net method from a scheduler, could you not do this with powershell?[^]
Tech Code Freak 9-Nov-12 8:35am
Saw the 1st link. Good one. It is what I wanted. But now, I dont know:
1. How to create a Key File on my web Host's server.
2. How to add the assembly file to my web host's GAC.
How do you do it??

Or is there any other way out?
jim lahey 9-Nov-12 8:38am
See updated answer.
Tech Code Freak 9-Nov-12 8:42am
Sorry, Not familiar with Powershell.
Would try to learn something about Powershell now.
Can we call ASP.Net methods directly from powershell without GAC entry?
jim lahey 9-Nov-12 8:55am
Yes you can. You can load the assembly straight from disk. I've updated the answer with a link.
Tech Code Freak 10-Nov-12 10:30am
Accepted + 5up
Tech Code Freak 10-Nov-12 10:41am
Your answer helped a lot!
Perfect one for through PHP.

But as the hosts don't give access to gac to add assembly file, PHP was hard to get going.

PowerShell too was out of reach.

So, I used vbscript for the same and guess what?
It's working!

The resolution to the problem is no doubt different from your answer but still, it was very helpful in the research.

Thanks again!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170424.1 | Last Updated 9 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100