Ошибка exception has been thrown in file

При попытке формирования ключа RSA в Личном кабинете ЕГАИС возникает ошибка:

«Ошибка в методе createCertificateRequest() Error:Exception has been thrown is file «Context.cpp» at line 13. The text is: Неправильная подпись».

 

Причина:

Ошибка вызвана изменением или повреждением системной библиотеки basecsp.dll.

Расположение библиотеки:

32-битная ОС — C:WindowsSystem32

64-битная ОС — C:WindowsSysWOW64

Решение:

Чаще всего, указанную библиотеку подменяют вредоносные программы.

Во вредительстве замечены некоторые программы, изменяющие внешний вид операционной системы, например:

X PROJECT NEW LOOK

Названия программ могут быть и другими. Узнать какая из программ могла повлиять на целостность библиотеки можно, сравнив дату создания библиотеки в свойствах файла с датой установки программ в списке установленных компонентов.

Необходимо найти программу, повлиявшую на библиотеку basecsp.dll и удалить эту программу с компьютера.

После выполнения удаления вредоносной программы библиотека будет восстановлена и можно будет сформировать сертификат RSA.

When I run nuget restore from the command line, I get

Error parsing solution file at MyProject.sln: Exception has been thrown by the target of an invocation.

but restoring nuget packages from Visual Studio runs without errors. Any workarounds?

asked Jul 14, 2017 at 10:22

sashoalm's user avatar

sashoalmsashoalm

74.2k119 gold badges427 silver badges771 bronze badges

This error is particularly frustrating on large solutions with many projects, as there is no hint from NuGet at what point in the file parsing failed.

To analyze the problem, try msbuild MyProject.sln; the parser of msbuild is slightly more verbose. At least it will give you a line number, so you will know where to look for the error. Open MyProject.sln in a text editor to inspect that line. In my case, it was simply a blank line that accidentally got introduced while manually resolving a TFS merge conflict.

(It may seem quite obvious to call msbuild, but in our case, that call was part of a larger build script where nuget restore would come first, aborting the build process before msbuild was reached.)

A future release of NuGet should return a more detailed error message; see issue #1150.

answered Sep 5, 2017 at 13:25

Ruud Helderman's user avatar

Ruud HeldermanRuud Helderman

10.4k1 gold badge25 silver badges45 bronze badges

I found the solution after examining our source control. There was an incorrect merge (in git) which caused our solution to have 2 nested projects

Project(...) = ...
Project(...) = ...
EndProject
Global
.......

and the last EndProject was missing. What’s interesting is that Visual Studio didn’t fail even though our solution file was effectively corrupt.

Adding an EndProject between the 2 Projects fixed the error.

answered Jul 14, 2017 at 10:22

sashoalm's user avatar

sashoalmsashoalm

74.2k119 gold badges427 silver badges771 bronze badges

I Had same issue. The problem was the sln file has same blank lines. I removed the lines. It resolved

Ex Problem

//Blank Line
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2010
MinimumVisualStudioVersion = 10.0.40219.1

    GlobalSection(ProjectConfigurationPlatforms) = postSolution
        {658E5ED2-A01E-41DD-A952-F5EDE9E4AEE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {658E5ED2-A01E-41DD-A952-F5EDE9E4AEE0}.Debug|Any CPU.Build.0 = Debug|Any CPU

        {658E5ED2-A01E-41DD-A952-F5EDE9E4AEE0}.Prod|Any CPU.ActiveCfg = Prod|Any CPU
        {658E5ED2-A01E-41DD-A952-F5EDE9E4AEE0}.Prod|Any CPU.Build.0 = Prod|Any CPU
    EndGlobalSection

Fixed Version

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2010
MinimumVisualStudioVersion = 10.0.40219.1

    GlobalSection(ProjectConfigurationPlatforms) = postSolution
        {658E5ED2-A01E-41DD-A952-F5EDE9E4AEE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {658E5ED2-A01E-41DD-A952-F5EDE9E4AEE0}.Debug|Any CPU.Build.0 = Debug|Any 
        {658E5ED2-A01E-41DD-A952-F5EDE9E4AEE0}.Prod|Any CPU.ActiveCfg = Prod|Any CPU
        {658E5ED2-A01E-41DD-A952-F5EDE9E4AEE0}.Prod|Any CPU.Build.0 = Prod|Any CPU
    EndGlobalSection

answered Mar 30, 2018 at 9:22

Sercan Timoçin's user avatar

2

My solution was to update nuget.exe to the latest version.

answered Mar 19, 2020 at 14:35

Piper's user avatar

PiperPiper

81111 silver badges13 bronze badges

I had the same problem. This happened on our CI-server (TFS 2018) when using the «Nuget restore» task. Appearantly the build agent was using an old version of nuget (4.1) and it had trouble reading the Visual Studio 2019 solution file (sln and/or csproj) resulting in the error indicated by @sashoalm.

The answer from Microsoft was to use the task «Nuget Tool Installer» but this was not working behind the enterprise proxy wall that I am behind. From what I have read people have a hard time with this. According the Microsoft they have resolved this but only in Azure Devops Server 2019 in an update to the «Nuget tool installer» task.

What is the resolution is to manually download the nuget.exe of your choice and copy it to the build agent. Then, replace your «Nuget» task with a «Powershell» task and do

Write-Host "Restoring packages"
Write-Host "Using nuget.exe at" $(nugetexepath)
$(nugetexepath) restore [PATH_TO_SLN_FILE] -Verbosity Detailed -NonInteractive

I added a variable

nugetexepath

as well in the build configuration.

Perhaps this gets resolved in a future update from Microsoft to help all that are still on TFS 2018 and not on Azure Devops Server 2019.

answered Apr 17, 2020 at 10:34

Anders Ericsson's user avatar

I got this error from my azure pipeline. I went onto the build server & ran msbuild mysolution.sln. That revealed a different error:

Unhandled Exception: System.IO.FileNotFoundException: Could not load
file or assembly ‘Microsoft.Build.Framework, Version=15.1.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its
dependencies. The system cannot find the file specified. at
Microsoft.Build.CommandLine.MSBuildApp.Execute(String commandLine)
at Microsoft.Build.CommandLine.MSBuildApp.Main()

That’s when I found that I found this answer
Could not load file or assembly ‘Microsoft.Build.Framework'(VS 2017)
& thought I needed to update nuget, so I added a step in my pipeline for the NuGet Installer task & set it to use a newer version.

https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/tool/nuget?view=azure-devops

No more errors.

answered Oct 21, 2021 at 20:38

James Burnett's user avatar

This article applies to Microsoft Dynamics AX for all regions.

Symptoms

Assume that you create a purchase order for a fixed asset in Microsoft Dynamics AX 2012. When you try to invoice the purchase order, you receive the following error message:

Exception has been thrown by the target of an invocation.

This problem occurs when you are running the system in CIL.

Resolution

Hotfix information

A supported hotfix is available from Microsoft. There is a «Hotfix download available» section at the top of this Knowledge Base article. If you are encountering an issue downloading, installing this hotfix, or have other technical support questions, contact your partner or, if enrolled in a support plan directly with Microsoft, you can contact technical support for Microsoft Dynamics and create a new support request. To do this, visit the following Microsoft website:

https://mbs.microsoft.com/support/newstart.aspx You can also contact technical support for Microsoft Dynamics by phone using these links for country specific phone numbers. To do this, visit one of the following Microsoft websites:

Partners

https://mbs.microsoft.com/partnersource/support/Customers

Installation information

If you have customizations for one or more of the methods or the tables that are affected by this hotfix, you must follow these steps:

  1. Review the changes that are documented in the .xpo file.

  2. Apply these changes in a test environment before you apply the hotfix in a production environment.

For more information about how to install this hotfix, click the following article number to view the article in the Microsoft Knowledge Base:

893082 How to install a Microsoft Dynamics AX hotfix

Prerequisites

You must have Microsoft Dynamics AX 2012 installed to apply this hotfix.

Restart requirement

You must restart the Application Object Server (AOS) service after you apply the hotfix.

File information

The global version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.

File name

File version

File size

Date

Time

Platform

Aximpactanalysis.exe

Not applicable

60,280

06-Nov-2011

11:16

x86

Axupdate.exe

Not applicable

60,264

06-Nov-2011

11:16

x86

Dynamicsax2012-kb2696116-foundation.axmodel

6.0.1108.330

18,344

29-Mar-2012

08:36

Not applicable

Dynamicsax2012-kb2696116-syplabels.axmodel

6.0.1108.330

812,968

29-Mar-2012

08:36

Not applicable

Axsetupsp.exe

6.0.947.853

1,361,768

15-Jan-2012

16:00

x86

Axutillib.dll

6.0.947.0

817,512

11-Jul-2011

01:48

x86

Microsoft.dynamics.servicing.operations.dll

6.0.888.436

35,752

15-Jun-2011

10:40

x86

Axsetupsp.resources.dll

6.0.947.491

382,848

06-Nov-2011

11:16

x86

Axsetupsp.resources.dll

6.0.947.491

370,560

06-Nov-2011

11:16

x86

Axsetupsp.resources.dll

6.0.947.491

374,656

06-Nov-2011

11:16

x86

Axsetupsp.resources.dll

6.0.947.491

374,656

06-Nov-2011

11:16

x86

Axsetupsp.resources.dll

6.0.947.491

370,560

06-Nov-2011

11:16

x86

Axsetupsp.resources.dll

6.0.947.491

378,752

06-Nov-2011

11:16

x86

Axsetupsp.resources.dll

6.0.947.491

370,560

06-Nov-2011

11:16

x86

Axsetupsp.resources.dll

6.0.947.491

374,656

06-Nov-2011

11:16

x86

Axsetupsp.resources.dll

6.0.947.491

370,560

06-Nov-2011

11:16

x86

Axsetupsp.resources.dll

6.0.947.491

374,656

06-Nov-2011

11:16

x86

Axsetupsp.resources.dll

6.0.947.491

370,560

06-Nov-2011

11:16

x86

Axsetupsp.resources.dll

6.0.947.491

407,424

06-Nov-2011

11:16

x86

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the «Applies to» section.

Note This is a «FAST PUBLISH» article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use for other considerations.

Describe the bug
Cannot import xva file by the XCP-NG Center

To Reproduce
Steps to reproduce the behavior:

  1. Go to ‘File —>Import’
  2. Browse xva-file
  3. Click «Open», click «Next», click «Next», click «Import»
  4. There is a windows with the «Preparing to import VM» that hangs for about 32 minutes
  5. After that — an error «Exception has been thrown by the target of an invocation.»

Expected behavior
Imported VM

Screenshots / Logfiles
import_error
XCP-ng Center.log
XCP-ng Center Audit Trail.log

Hard-/Software involved:

  • Hardware: HPE DL380 Gen10
  • Host XCP-ng Version: 8.1.0
  • Client XCP-ng Center Version: 20.04.00.32
  • Desktop OS: Windows 7 SP1 64bit

Additional context
As a workaround I copy xva-file into /tmp and run xe vm-import filename=xoa_unified.xva and the vm is on the list.

In this guide, we will walk you through the process of resolving the «Exception has been thrown by the target of an invocation» error. This error is common in .NET applications and can be caused by various reasons. By following the steps provided, you should be able to identify and fix the issue in your application.

Table of Contents

  1. Understanding the Error
  2. Step-by-Step Solution
  3. FAQ

Understanding the Error

The «Exception has been thrown by the target of an invocation» error occurs when an application or library attempts to call a method using reflection, but the method throws an exception. The .NET runtime will wrap the original exception in a TargetInvocationException.

Here’s an example of the error message:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.

Step-by-Step Solution

To resolve the «Exception has been thrown by the target of an invocation» error, follow these steps:

Identify the source of the exception: The first step is to identify the source of the exception. Check the error message to find the original exception type (e.g., System.NullReferenceException) and the method that threw the exception.

Check the InnerException property: The TargetInvocationException object has an InnerException property that contains the original exception. Examine this property to find more information about the error, such as the stack trace and any custom error messages.

try
{
    // Call a method using reflection
}
catch (TargetInvocationException ex)
{
    // Log the inner exception details
    Console.WriteLine("Inner Exception: " + ex.InnerException);
}

Debug the application: Use a debugger to step through your code and identify the exact line where the exception is thrown. This will help you understand the root cause of the issue.

Fix the issue: Once you have identified the root cause of the exception, you can fix the issue in your code. This might involve checking for null references, handling exceptions properly, or ensuring that necessary resources are available.

Test the application: After making the necessary changes, test the application to ensure that the issue is resolved and no other errors occur.

FAQ

1. When does the ‘Exception has been thrown by the target of an invocation’ error occur?

This error occurs when an application or library attempts to call a method using reflection, but the method throws an exception. The .NET runtime will wrap the original exception in a TargetInvocationException.

2. What is a TargetInvocationException?

TargetInvocationException is an exception that is thrown by the .NET runtime when a method called using reflection throws an exception. It wraps the original exception in its InnerException property.

3. How can I find the original exception that caused the TargetInvocationException?

You can find the original exception by examining the InnerException property of the TargetInvocationException object.

4. Can this error occur in non-.NET applications?

Yes, this error can occur in other programming languages and frameworks that support calling methods using reflection. The specific exception type and error message may vary depending on the language and runtime environment.

5. How can I prevent the ‘Exception has been thrown by the target of an invocation’ error from occurring?

To prevent this error, ensure that your code is properly handling exceptions and validating input before calling methods using reflection. Additionally, you should test your application thoroughly to identify and fix any potential issues before deployment.

Related links:

  • Microsoft Docs: TargetInvocationException Class
  • Microsoft Docs: Exception Handling (C#)

Возможно, вам также будет интересно:

  • Ошибка exception erangeerror in module
  • Ошибка exception econverterror in module
  • Ошибка exception detected симс 4
  • Ошибка exception cannot call spreadsheetapp getui from this context
  • Ошибка exception at address 0x00000000 base

  • Понравилась статья? Поделить с друзьями:
    0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии