Missingmethodexception system windows forms

Missingmethodexception system windows forms

разбираю отчет об ошибке:

исключение произошло на строчке

в InitializeComponent главной формы.
Compona.Windows.Forms.SyntaxBoxControl — сторонний компонент, находящийся в отдельной необфусцированной сборке. Программа до этого успешно функционировала в течение нескольких месяцев, и вот произошел один сбой, думаю, что однократный. Выше по коду уже есть обращения к этому компоненту, так что думаю, что сборка была доступна.
В связи этим возникли вопросы: что могло вызвать подобную ситуацию, и как мне избежать этого в будущем?

От: Аноним
Дата: 07.02.06 07:45
Оценка:

Ошибка явно говорит о том, что «нет такого метода». To есть при выпонении ваша программа не нашла этого метода в referenced assembly.

Вы наверняка что то переставляли — может новую версию компонента? а может .NET Framework другой версии?

Проверьте, та какую assembly ссылается ваша программа и посмотрите c помощью Reflector на эту assembly и есть ли там такой метод.

И еще — если это Add-in к студии, то эта assembly может быть в кэше вот тут C:\Documents and Settings\ \Local Settings\Application Data\assembly\ — вытрите этот каталог.

От: yg
Дата: 07.02.06 08:36
Оценка:

Здравствуйте, mishazhutov, Вы писали:

M>Ошибка явно говорит о том, что «нет такого метода». To есть при выпонении ваша программа не нашла этого метода в referenced assembly.

M>Вы наверняка что то переставляли — может новую версию компонента? а может .NET Framework другой версии?

M>Проверьте, та какую assembly ссылается ваша программа и посмотрите c помощью Reflector на эту assembly и есть ли там такой метод.

M>И еще — если это Add-in к студии, то эта assembly может быть в кэше вот тут C:\Documents and Settings\ \Local Settings\Application Data\assembly\ — вытрите этот каталог.

Уточню, ошибка произошла на машине клиента. Версия .NET — 1.1.4322.573, та же, что и на машине, на которой производилась отладка. Повторю, ошибка произошла один раз, в дальнейшем не повторялась. Просто хочется знать, есть ли в том моя вина, и предусмотреть на будущее такую ситуацию. Не хочется, чтобы клиентам лишний раз приходилось видеть окно отправки отчета об ошибке.

Missing Method Exception Конструкторы

Определение

Инициализирует новый экземпляр класса MissingMethodException. Initializes a new instance of the MissingMethodException class.

Перегрузки

Инициализирует новый экземпляр класса MissingMethodException. Initializes a new instance of the MissingMethodException class.

Инициализирует новый экземпляр класса MissingMethodException с указанным сообщением об ошибке. Initializes a new instance of the MissingMethodException class with a specified error message.

Инициализирует новый экземпляр класса MissingMethodException с сериализованными данными. Initializes a new instance of the MissingMethodException class with serialized data.

Читайте также:  Нокиа pc suite для нокиа windows

Инициализирует новый экземпляр класса MissingMethodException указанным сообщением об ошибке и ссылкой на внутреннее исключение, вызвавшее данное исключение. Initializes a new instance of the MissingMethodException class with a specified error message and a reference to the inner exception that is the cause of this exception.

Инициализирует новый экземпляр класса MissingMethodException заданным именем класса и именем метода. Initializes a new instance of the MissingMethodException class with the specified class name and method name.

MissingMethodException()

Инициализирует новый экземпляр класса MissingMethodException. Initializes a new instance of the MissingMethodException class.

Комментарии

Этот конструктор инициализирует Message свойство нового экземпляра, сопоставляя с ним системное сообщение, описывающее ошибку, например «попытка доступа к отсутствующему методу». This constructor initializes the Message property of the new instance to a system-supplied message that describes the error, such as «Attempted to access a missing method.» Это сообщение учитывает культуру текущей системы. This message takes into account the current system culture.

В следующей таблице показаны первоначальные значения свойств для экземпляра MissingMethodException. The following table shows the initial property values for an instance of MissingMethodException.

Свойство Property Значение Value
InnerException Пустая ссылка ( Nothing в Visual Basic). A null reference ( Nothing in Visual Basic).
Message Строка локализованного сообщения об ошибке. The localized error message string.

Применяется к

MissingMethodException(String)

Инициализирует новый экземпляр класса MissingMethodException с указанным сообщением об ошибке. Initializes a new instance of the MissingMethodException class with a specified error message.

Параметры

Строка String, описывающая ошибку. A String that describes the error.

Комментарии

Содержимое message параметра должно быть понятно пользователю. The content of the message parameter should be understandable by the user. Для гарантированной локализации этой строки для текущей системной культуры необходимы сведения о том, кто вызывает этот конструктор. The caller of this constructor is required to ensure that this string has been localized for the current system culture.

В следующей таблице показаны первоначальные значения свойств для экземпляра MissingMethodException. The following table shows the initial property values for an instance of MissingMethodException.

Свойство Property Значение Value
InnerException Пустая ссылка ( Nothing в Visual Basic). A null reference ( Nothing in Visual Basic).
Message Строка сообщения об ошибке. The error message string.

Применяется к

MissingMethodException(SerializationInfo, StreamingContext)

Инициализирует новый экземпляр класса MissingMethodException с сериализованными данными. Initializes a new instance of the MissingMethodException class with serialized data.

Параметры

Объект, содержащий сериализованные данные объекта. The object that holds the serialized object data.

Контекстные сведения об источнике или назначении. The contextual information about the source or destination.

Комментарии

Этот конструктор вызывается во время десериализации для восстановления объекта исключения, переданного в потоке. This constructor is called during deserialization to reconstitute the exception object transmitted over a stream. Дополнительные сведения см. в разделе сериализация XML и SOAP. For more information, see XML and SOAP Serialization.

Применяется к

MissingMethodException(String, Exception)

Инициализирует новый экземпляр класса MissingMethodException указанным сообщением об ошибке и ссылкой на внутреннее исключение, вызвавшее данное исключение. Initializes a new instance of the MissingMethodException class with a specified error message and a reference to the inner exception that is the cause of this exception.

Параметры

Сообщение об ошибке, указывающее причину создания исключения. The error message that explains the reason for the exception.

Исключение, которое является причиной текущего исключения. The exception that is the cause of the current exception. Если параметр inner не является указателем null ( Nothing в Visual Basic), то текущее исключение создается в блоке catch , обрабатывающем внутреннее исключение. If the inner parameter is not a null reference ( Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception.

Комментарии

Исключение, созданное как прямой результат предыдущего исключения, должно содержать в свойстве InnerException ссылку на предыдущее исключение. An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the InnerException property. Свойство InnerException возвращает то же значение, которое передается конструктору, или пустую ссылку ( Nothing в Visual Basic), если свойство InnerException не предоставляет конструктору значение внутреннего исключения. The InnerException property returns the same value that is passed into the constructor, or a null reference ( Nothing in Visual Basic) if the InnerException property does not supply the inner exception value to the constructor.

В следующей таблице показаны первоначальные значения свойств для экземпляра MissingMethodException. The following table shows the initial property values for an instance of MissingMethodException.

Missing Method Exception Class

Definition

The exception that is thrown when there is an attempt to dynamically access a method that does not exist.

Examples

This example shows what happens if you attempt to use reflection to call a method that does not exist and access a field that does not exist. The application recovers by catching the MissingMethodException, MissingFieldException, and MissingMemberException.

Remarks

Normally a compilation error is generated if code attempts to access a nonexistent method of a class. MissingMethodException is designed to handle cases where an attempt is made to dynamically access a renamed or deleted method of an assembly that is not referenced by its strong name. MissingMethodException is thrown when code in a dependent assembly attempts to access a missing method in an assembly that was modified.

MissingMethodException uses the HRESULT COR_E_MISSINGMETHOD, that has the value 0x80131513.

For a list of initial property values for an instance of MissingMethodException, see the MissingMethodException constructors.

This exception is not included in .NET for Windows Store apps or the Portable Class Library, but it is thrown by some members that are. To catch the exception in that case, write a catch statement for MissingMemberException instead.

Constructors

Initializes a new instance of the MissingMethodException class.

Initializes a new instance of the MissingMethodException class with serialized data.

Initializes a new instance of the MissingMethodException class with a specified error message.

Initializes a new instance of the MissingMethodException class with a specified error message and a reference to the inner exception that is the cause of this exception.

Initializes a new instance of the MissingMethodException class with the specified class name and method name.

Fields

Holds the class name of the missing member.

(Inherited from MissingMemberException) MemberName

Holds the name of the missing member.

(Inherited from MissingMemberException) Signature

Holds the signature of the missing member.

(Inherited from MissingMemberException)

Properties

Gets a collection of key/value pairs that provide additional user-defined information about the exception.

(Inherited from Exception) HelpLink

Gets or sets a link to the help file associated with this exception.

(Inherited from Exception) HResult

Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

(Inherited from Exception) InnerException

Gets the Exception instance that caused the current exception.

(Inherited from Exception) Message

Gets the text string showing the class name, the method name, and the signature of the missing method. This property is read-only.

Gets or sets the name of the application or the object that causes the error.

(Inherited from Exception) StackTrace

Gets a string representation of the immediate frames on the call stack.

(Inherited from Exception) TargetSite

Gets the method that throws the current exception.

(Inherited from Exception)

Methods

Determines whether the specified object is equal to the current object.

(Inherited from Object) GetBaseException()

When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions.

(Inherited from Exception) GetHashCode()

Serves as the default hash function.

(Inherited from Object) GetObjectData(SerializationInfo, StreamingContext)

Sets the SerializationInfo object with the class name, the member name, the signature of the missing member, and additional exception information.

(Inherited from MissingMemberException) GetType()

Gets the runtime type of the current instance.

(Inherited from Exception) MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object) ToString()

Creates and returns a string representation of the current exception.

(Inherited from Exception)

Events

Occurs when an exception is serialized to create an exception state object that contains serialized data about the exception.

Читайте также:  Как быстро сохранять скриншоты windows
Оцените статью