Sharepoint 2013 crashes indefinitely after workflow publishing error.


  • Hello,

    I am using Sharepoint Designer 2013 with a Sharepoint 2013 foundation server on Windows Server 2012. Just a preface here regarding the issue below: Rebooting appears to resolve the problem until the next workflow compilation error. The bottom line is that I had to reboot the server 10 times in the last 2 days. I am not seeing anything else out there that resembles this problem, so I would appreciate any advice about what we can do from here.

    After publishing a workflow, I received the following errors: 

    Errors were found when compiling the workflow. The workflow files were saved but cannot be run

    (0, 0) Activity 'ID187' validation failed: An IfElseActivity must have at least one child of type IfElseBranchActivity.)

    (0, 0) Activity 'ID201' validation failed: An IfElseActivity must have at least one child of type IfElseBranchActivity.)

    The larger problem, however, is that once ANY workflow publishing error occurs, I will get the following message when I try to perform any workflow publishing until the server is rebooted.

    Errors were found when compiling the workflow. The workflow files were saved but cannot be run: Unexpected error on server associating the workflow.

    I also noticed there are several links when navigating through the settings page that produce varying errors similar to this:

    An error occurred during the compilation of the requested file, or one of its dependencies. Could not write to output file 'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\784a69f1\95fd2dd1\App_Web_vsubwebs.aspx.9c9699a8.1xoeknv5.dll' -- 'The directory name is invalid. ' 

    Correlation ID: 48d1359c-34f9-c0b9-135f-ddb6110cc676 

    Date and Time: 8/4/2013 3:57:14 PM 

    Sunday, August 04, 2013 8:02 PM


All replies

  • Hi,
    According to your post, the server-side validation for the workflow was unsuccessful may be because of errors in the workflow or one or more actions used in the workflow reference assemblies are not listed or listed as unsafe in the safe list in the web.config file.

    You can try the following steps:
    1. Re-register workflow service and publish a simple workflow to see if the error still occurs.
    2. Open the web.config file and make sure that the workflow reference assemblies are listed correctly in the file.
    3. Make sure the workflow design uses valid data and logic.

    Best regards.

    Wednesday, August 07, 2013 10:13 AM
  • I can confirm this behavior. In our environment if a publish attempt ever receives this message: "Errors were found when compiling the workflow. The workflow files were saved but cannot be run: Details..." all workflow publishing fails on the entire farm (All Web Applications). We are also receiving this message:  "Unexpected error on server associating the workflow". This error can be reproduced. We have found that doing an IISRESET on one of our front end servers resolves the issue. However, resetting IIS every time this issue occurs is not a viable solution.
    Wednesday, October 02, 2013 9:23 PM
  • We were experiencing a similar issue and it has since been submitted as a bug to the .NET framework product team by the Microsoft escalation engineers working our premiere support ticket.  

    When the error occurs, the associated application pool service account's temp folder gets deleted.  Recreating the 'Temp' folder in the following path fixes the errors without having to restart the application pool.
    Path: C:\Users\<service-acct>\AppData\Local\Temp

    An alternate workaround is to create a read-only file within the Temp directory so that it cannot be deleted.


    Sunday, May 25, 2014 6:00 AM
  • I am seeing the same error when I try to publish my Workflow to my SharePoint 2013 site via SharePoint Designer 2013.

    I have tried an IISReset /noforce on the Web Front End server and I've also recreated the Temp folder under the Web Application pool account, however both haven't fixed the problem.

    Has there been any further update from Microsoft?



    Wednesday, May 28, 2014 2:17 AM
  • Yoshi,

    A couple questions to clarify...

    Are you publishing workflows with complex or nested logic statement? If so, have you already gone through solutions posted by Victoria above?  What were the results?

    Have you verified that the Web App Service Account Temp directory is/isn't being deleted? Path: C:\Users\<service-acct>\AppData\Local\Temp Can you verify that the issue is isolated to a single web app?

    Have you attempted to re-register the Workflow Service (SP2013 Workflows)?

    If publishing Workflows with logic...Have you attempted to add to executionTimeout property in web.config file to increase the timeout interval (Make a copy of the web.config file before editing anything). For more information, refer to:
    Fixed: SharePoint Designer Error - Unexpected error on server associating the workflow:


    Wednesday, May 28, 2014 2:37 AM
  • Hi maradamcarter

    Yes, my workflow does contain a number of conditional statements. I have found that publishing small sections of the workflow has worked but it fails again when I add more than 4 conditional statements.

    I created a txt file in the Temp folder of the application pool account on the WFE and set it to Read Only. This prevents the Temp folder from being deleted. However, I still see the error.

    I haven't tried Victoria's suggestion above as I'm using the SharePoint 2010 Workflows in my SharePoint 2013 site. Should I run the command nevertheless?

    I will extend the timeout now and let you know.



    Wednesday, May 28, 2014 2:46 AM
  • Extending the timeout to 300 did not fix the error unfortunately.

    Wednesday, May 28, 2014 2:51 AM
  • Yoshi,
    This sounds like a similar but different problem than we were experiencing based on your previous statement ("workflow does contain a number of conditional statements").  Please take a look at my posting ( and the last example I posted titled "Posting example steps to reproduce error:" 

    Also, if the fact that you're able to publish portions of the workflow without error seems to point more to the conditional statements.  Does it appear to matter which statements produce the error?

    Despite the workaround we employed, we still receive an initial error when publishing the workflow however it no longer inhibits us from republishing a valid workflow where before it required an IISRESET or web app reset.

    Also, once you receive the error, is it isolated to a single web app or does the publishing error break all web apps (assuming you have more than one)?


    Wednesday, May 28, 2014 3:33 AM
  • We have 2 web applications, one for the main SharePoint 2013 site and one for MySites.

    I just tried increasing the timeout to 1000 but still the problem persists.

    I'm thinking maybe there is a problem with my conditional statements.

    This is what they look like now

        email someone
        email someone else
           email someone
           email someone else
       else if
           email someone
           email someone else
       else if  (adding these 3 links breaks it)
         if     (adding these 3 links breaks it)
         else   (adding these 3 links breaks it)
          email someone
        email someone

    Now in addition to the ones above, I have a few more conditions to add. This Workflow however works in my DEV site, which I started building before I went to the latest service pack for SP2013 last week. So all i'm doing now is recreating the same Workflow in my Production site.


    Wednesday, May 28, 2014 3:48 AM
  • I think I found the problem. It points to a block of if else statements. After getting rid of the block, I added the remaining condition and it deployed correctly.

    I will attempt to add the problem block back in line by line.

    Thanks for your suggestions.



    Wednesday, May 28, 2014 3:53 AM
  • Sounds like you're headed in the right direction.  One note: we experienced no workflow errors with the RTM SP2013 release but only started experiencing issues after MAR 2013 PU and all subsequent releases including SP1.  Not knowing the versions you're running in DEV vs. PROD, this might be something to consider.  However, it sounds like your issue is rooted in your workflow.  

    If you find a block that seems to cause errors you might isolate that condition block out to its own workflow and see if it produces the problem alone or only with other conditions and then try repeating on your DEV.

    Good luck!


    Wednesday, May 28, 2014 4:40 AM
  • Hello

    I solved the problem by isolating the block if condition statements after which I found that my action wasn't sitting correctly inside the condition.

    Too easy!

    Thanks again.


    Wednesday, May 28, 2014 5:01 AM
  • Did the trick for me. Thanks.
    Tuesday, August 26, 2014 2:40 AM
  • Hi marcadamcarter, Is this issue resolved ?
    Wednesday, August 27, 2014 12:36 AM
  • Hello RaghavendraBN, 

    To the best of my knowledge, yes the issue should be considered resolved.


    Wednesday, August 27, 2014 5:11 AM
  • Thank you Marcadamcarter. 

    Just an additional question.

    "temp folder is getting deleted" is that bug fixed ? any specific CU or Hotfix?

    Thursday, August 28, 2014 3:31 PM
  • This worked for me, thanks!
    Monday, October 27, 2014 7:17 AM
  • I opened a ticket with Microsoft to solve this issue.  The workaround to create a read-only file in the Temp folder worked so I could publish workflows again.   Yay!   The biggest discovery from the ticket was the root cause of the "If-else" error.  I did a copy-paste of a block of workflow actions that contained and If-else block.  

    Big Thanks to Kevin on the SharePoint Designer team!

    • Edited by ClairePoint Friday, November 21, 2014 1:59 PM
    Friday, November 21, 2014 1:58 PM
  • Hi Victoria,

    I am also facing same problem. But If logic is wrong the workflow fails can be agreed. but after this we are not able to any activity on site.( E.g: Go to site settings, list settings, any _layouts folder not accessible ). Few links working those are accessed before we publish workflow. This activity stopping the wring files to temporary .Net folder.

    Is there any solution to avoid the problem. Instead of reset IIS every time.


    Koti Reddy Eda

    Friday, July 07, 2017 8:50 AM