December 6, 2011 at 1:28 pm
Hi,
I would like to run a console application (vb code written on visual studio) by creating a CmdExec in SQL Server Agent.
According to the tutorial http://www.sqlservercentral.com/articles/Stairway+Series/72459/
It works when I typed in "dir c:\" for the command.
But how can I execute my console application?
Path => C:\Code\Nota 2011\Nota-Unit-3\Nota\ConsoleOutlookIntegration
File name => Module1.vb
Project name => ConsoleOutlookIntegration.vbproj
Thanks in advance,
December 6, 2011 at 1:55 pm
Compile the console app. Then just type in your executable name and path instead of "dir c:\" for the command.
December 6, 2011 at 1:57 pm
You do not run your VB project - you need a Deployment Project that will reference primary output of your VB project. (There are walkthroughs for that.)
Then you buld your deployment project, which will result in a pair of msi/exe installer files. Use either of these to deploy your project to a directory accessible to SQLS, and reference the deployed executable.
Good luck!
December 6, 2011 at 1:59 pm
I forgot to mention that before you build your project for deployment, you ought to make sure that you build a Release version. (Not Debug.)
December 6, 2011 at 4:50 pm
Thank you. I'll try tomorrow and let you know 🙂
December 7, 2011 at 11:14 am
http://msdn.microsoft.com/en-us/library/fyh6k4k4.aspx
Is this the walk through link I have to follow?
December 7, 2011 at 12:14 pm
Yes, that is a good start.
If you run into a problem, I am here.
December 7, 2011 at 12:57 pm
I got an error when I want to add job step in the SQL Server Agent.
- I selected "Operating System (CmdExec)" type.
- In the textbox for command, I typed in path and file name.
"C:\Program Files (x86)\Microsoft\ConsoleOutlookIntegration_DeploymentProject\ConsoleOutlookIntegration.exe"
When I run this job, I got an error saying as follow..
Executed as user: XXX\User1. The process could not be created for step 1 of job 0x05711F5BB33E1F47B4724AE6B841E29E (reason: The system cannot find the file specified). The step failed.
What can I do to solve this?
Thanks again
December 7, 2011 at 1:16 pm
This looks like permissions problem.
Please make sure that the SQLS Engine has access rights to the respective directory.
BTW, typically SQLS jobs are deployed into a separate directory, not into Program Files. You give SQLS access to that directory and whenever you create one underneath it for a particular project, it inherits the permissions.
December 14, 2016 at 1:56 pm
I am experiencing the same issue but with EPPLUS any ideas?
Thanks
Message
Executed as user: WIN2016-SFD-02\SYSTEM. Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'EPPlus, Version=4.1.0.0, Culture=neutral, PublicKeyToken=ea159fdaa78159a1' or one of its dependencies. The system cannot find the file specified. at OracletoExcel.Program.Main(String[] args). Process Exit Code -532462766. The step failed.
December 14, 2016 at 3:08 pm
richard.tinkler (12/14/2016)
I am experiencing the same issue but with EPPLUS any ideas?Thanks
Message
Executed as user: WIN2016-SFD-02\SYSTEM. Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'EPPlus, Version=4.1.0.0, Culture=neutral, PublicKeyToken=ea159fdaa78159a1' or one of its dependencies. The system cannot find the file specified. at OracletoExcel.Program.Main(String[] args). Process Exit Code -532462766. The step failed.
Unfortunately this is a five year old thread so you would want to create a new post for this. It's also different errors.
The Exit code I believe is just a generic error message for .Net code with unhandled exception.
Could not load file or assembly or one of it's dependencies has many different reasons. You could start going through the list of possible solutions at:
Sue
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply