title: Stored procedure error A .NET Framework error occurred during execution of user-defined routine or aggregate
body: <p>I have a procedure that was working perfectly and suddenly without any updates it stopped, and I got this massage. I tried everything I could get or know and nothing</p>
  
  <blockquote>
    <p>Msg 6522, Level 16, State 1, Procedure CreateFileAsmoFormat, Line 0<br>
    A .NET Framework error occurred during execution of user-defined routine or aggregate "CreateFileAsmoFormat": 
    System.IO.FileNotFoundException: Could not load file or assembly 'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.</p>
    
    <p>System.IO.FileNotFoundException:<br>
    at Microsoft.VisualBasic.Interaction.MsgBox(Object Prompt, MsgBoxStyle Buttons, Object Title)<br>
    at DataTransformer.Tools.SaveToFileAsmoFormat(String content, String filePath, Boolean IsAppend)</p>
  </blockquote>
  
  <p>the code </p>
  
  <pre><code>SET ANSI_NULLS OFF 
  GO 
  SET QUOTED_IDENTIFIER OFF 
  GO 
   CREATE PROCEDURE [dbo].[CreateFileAsmoFormat] 
   @FileNameWithPath [nvarchar](4000), 
   @FileData [nvarchar](4000), 
   @IsAppend [bit] 
   WITH EXECUTE AS CALLER AS EXTERNAL NAME [DataTransformer].
   [DataTransformer.ExecutionStoredProcedure]‌​.[CreateFileAsmoForm‌​at] 
  GO
  </code></pre>