title: Method not found: 'System.Type System.Runtime.InteropServices.Marshal.GetTypeFromCLSID(System.Guid)'
body: <p>I spent a good deal of time writing this program on my dev box, after moving it to our production boxes I get the error below. Just an FYI I don't have any control over what is installed and what can be installed, how can I make this work? Under both framework on both computers we have v1.0.3705, v1.1.4322, v2.0.50727, v3.0, v3.5, 4.0.30319. Also the program I used to create the app is Visual Studio 2013 Pro.</p>
  
  <p>Thanks</p>
  
  <blockquote>
    <p>See the end of this message for details on invoking  just-in-time
    (JIT) debugging instead of this dialog box.</p>
    
    <p><em><strong></em>**<em>*</em>**<em></strong> Exception Text <strong></em>**<em>*</em>****</strong> System.MissingMethodException: Method not found: 'System.Type
    System.Runtime.InteropServices.Marshal.GetTypeFromCLSID(System.Guid)'.
    at C_Sharp_version.Form1.button4_Click(Object sender, EventArgs e)<br>
    at System.Windows.Forms.Control.OnClick(EventArgs e)    at
    System.Windows.Forms.Button.OnClick(EventArgs e)    at
    System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)    at
    System.Windows.Forms.Control.WmMouseUp(Message&amp; m, MouseButtons
    button, Int32 clicks)    at
    System.Windows.Forms.Control.WndProc(Message&amp; m)    at
    System.Windows.Forms.ButtonBase.WndProc(Message&amp; m)    at
    System.Windows.Forms.Button.WndProc(Message&amp; m)    at
    System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp; m)
    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp;
    m)    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
    msg, IntPtr wparam, IntPtr lparam)</p>
    
    <p><em><strong></em>**<em>*</em>**<em></strong> Loaded Assemblies <strong></em>**<em>*</em>****</strong> mscorlib
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.239 (RTMGDR.030319-2300)
        CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
    ---------------------------------------- C Sharp version
        Assembly Version: 1.0.0.0
        Win32 Version: 1.0.0.0
        CodeBase: file:///gordonc$/Desktop/C%20Sharp%20version%20(2).exe
    ---------------------------------------- System.Windows.Forms
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.235 built by: RTMGDR
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    ---------------------------------------- System.Drawing
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 built by: RTMRel
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    ---------------------------------------- System
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.236 built by: RTMGDR
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll</p>
  </blockquote>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Data;
  using System.Drawing;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.Windows.Forms;
  using System.IO;
  using Word = Microsoft.Office.Interop.Word;
  using Microsoft.Office.Interop.Word;
  
  
  namespace C_Sharp_version
  {
      public partial class Form1 : Form
      {
          public Form1()
          {
              InitializeComponent();
          }
          private void FindAndReplace(Microsoft.Office.Interop.Word.Application doc, object findText, object replaceWithText)
          {
              //options
              object matchCase = false;
              object matchWholeWord = true;
              object matchWildCards = false;
              object matchSoundsLike = false;
              object matchAllWordForms = false;
              object forward = true;
              object format = false;
              object matchKashida = false;
              object matchDiacritics = false;
              object matchAlefHamza = false;
              object matchControl = false;
              object read_only = false;
              object visible = true;
              object replace = 2;
              object wrap = 1;
              //execute find and replace
              doc.Selection.Find.Execute(ref findText, ref matchCase, ref matchWholeWord,
                  ref matchWildCards, ref matchSoundsLike, ref matchAllWordForms, ref forward, ref wrap, ref format, ref replaceWithText, ref replace,
                  ref matchKashida, ref matchDiacritics, ref matchAlefHamza, ref matchControl);
          }
  
          private void button1_Click(object sender, EventArgs e)
          {
              OpenFileDialog openInfDoc = new OpenFileDialog();
  
              if (openInfDoc.ShowDialog() == System.Windows.Forms.DialogResult.OK)
              {
                  string strInfDocLocation = openInfDoc.FileName;
  
                  MessageBox.Show(strInfDocLocation);
                  InfDocLocationtxt.Text = strInfDocLocation; 
              }
          }
  
          private void button2_Click(object sender, EventArgs e)
          {
              OpenFileDialog openNetdoc = new OpenFileDialog();
              if (openNetdoc.ShowDialog() == System.Windows.Forms.DialogResult.OK)
              {
                  string strNetDocLocation = openNetdoc.FileName;
  
                  MessageBox.Show(strNetDocLocation);
                  NetDocLocationtxt.Text = strNetDocLocation;
              }
          }
  
          private void button3_Click(object sender, EventArgs e)
          {
              OpenFileDialog openChkdoc = new OpenFileDialog();
              if (openChkdoc.ShowDialog() == System.Windows.Forms.DialogResult.OK)
              {
                  string strChkDocLocation = openChkdoc.FileName;
  
                  MessageBox.Show(strChkDocLocation);
                  ChkDocLocationtxt.Text = strChkDocLocation;
              }
          }
  
          private void button4_Click(object sender, EventArgs e)
          {
              object fileName = Path.Combine(System.Windows.Forms.Application.StartupPath, InfDocLocationtxt.Text);
              Microsoft.Office.Interop.Word.Application wordApp = new Microsoft.Office.Interop.Word.Application { Visible = true };
              Microsoft.Office.Interop.Word.Document aDoc = wordApp.Documents.Open(ref fileName, ReadOnly: false, Visible: true);
              aDoc.Activate();
              FindAndReplace(wordApp, "&lt;ServerName&gt;", textBox1.Text);
              FindAndReplace(wordApp, "&lt;Domain&gt;", textBox2.Text);
              FindAndReplace(wordApp, "&lt;Ip&gt;", textBox3.Text);
              FindAndReplace(wordApp, "&lt;Engineer&gt;", textBox4.Text);
              FindAndReplace(wordApp, "&lt;Date&gt;", textBox5.Text);
              FindAndReplace(wordApp, "&lt;Project&gt;", textBox6.Text);
              FindAndReplace(wordApp, "&lt;Cluster&gt;", textBox7.Text);
              FindAndReplace(wordApp, "&lt;DocNumber&gt;", textBox8.Text);
              FindAndReplace(wordApp, "&lt;Author&gt;", textBox9.Text);
  
  
          }
  
          private void button7_Click(object sender, EventArgs e)
          {
  
          }
  
          private void button5_Click(object sender, EventArgs e)
          {
              object fileName = Path.Combine(System.Windows.Forms.Application.StartupPath, NetDocLocationtxt.Text);
              Microsoft.Office.Interop.Word.Application wordApp = new Microsoft.Office.Interop.Word.Application { Visible = true };
              Microsoft.Office.Interop.Word.Document aDoc = wordApp.Documents.Open(ref fileName, ReadOnly: false, Visible: true);
              aDoc.Activate();
              FindAndReplace(wordApp, "&lt;ServerName&gt;", textBox1.Text);
              FindAndReplace(wordApp, "&lt;Domain&gt;", textBox2.Text);
              FindAndReplace(wordApp, "&lt;Ip&gt;", textBox3.Text);
              FindAndReplace(wordApp, "&lt;Engineer&gt;", textBox4.Text);
              FindAndReplace(wordApp, "&lt;Date&gt;", textBox5.Text);
              FindAndReplace(wordApp, "&lt;Project&gt;", textBox6.Text);
              FindAndReplace(wordApp, "&lt;Cluster&gt;", textBox7.Text);
              FindAndReplace(wordApp, "&lt;DocNumber&gt;", textBox8.Text);
              FindAndReplace(wordApp, "&lt;Author&gt;", textBox9.Text);
          }
  
          private void button6_Click(object sender, EventArgs e)
          {
              object fileName = Path.Combine(System.Windows.Forms.Application.StartupPath, ChkDocLocationtxt.Text);
              Microsoft.Office.Interop.Word.Application wordApp = new Microsoft.Office.Interop.Word.Application { Visible = true };
              Microsoft.Office.Interop.Word.Document aDoc = wordApp.Documents.Open(ref fileName, ReadOnly: false, Visible: true);
              aDoc.Activate();
              FindAndReplace(wordApp, "&lt;ServerName&gt;", textBox1.Text);
              FindAndReplace(wordApp, "&lt;Domain&gt;", textBox2.Text);
              FindAndReplace(wordApp, "&lt;Ip&gt;", textBox3.Text);
              FindAndReplace(wordApp, "&lt;Engineer&gt;", textBox4.Text);
              FindAndReplace(wordApp, "&lt;Date&gt;", textBox5.Text);
              FindAndReplace(wordApp, "&lt;Project&gt;", textBox6.Text);
              FindAndReplace(wordApp, "&lt;Cluster&gt;", textBox7.Text);
              FindAndReplace(wordApp, "&lt;DocNumber&gt;", textBox8.Text);
              FindAndReplace(wordApp, "&lt;Author&gt;", textBox9.Text);
          }
  
  
      }
  }
  </code></pre>