<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Code in code stages should in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/compiler-error-at-line-0/m-p/88323#M38893</link>
    <description>Code in code stages should not include the method signature - it's generated automatically. Remove the signature and the corresponding { and } and it should work.
EDIT: And another thing, you don't return values in code stages - you assign out variables instead.</description>
    <pubDate>Fri, 10 Nov 2017 20:06:00 GMT</pubDate>
    <dc:creator>OlaNykvist</dc:creator>
    <dc:date>2017-11-10T20:06:00Z</dc:date>
    <item>
      <title>compiler error at line 0</title>
      <link>https://community.blueprism.com/t5/Product-Forum/compiler-error-at-line-0/m-p/88322#M38892</link>
      <description>Hi, We are trying to add code to create folder in sharepoint site. we have come up with a method which works perfectly fine in VS 2017. But when we add it to a code stage we are getting the below errors. Framework : 4.0 &amp;amp; Any CPU 

1) Compile error at line 0: } expected.
2) Compiler error at top section line 102: type or name space definition or end of file expected. 

Please find below the code which is in code stage


public string checkAndCreateFolder(string TargetPath,string FolderName, string UserName, string Password)
        {

            try
            {
                string returnstring="";
                Uri targetUri = new Uri(TargetPath);

                var sitePath = string.Format("{0}{1}{2}/{3}{4}", targetUri.Scheme, Uri.SchemeDelimiter, targetUri.Host, targetUri.Segments[1], targetUri.Segments[2]);

                var context = new ClientContext(targetUri);

                context.ExecutingWebRequest += ctx_ExecutingWebRequest;
                context.RequestTimeout = 3600000;

                // If the settings specify an user and password for the SP connection use them.
                if (!string.IsNullOrEmpty(UserName) &amp;amp;&amp;amp; !string.IsNullOrEmpty(Password))
                {
                    context.Credentials = new NetworkCredential(UserName, Password);
                }
                else
                {
                    context.Credentials = CredentialCache.DefaultCredentials;
                }

                context.ExecuteQuery();



                Folder test = context.Web.GetFolderByServerRelativeUrl("EngagementDocumentLibrary/"+FolderName);
                context.Load(test);

                try
                {
                    context.ExecuteQuery();
                    if (test.Name != null)
                    {
                        returnstring = "folder already exists";
                    }
                }
                catch (Exception ex)
                {
                    context.Web.Folders.Add("EngagementDocumentLibrary/" + FolderName);
                    context.ExecuteQuery();
                    returnstring =  "folder created Succesfully";
                }

                

                

                return returnstring;
            }
            catch (Exception ex)
            {
                throw ex;
            }

           

        }

        private void ctx_ExecutingWebRequest(object sender, WebRequestEventArgs e)
        {
            if (e != null)
            {
                e.WebRequestExecutor.WebRequest.Headers.Add("X-FORMS_BASED_AUTH_ACCEPTED", "f");
            }
        }</description>
      <pubDate>Fri, 10 Nov 2017 18:38:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/compiler-error-at-line-0/m-p/88322#M38892</guid>
      <dc:creator>SanjayKumar2</dc:creator>
      <dc:date>2017-11-10T18:38:00Z</dc:date>
    </item>
    <item>
      <title>Code in code stages should</title>
      <link>https://community.blueprism.com/t5/Product-Forum/compiler-error-at-line-0/m-p/88323#M38893</link>
      <description>Code in code stages should not include the method signature - it's generated automatically. Remove the signature and the corresponding { and } and it should work.
EDIT: And another thing, you don't return values in code stages - you assign out variables instead.</description>
      <pubDate>Fri, 10 Nov 2017 20:06:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/compiler-error-at-line-0/m-p/88323#M38893</guid>
      <dc:creator>OlaNykvist</dc:creator>
      <dc:date>2017-11-10T20:06:00Z</dc:date>
    </item>
    <item>
      <title>Thank you for the update it</title>
      <link>https://community.blueprism.com/t5/Product-Forum/compiler-error-at-line-0/m-p/88324#M38894</link>
      <description>Thank you for the update it worked.</description>
      <pubDate>Mon, 13 Nov 2017 10:41:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/compiler-error-at-line-0/m-p/88324#M38894</guid>
      <dc:creator>SanjayKumar2</dc:creator>
      <dc:date>2017-11-13T10:41:00Z</dc:date>
    </item>
    <item>
      <title>RE: Code in code stages should</title>
      <link>https://community.blueprism.com/t5/Product-Forum/compiler-error-at-line-0/m-p/88325#M38895</link>
      <description>&lt;P&gt;Hi ,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;There is an API which i need to get an access token but API body is &amp;nbsp;form data &amp;nbsp;so i created C# code which i getting below errors. Please find the attached screenshot and could you please help me ?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="23898.jpg"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/24035iD3D6B1E617A1068E/image-size/large?v=v2&amp;amp;px=999" role="button" title="23898.jpg" alt="23898.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Revathi A&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Sep 2023 08:33:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/compiler-error-at-line-0/m-p/88325#M38895</guid>
      <dc:creator>A.REVATHI</dc:creator>
      <dc:date>2023-09-27T08:33:00Z</dc:date>
    </item>
    <item>
      <title>RE: Code in code stages should</title>
      <link>https://community.blueprism.com/t5/Product-Forum/compiler-error-at-line-0/m-p/88326#M38896</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: Times New Roman, Times, serif;"&gt;Hello &lt;STRONG&gt;&lt;EM&gt;Hi Revathi A,&lt;/EM&gt;&lt;/STRONG&gt;,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: Times New Roman, Times, serif;"&gt;When debugging in the IDE does the problem occur or only in blueprism? Try refactoring and using the call with synchronization methods.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: Times New Roman, Times, serif;"&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: Times New Roman, Times, serif;"&gt;&amp;nbsp;Check, if it only occurs in BP, validate dependencies, and I would suggest carrying out debugging by blocks.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: Times New Roman, Times, serif;"&gt;Regards.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Leonardo Soares&lt;BR /&gt;RPA Developer Tech Leader&lt;BR /&gt;Bridge Consulting&lt;BR /&gt;América/Brazil&lt;BR /&gt;------------------------------&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Oct 2023 23:31:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/compiler-error-at-line-0/m-p/88326#M38896</guid>
      <dc:creator>LeonardoSQueiroz</dc:creator>
      <dc:date>2023-10-02T23:31:00Z</dc:date>
    </item>
  </channel>
</rss>

