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

Sandbox error running old scripts under new version 2011.1.520.0

6 Answers 276 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Clive
Top achievements
Rank 1
Clive asked on 23 May 2011, 04:41 PM
Hi,
I've downloaded the trial version of 2011.1.520.0 in order try and fix another problem, but now when I run some of my existing scripts I get the error below. I recorded a new script almost identical to the existing ones and that seems fine. I hope I don't have to recreate my entire project...
Thanks
Clive

------------------------------------------------------------
'23/05/2011 15:48:13' - Starting execution....
'23/05/2011 15:48:18' - Detected custom code in test. Locating test assembly: Nando_s_Success_Management_Smoke_Test.dll.
'23/05/2011 15:48:18' - Failure detected during execution. Details:
------------------------------------------------------------
'23/05/2011 15:48:18' - 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(Test test, Settings settings, String deploymentFolder, String binariesFolder, ExecutionType exeType, Guid firstStepGuid, Guid lastStepGuid, IntPtr existingBrowserHandle, DebuggerOptions debuggerOptions)
------------------------------------------------------------
'23/05/2011 15:48:20' - Test completed!

 

6 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 23 May 2011, 09:08 PM
Hi Clive,

.NET does not permit accessing DLL's from network locations. Please try copying the entire test project to a local folder and try again.

All the best,
Cody
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
Clive
Top achievements
Rank 1
answered on 24 May 2011, 04:50 PM
Hi,
I'll try moving the project to my local machine, but this isn't really a solution.
There are multiple testers here so our projects are all created and stored on our company server, not on our local machines.
This worked perfectly well until I loaded the the new release, so surely there's an answer to this other than working locally?

Clive
0
Konstantin Petkov
Telerik team
answered on 24 May 2011, 09:21 PM
Hello Clive,

Let's try changing the .Net framework Test Studio launches over. Look for the Telerik.TestStudio.exe.config file in the product installation Bin folder. Open that in a text editor and comment the line specifying the .Net v4.0:

<startup>
  <!--<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>-->
  <supportedRuntime version="v2.0.50727" sku=".NETFramework,Version=v3.5" />
</startup>

Does that help executing those tests from the project loaded remotely?

Kind regards,
Konstantin Petkov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
Clive
Top achievements
Rank 1
answered on 25 May 2011, 09:23 AM
Hi,
I'm afraid that didn't work.
Clive
0
Daniel Djambov
Telerik team
answered on 25 May 2011, 11:45 AM

Hi Clive,

This seems to be a new security change introduced in .Net Framework 4.0.

Good news is there is a solution: make sure to modify your ArtOfTest.Runner.exe.config file, located in Test Studio installation folder (by default C:\Program Files (x86)\Telerik\Test Studio 2011.1\Bin) looks like this:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
    <supportedRuntime version="v2.0.50727" sku=".NETFramework,Version=v3.5" />
  </startup>
  <appSettings>
    <add key="DisposeAppDomain" value="True"></add>
  </appSettings>

<runtime>
<loadFromRemoteSources enabled="true"/>
</runtime>

</configuration>

Basically you should add to your existing config the <loadFromRemoteSources enabled="true" parameter and it should work under .Net 4 only.

This should solve your .Net security issue with loading a .dll file from a shared network location.

Please give it a try and tell me if it works for you - it works at our side as described.

Kind regards,

Daniel Djambov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
William
Top achievements
Rank 1
answered on 24 Aug 2011, 04:49 PM
@Daniel,

Thanks, your solution works for me.

Keep up the great support.

-Wm
Tags
General Discussions
Asked by
Clive
Top achievements
Rank 1
Answers by
Cody
Telerik team
Clive
Top achievements
Rank 1
Konstantin Petkov
Telerik team
Daniel Djambov
Telerik team
William
Top achievements
Rank 1
Share this question
or