如果.exe文件中不包含interop.scripting,我该怎么办?

时间:2017-02-10 10:35:52

标签: vb.net

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.IO.FileNotFoundException: Could not load file or assembly 'Interop.Scripting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
File name: 'Interop.Scripting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
   at Project1.listmanipulatorlight.LogEvents(String whatToLog, Boolean canRandom)
   at Project1.largelistmanipulator.unionManyFilesIntoResultTxt()
   at Project1.listManipulatorForm.cmdUnionAllTextFiles_Click(Object eventSender, EventArgs eventArgs)
   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& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

WRN: Assembly binding logging is turned OFF.

看起来我正在使用互操作脚本。

从错误看起来,LogEvents函数就是使用需要互操作脚本的东西。

logevents功能就像这样

  Public Sub LogEvents(ByVal whatToLog As String, Optional ByVal canRandom As Boolean = True)
        Static logNumber As Integer

        Dim timeStamp As String

        timeStamp = CStr(Microsoft.VisualBasic.Now)

        whatToLog = timeStamp & " " & " " & whatToLog & Microsoft.VisualBasic.vbNewLine

        Try
            Debug.Print(whatToLog)
            appendToTextFile(whatToLog, "log.txt", Scripting.IOMode.ForAppending)
        Catch ex As Exception

        End Try


        If txtLog Is Nothing Then
        Else
            txtLog.Text = txtLog.Text & whatToLog
            txtLog.Text = Microsoft.VisualBasic.Right(txtLog.Text, 2000)
        End If
        System.Diagnostics.Debug.Print("Log:" & whatToLog)

        logNumber = logNumber + 1
        SuperGlobal.lockMeFirst(
            Sub()
                If (Microsoft.VisualBasic.Rnd() < 1.0# / 10000 Or logNumber > 100000.0) And canRandom Then
                    Try
                        Dim col = fileToCol("log.txt")
                        If col.Count > 50000 Then
                            col.RemoveRange(0, col.Count - 10000)
                        End If
                        coltofile(col, "log.txt", True)
                    Catch ex As Exception
                    End Try
                    logNumber = 0
                    'reserveMaintenance("log.txt")
                End If
            End Sub
        )
    End Sub

我看不到那些使用任何额外普通的东西。我不知道使用interopt的是什么。什么是interopt?如何在.exe文件中嵌入该interopt,以便我不会遇到此问题。

0 个答案:

没有答案