Sandbox error running old scripts under new version 2011.1.520.0

7 posts, 0 answers
  1. Clive
    Clive avatar
    21 posts
    Member since:
    Sep 2010

    Posted 23 May 2011 Link to this post

    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!

     

  2. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 23 May 2011 Link to this post

    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 >>

  3. Clive
    Clive avatar
    21 posts
    Member since:
    Sep 2010

    Posted 24 May 2011 Link to this post

    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
  4. Konstantin Petkov
    Admin
    Konstantin Petkov avatar
    1911 posts

    Posted 24 May 2011 Link to this post

    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 >>

  5. Clive
    Clive avatar
    21 posts
    Member since:
    Sep 2010

    Posted 25 May 2011 Link to this post

    Hi,
    I'm afraid that didn't work.
    Clive
  6. Daniel Djambov
    Admin
    Daniel Djambov avatar
    84 posts

    Posted 25 May 2011 Link to this post

    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 >>

  7. William
    William avatar
    1 posts
    Member since:
    Jul 2011

    Posted 24 Aug 2011 Link to this post

    @Daniel,

    Thanks, your solution works for me.

    Keep up the great support.

    -Wm
Back to Top