<?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 Re: Error in code stage : the out parameter  must be assigned to before control leaves the current method in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/Error-in-code-stage-the-out-parameter-must-be-assigned-to-before/m-p/101640#M48541</link>
    <description>Hello guys,&lt;BR /&gt;Thank you . I found the solution to the problem ..phew!!&lt;BR /&gt;I discovered that I had to assign &lt;EM&gt;&lt;STRONG&gt;InstanceFullFilePath&lt;/STRONG&gt;&lt;/EM&gt; in the Catch stage as seen in the modified code, typically what this means is any where the code exits all out parameters in the code stage must be assigned to something.... Phew! Great learning ... Thanks guys.&lt;BR /&gt;&lt;BR /&gt;
&lt;PRE class="language-csharp"&gt;&lt;CODE&gt;try {
errorMessage = "";
string InstanceFile = InstanceFileNameWithoutExtension+Path.GetExtension(TemplateFileNameWithExtension);
string templateFilePath = Path.Combine(TemplateDirectory,TemplateFileNameWithExtension);
InstanceFullFilePath = Path.Combine(InstanceDestinationFolderPath,InstanceFile);
File.Copy(templateFilePath,InstanceFullFilePath,true);


} catch (Exception ex) {
errorMessage = ex.Message;
InstanceFullFilePath = "";

}​&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 13 Jul 2022 00:03:54 GMT</pubDate>
    <dc:creator>DavidOku</dc:creator>
    <dc:date>2022-07-13T00:03:54Z</dc:date>
    <item>
      <title>Error in code stage : the out parameter  must be assigned to before control leaves the current method</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Error-in-code-stage-the-out-parameter-must-be-assigned-to-before/m-p/101639#M48540</link>
      <description>Hello,&lt;BR /&gt;I am new&amp;nbsp; to blue prism and this is my first question here. I am having this issue in my code stage. although&amp;nbsp; found a similar issue in this post&amp;nbsp; &lt;A href="https://community.blueprism.com/communities/community-home/digestviewer/viewthread?GroupId=97&amp;amp;MessageKey=25eb481d-5e63-446c-84fd-1760756b1303&amp;amp;CommunityKey=3b501789-976c-4cfa-b9db-88307c6a0a86&amp;amp;tab=digestviewer&amp;amp;ReturnUrl=%2Fcommunities%2Fcommunity-home%2Fdigestviewer%3FListKey%3D82cdcf8d-bf74-40f4-af5c-7b4be092ec1b" target="_blank" rel="noopener"&gt;here&lt;/A&gt;&lt;BR /&gt;the solution was only able to take out one of the error messages.&lt;BR /&gt;Originally , I had two errors in my code stage saying " the out parameter must be assigned to before control leaves the current method".&lt;BR /&gt;I have assigned the parameters at the top of code just as it was stated in that.&lt;BR /&gt;the parameter &lt;EM&gt;&lt;STRONG&gt;errorMessage&lt;/STRONG&gt;&lt;/EM&gt; is now okay but the parameter &lt;EM&gt;&lt;STRONG&gt;InstanceFullFilePath&lt;/STRONG&gt;&lt;/EM&gt; still has the error&amp;nbsp;&lt;BR /&gt;&lt;SPAN&gt;: &lt;STRONG&gt;The out parameter '&lt;EM&gt;InstanceFullFilePath&lt;/EM&gt;' must be assigned to before control leaves the current method.&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;Here is my code below
&lt;PRE class="language-csharp"&gt;&lt;CODE&gt;try {
errorMessage = "";
InstanceFullFilePath = "";
string InstanceFile = InstanceFileNameWithoutExtension+Path.GetExtension(TemplateFileNameWithExtension);
string templateFilePath = Path.Combine(TemplateDirectory,TemplateFileNameWithExtension);
InstanceFullFilePath = Path.Combine(InstanceDestinationFolderPath,InstanceFile);
File.Copy(templateFilePath,InstanceFullFilePath,true);

} catch (Exception ex) {
errorMessage = ex.Message;

}​&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="36782.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/36788iDDEA3A3B5FB03767/image-size/large?v=v2&amp;amp;px=999" role="button" title="36782.png" alt="36782.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Tue, 12 Jul 2022 23:50:06 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Error-in-code-stage-the-out-parameter-must-be-assigned-to-before/m-p/101639#M48540</guid>
      <dc:creator>DavidOku</dc:creator>
      <dc:date>2022-07-12T23:50:06Z</dc:date>
    </item>
    <item>
      <title>Re: Error in code stage : the out parameter  must be assigned to before control leaves the current method</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Error-in-code-stage-the-out-parameter-must-be-assigned-to-before/m-p/101640#M48541</link>
      <description>Hello guys,&lt;BR /&gt;Thank you . I found the solution to the problem ..phew!!&lt;BR /&gt;I discovered that I had to assign &lt;EM&gt;&lt;STRONG&gt;InstanceFullFilePath&lt;/STRONG&gt;&lt;/EM&gt; in the Catch stage as seen in the modified code, typically what this means is any where the code exits all out parameters in the code stage must be assigned to something.... Phew! Great learning ... Thanks guys.&lt;BR /&gt;&lt;BR /&gt;
&lt;PRE class="language-csharp"&gt;&lt;CODE&gt;try {
errorMessage = "";
string InstanceFile = InstanceFileNameWithoutExtension+Path.GetExtension(TemplateFileNameWithExtension);
string templateFilePath = Path.Combine(TemplateDirectory,TemplateFileNameWithExtension);
InstanceFullFilePath = Path.Combine(InstanceDestinationFolderPath,InstanceFile);
File.Copy(templateFilePath,InstanceFullFilePath,true);


} catch (Exception ex) {
errorMessage = ex.Message;
InstanceFullFilePath = "";

}​&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Jul 2022 00:03:54 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Error-in-code-stage-the-out-parameter-must-be-assigned-to-before/m-p/101640#M48541</guid>
      <dc:creator>DavidOku</dc:creator>
      <dc:date>2022-07-13T00:03:54Z</dc:date>
    </item>
  </channel>
</rss>

