This is a migrated thread and some comments may be shown as answers.

Execute batch file from network

2 Answers 106 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Adriane
Top achievements
Rank 1
Adriane asked on 30 Apr 2012, 03:07 PM
Hi,

I want to execute a batch file (from network) in a Code Scripted Step like this:

Process prc = new Process();

            prc.StartInfo.FileName = @"W:\QA\copyTestFileToFolder.bat";

            prc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;

            prc.Start();

            prc.WaitForExit();

            prc.Close();


I got the following message:
'30.04.2012 15:44:12' - System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.   at System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence)   at System.Reflection.Assembly.LoadFile(String path)   at ArtOfTest.WebAii.Design.Execution.ExecutionUtils.EnsureAssemblyExists(String assembly, String folder)   at ArtOfTest.WebAii.Design.Execution.ExecutionUtils.CreateCodedTestInstance(Test test, TestResult result, String binariesFolder)   at ArtOfTest.WebAii.Design.Execution.ExecutionEngine.InternalExecuteTest(Test test, TestResult initializationResult)   at ArtOfTest.WebAii.Design.Execution.TestExecuteProxy.ExecuteTest(ExecuteTestCommand command)

We need to run the tests under cruise Control and automatic. So we need the code to be on the network share.
What do I have to do, to give the access?

Regards,
Adriane

2 Answers, 1 is accepted

Sort by
0
Accepted
Anthony
Telerik team
answered on 30 Apr 2012, 05:58 PM
Hello Adriane,

See here for our troubleshooting guide article on that error.

Greetings,
Anthony
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Adriane
Top achievements
Rank 1
answered on 02 May 2012, 09:30 AM
Thanks, that helps :)
Tags
General Discussions
Asked by
Adriane
Top achievements
Rank 1
Answers by
Anthony
Telerik team
Adriane
Top achievements
Rank 1
Share this question
or