System.IO.Directory.Exists

Home Page Forums BizTalk 2004 – BizTalk 2010 System.IO.Directory.Exists

Viewing 1 reply thread
  • Author
    Posts
    • #19647

       Hi

       

      I am learning to use BizTalk what is the correct syntax to check if a folder exists, I am attempting to use this line of code in an Expression editor but am getting an error

      bResult = System.IO.Directory.Exists(@”c:\TestFolder”);

       

      bResult is a boolean.

       

      The error I receive is:

      Inner execption: The filename,directory name, or volume label syntax is incorrect

       

      Thanks

    • #19653

       Not sure. I copied your line of code into an expression shape and it worked fine for me using 2006 R2

      • #19656

         Hi Greg

         

        Thanks so much for all your help with my basic issues/questions, I really appreciate it.

         

        I took the same BizTalk application and changed the Application name under Configuration ->Deployment and deployed it and this time it did the check without issues. I had also added some code to create the folder if it did not exist and this also worked and created the folder. Excellent!

        To try test and learn some more I changed the path to attempt to create another folder, deployed but this time nothing happened(no errors either). I had to changed the app name again to create a new app for the new folder to be created. It only seems to do the check and creation in the Expression shape correctly the first time I deploy and create the application.

        How do I get BizTalk to refresh and use the latest appliction update I have deployed and not use the previously deployed app?

        I am using the Trial version of BizTalk 2006.

        • #19657

          Everytime you redeploy an assembly used by Biztalk you need to restart the host instance. Either from Biztalk Admin console or from Admin Tools-> Services

          The Host instance is a running windows service, that will reuse any previously loaded assemblies. The only way to reload a new build of an  assembly is to stop and start the host instance 

          • #19658

            What is the @ symbol for?

            • #19660

               In C# backslashes and letters have meaning (i.e.
              means NewLine).

              When specifying a path you can define it as “C:\\Testfolder\\Test” with double backslashes or you can add the @ before the string and only use a single backslash @”C:\Testfolder\Test”

            • #19662

               sorry that meant to say
              means NewLine

      • #19659

         I read that you have to stop and start BizTalk Service BizTalk Group : BizTalkServerApplication service, it worked but do you have to do this everytime you deploy an update?

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.