Меню

Ошибка exception has been thrown by the target of an invocation

I have a website developed in ASP.Net 2.0 that is throwing the error

"Exception has been thrown by the target of an invocation" 

in the production environment. It was not throwing this error in development.

The source is ‘mscorlib’, and the stack trace says the error at

System.RuntimeMethodHandle._InvokeMethodFast.

The only thing I’ve changed since my last upload to production is that I’ve started using Membership controls (Login, LoginView), and have added a few more stored procedures and tables, etc. The membership depends upon a custom provider I’ve written.

Anybody have a clue why this could be happening?

Joel Coehoorn's user avatar

Joel Coehoorn

391k111 gold badges561 silver badges789 bronze badges

asked Mar 15, 2009 at 16:47

Donnie Thomas's user avatar

Donnie ThomasDonnie Thomas

3,8198 gold badges47 silver badges69 bronze badges

2

I’d suggest checking for an inner exception. If there isn’t one, check your logs for the exception that occurred immediately prior to this one.

This isn’t a web-specific exception, I’ve also encountered it in desktop-app development. In short, what’s happening is that the thread receiving this exception is running some asynchronous code (via Invoke(), e.g.) and that code that’s being run asynchronously is exploding with an exception. This target invocation exception is the aftermath of that failure.

If you haven’t already, place some sort of exception logging wrapper around the asynchronous callbacks that are being invoked when you trigger this error. Event handlers, for instance. That ought to help you track down the problem.

Good luck!

answered Mar 15, 2009 at 16:51

Greg D's user avatar

4

This can happen when invoking a method that doesn’t exist.

Brian Webster's user avatar

Brian Webster

29.6k48 gold badges150 silver badges224 bronze badges

answered Aug 4, 2010 at 4:06

Casey Burns's user avatar

Casey BurnsCasey Burns

1,19311 silver badges15 bronze badges

2

I know its kind of odd but I experienced this error for a c# application and finally I found out the problem is the Icon of the form! when I changed it everything just worked fine.

I should say that I had this error just in XP not in 7 or 8 .

answered Mar 9, 2013 at 7:50

mohammad sepehri's user avatar

Encounter the same error when tried to connect to SQLServer2017 through Management Studio 2014

enter image description here

The reason was backward compatibility

So I just downloaded the Management Studio 2017 and tried to connect to SQLServer2017.

Problem Solve!!

answered Sep 13, 2019 at 7:04

Kms's user avatar

KmsKms

9572 gold badges9 silver badges27 bronze badges

' Get the your application's application domain.
Dim currentDomain As AppDomain = AppDomain.CurrentDomain 

' Define a handler for unhandled exceptions.
AddHandler currentDomain.UnhandledException, AddressOf MYExHandler 

' Define a handler for unhandled exceptions for threads behind forms.
AddHandler Application.ThreadException, AddressOf MYThreadHandler 

Private Sub MYExnHandler(ByVal sender As Object, _
ByVal e As UnhandledExceptionEventArgs) 
Dim EX As Exception 
EX = e.ExceptionObject 
Console.WriteLine(EX.StackTrace) 
End Sub 

Private Sub MYThreadHandler(ByVal sender As Object, _
ByVal e As Threading.ThreadExceptionEventArgs) 
Console.WriteLine(e.Exception.StackTrace) 
End Sub

' This code will throw an exception and will be caught.  
Dim X as Integer = 5
X = X / 0 'throws exception will be caught by subs below

Miroslav Javorský's user avatar

answered Jun 25, 2010 at 5:23

abc's user avatar

1

This error occurs to me due to I have not set my Project as StartUp Project

When I set my current project to Set As Start-Up Project then it gone.

answered Apr 2, 2019 at 8:24

shaishav shukla's user avatar

I just had this issue from a namespace mismatch. My XAML file was getting ported over and it had a different namespace from that in the code behind file.

answered Jan 20, 2016 at 20:55

Greg Sipes's user avatar

Greg SipesGreg Sipes

6836 silver badges16 bronze badges

This is may have 2 reasons

1.I found the connection string error in my web.config file
i had changed the connection string and its working.

  1. Connection string is proper then check with the control panel>services>
    SQL Server Browser > start or not

answered Jan 24, 2017 at 6:09

Sameer Bahad's user avatar

Got same error, solved changing target platform from «Mixed Platforms» to «Any CPU»

answered Aug 6, 2018 at 21:19

Jaime Vasquez's user avatar

In my case, this happened due to choosing the option to publish as a single file in VS (.NET 5 console app), once I changed it to publish normally the exception was gone.

answered Mar 2, 2021 at 9:10

Meshal's user avatar

MeshalMeshal

32 silver badges3 bronze badges

I got this error after I tried to add a new controller in the Controller folder but the connection string was placed inside the entityFramework tag in Web.config file.

answered Apr 2, 2021 at 23:01

CSharp4eto's user avatar

CSharp4etoCSharp4eto

1271 silver badge5 bronze badges

For me, it happens when there is an internal call to another server and that server is not answering in a logical time or the configuration to call it is wrong. I fixed the problem of connecting to another server, then I received the correct data from that server and the function that was responsible for calling that server is working properly then I do not receive that error.

Ajay2707's user avatar

Ajay2707

5,6686 gold badges39 silver badges58 bronze badges

answered Apr 29, 2021 at 14:41

Beny Sad's user avatar

Beny SadBeny Sad

2703 silver badges14 bronze badges

I edited the validation field, the error was resolved.

builder.Property(x => x.Name)**.UseIdentityColumn()**.HasMaxLength(200);  
builder.Property(x => x.Name)**.IsRequired()**.HasMaxLength(200);

answered Mar 13, 2022 at 20:11

Görkem's user avatar

my problem was that i didnt put the connection string in the right place in the appsettings.json it was inside IIS Express object then i moved it inside profiles object it didnt work as well the i fixed the problem by putting it inside the appsettings.json { here }

answered May 12, 2022 at 7:23

elad baruch's user avatar

1

In my case I just update Oracle.ManagedDataAccess.Core package from 2.19.60 to 3.21.61

answered Jul 13, 2022 at 11:28

Consule's user avatar

ConsuleConsule

79910 silver badges12 bronze badges

I had the same problem.
I was trying to create a report from C# and it wasn’t checking if the field is empty or whitespace.

I add Exception.

answered Dec 23, 2022 at 11:37

Georgios Loudaros's user avatar

When debugging and no InnerException found it can be handy to hit F5 (continue) until it hits another Exception. Or if it drops out entirely you can then check the Output window for more details.

answered Jan 18 at 12:11

DevDave's user avatar

DevDaveDevDave

6,55112 gold badges64 silver badges98 bronze badges

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.

Need more help?

  • Remove From My Forums
  • Question

  • Hi,

    (VS 2005, Beta 2)

    I get the error «Exception has been thrown by the target of an invocation» when I try to open any of the test windows using «Test|Windows|Test View» or any similar approach.

    I created a new solution a while ago and added some unit tests. Everything was working great, until now…

    Anybody have any suggestions?

    Thanks,
    Tor Langlo

Answers

  • Hello,

    I don’t think deleting vsmdi and testrunconfig files would help.
    But yes, if you unload the solution, you should be able to bring up the windows. The problem comes in when your solution *is* the one that contains test projects which you want to execute tests on.
    In any case, if the suggestion or workaround does not work for you, please let me know. Thanks!

    Winnie

Problem

User launches Excel. User clicks «Controller» — «Log on». User receives error message.

Symptom

Exception has been thrown by the target of an invocation

Cause

There are many different causes for the error «Exception has been thrown by the target of an invocation».

  • This IBM Technote specifically relates to the scenario where the message appears when using the Excel-link functionality.
  • For the scenario where the user is using the ‘main’ Controller application interface (not the Excel-based functionality) see separate IBM Technote #1347234.

In this case there are several scenarios why this error would appear inside Excel:

  • Scenario #1 — «Client Distribution Server» settings are configured to use http://localhost
  • Scenario #2 — Unsupported version of Microsoft Office installed on end user’s client PC
    • See separate IBM Technote #1347207
  • Scenario #3 — Dotnet Trust (caspol command) and Trusted Site in IE are not using the naming convention that matches the «Client Distribution Server» settings mentioned in Scenario #1.
  • Scenario #4 — User’s Windows user account has been locked out of the Microsoft Active Directory (domain).
    • See separate IBM Technote #1347252

Resolving The Problem

Scenario #1
Reconfigure the «Client Distribution Server» settings so that they refer to http://<servername> as opposed to http://localhost.

  1. Logon to the Controller application server
  2. Launch the program «Controller Configuration»
  3. Open the section «Client Distribution Server»
  4. Modify the settings (such as «CASUrl») to refer to http://servername/xxxxxx instead of http://localhost/xxxxxxxxxx
  5. Click «Save.


Scenario #2
Upgrade end user’s client PC to a supported version of Microsoft Office.

  • See separate IBM Technote #1347207

Scenario #3
Run the caspol command using the correct server naming convention for the Controller application server and then add this host name, again using same convention, to IE’s Trusted Sites.

For detailed instructions on how to do this, find these sections headed:
«Server Naming Conventions»,
«CASPOL Disable2.BAT»,

and
«Appendix 2 – Manual Method of configuring Microsoft Internet Explorer trusted sites»
..of the «IBM Cognos Proven Practices: How to Install the IBM Cognos Controller Client on a User’s PC» document. See link below for one version of this which is generally applicable to all Controller versions.

Scenario #4
Ask the I.T. department to unlock the user’s Windows user account.

  • See separate IBM Technote #1347252

Related Information

[{«Product»:{«code»:»SS9S6B»,»label»:»IBM Cognos Controller»},»Business Unit»:{«code»:»BU059″,»label»:»IBM Software w/o TPS»},»Component»:»Controller»,»Platform»:[{«code»:»PF033″,»label»:»Windows»}],»Version»:»8.5.1;8.5;8.4;8.3;10.1″,»Edition»:»»,»Line of Business»:{«code»:»LOB10″,»label»:»Data and AI»}}]

Describe the bug
Since updating a project to the latest version of WinUI3 (Reunion 0.5) we receive the following error whenever trying to debug:

System.Reflection.TargetInvocationException
  HResult=0x80131604
  Message=Exception has been thrown by the target of an invocation.
  Source=System.Private.CoreLib
  StackTrace:
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean wrapExceptions, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& hasNoDefaultCtor)
   at System.RuntimeType.CreateInstanceDefaultCtorSlow(Boolean publicOnly, Boolean wrapExceptions, Boolean fillCache) in /_/src/coreclr/src/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs:line 4005
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, Boolean wrapExceptions) in /_/src/coreclr/src/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs:line 4062
   at System.Activator.CreateInstance[T]() in /_/src/libraries/System.Private.CoreLib/src/System/Activator.RuntimeType.cs:line 151
   at WinRT.WeakLazy`1.get_Value()
   at Microsoft.UI.Xaml.Application._IApplicationStatics.get_Instance()
   at Microsoft.UI.Xaml.Application.Start(ApplicationInitializationCallback callback)
   at Project.Program.Main(String[] args) in C:UsersUSERSourceReposProjectProject.UIProject.UIobjx64Debugnet5.0-windows10.0.19041.0App.g.i.cs:line 26

  This exception was originally thrown at this call stack:
    System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(int) in Marshal.cs
    WinRT.BaseActivationFactory.BaseActivationFactory(string, string)
    Microsoft.UI.Xaml.Application._IApplicationStatics._IApplicationStatics()

Inner Exception 1:
COMException: Class not registered (0x80040154 (REGDB_E_CLASSNOTREG))

Steps to reproduce the bug
We used a project created in WinUI3 v3 and followed the official instructions to upgrade to Reunion 0.5. The original project works as expected until Reunion is installed/WinUI3 removed — then we are unable to run the project with the CLASSNOTREG error.

Expected behavior
The project will run as before.

Screenshots
image

Version Info
NuGet package version:
Microsoft.ProjectReunion-v0.5.0-prerelease
Microsoft.ProjectReunion.Foundation-v0.5.0-prerelease
Microsoft.ProjectReunion.WinUI-v0.5.0-prerelease

Windows app type:
Win32

Windows 10 version Saw the problem?
Insider Build (xxxxx)
October 2020 Update (19042) Yes
May 2020 Update (19041)
November 2019 Update (18363)
May 2019 Update (18362)
October 2018 Update (17763)
April 2018 Update (17134)
Fall Creators Update (16299)
Creators Update (15063)
Device form factor Saw the problem?
Desktop Yes
Xbox
Surface Hub
IoT

I have a winforms application which was working fine. Recently i formatted my system and reinstalled VS 2008. From that time the application has stopped running.
When i run it through VS it gives error

«exception has been thrown by the target of an invocation.»

I went on to debug and found that in the this exception comes when from c# code using reflection the code tries to invoke a function from an assembly which is written in c++.

Updated 20-Sep-22 21:08pm


Eventually I solved this myself. It was just a matter of getting to the root of the problem.
Actually the cuase of this exception was another exception which occured inside the method being invoked.

So i went to look out for solution by searching the exception ex.innerexception .
From there i searched the stack trace of that exception to finnaly get to the root of the problem.

So anyone getting this error do look for the innerexception cause the real problem lies there.

Thanks,
Mateen

for the said error, we are talking about inner exception. How to get this inner exception?
running bat «${NUGET_HOME}/nuget.exe restore Dotsolution.sln from jenkins file and getting this error:

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

Disable the ajax for a moment (EnablePartialRendering=»false» on the scriptmanager).

we Got Exception aftr that delete EnablePartialRendering property.

Great said by Mateen Khan, you need to understand what is you controls default value..

eg i’m using combobox in silverlight and i was trying to bind its selected index

as a default its selected index was -1

but it was get nothing from the respective property …

I looked inside the inner exception and find out my solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

RRS feed

  • Remove From My Forums
  • Question

  • From some reason, I can’t browse anymore decision trees mining model objects. This is quite strange — I can create a data mining structure & object but I can’t browse the tree and use other functionalities of the BI — instead, I get the error «Exception
    has been thrown by the target of invocation (mscorlib)».

    Thanks for helping.

All replies

  • Can you provide additional information to help us repro the issue? What software are you using? Do you see the error when you browse any model, any decision trees model or a specific model? Does this happen on a single machine or several machines?

    Regards,

    Tatyana


    Tatyana Yakushev [PredixionSoftware.com]

  • It happens on this machine — SQL Server 2008 R2 Developer, Windows 7 X 64 Home.

    The error is for any decision tree model. Thanks to you I also checked clustering in which I get the same error as well.

    I would like to add that there were no issues till yesterday — everything worked perfectly. Unfortunatelly, since that, browsing is not functional.

    Full error details are shown below.

    Thank you.

    ===================================

    Exception has been thrown by the target of an invocation. (mscorlib)

    ——————————
    Program Location:

       at Microsoft.DataWarehouse.VsIntegration.Designer.Host.DataWarehouseDocumentWindow.SetDesigner(IDesigner designer)
       at Microsoft.DataWarehouse.VsIntegration.Designer.Host.DataWarehouseDocumentWindow.CreateView(IDesignerHost designerHost, Guid logicalView)
       at Microsoft.DataWarehouse.VsIntegration.PVsEditorFactory.CreateEditorInstance(UInt32 vscreateeditorflags, String fileName, String physicalView, IVsHierarchy hierarchy, UInt32 itemid, IntPtr existingDocDataIntPtr, IntPtr& docViewIntPtr, IntPtr&
    docDataIntPtr, String& caption, Guid& cmdUIGuid, Int32& ifCancelled)
       at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
       at Microsoft.DataWarehouse.VsIntegration.Interop.NativeMethods.ThrowOnFailure(Int32 hr, Int32[] expectedHRFailure)
       at Microsoft.DataWarehouse.VsIntegration.Shell.Project.FileProjectHierarchy.OpenFile(IFileProjectNode fileProjectNode, Boolean isNewFile, Boolean useOpenWith, Boolean showFrame, Guid& rguidLogicalView, IntPtr punkDocDataExisting, IVsWindowFrame&
    ppWindowFrame)
       at Microsoft.DataWarehouse.VsIntegration.Shell.Project.Extensibility.ProjectItemExt.Open(String ViewKind)
       at Microsoft.DataWarehouse.VsIntegration.Shell.Project.FileProjectHierarchy.OpenDesignerWindowEx(IComponent component)
       at Microsoft.DataWarehouse.VsIntegration.Shell.Service.DataWarehouseDesignerService.Microsoft.DataWarehouse.Interfaces.IDWDesignerService.OpenDesignerEx(Object vsHierarchy, UIntPtr itemId, DwObjectKind objectType, String connectionString, String
    objectURN, Object[] arguments)
       at Microsoft.DataWarehouse.VsIntegration.Shell.Service.DataWarehouseDesignerService.Microsoft.DataWarehouse.Interfaces.IDWDesignerService.OpenDesigner(Object vsHierarchy, UIntPtr itemId, DwObjectKind objectType, String connectionString, String
    objectURN, Object[] arguments)
       at Microsoft.DataWarehouse.VsIntegration.Shell.Service.DataWarehouseDesignerService.Microsoft.DataWarehouse.Interfaces.IDWDesignerService.OpenDesigner(Object vsHierarchy, UIntPtr itemId, DwObjectKind objectType, String connectionString, String
    objectURN)
       at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.PicassoMenuItem.Invoke()

  • It seems that the issue is even more general — when I use BI (VS 2008) to create a new database and then I try to add a role, I get the following error:

    ===================================

    Unable to create a new database role. (Microsoft Visual Studio)

    ===================================

    Exception has been thrown by the target of an invocation. (mscorlib)

    ——————————
    Program Location:

       at Microsoft.DataWarehouse.VsIntegration.Designer.Host.DataWarehouseDocumentWindow.SetDesigner(IDesigner designer)
       at Microsoft.DataWarehouse.VsIntegration.Designer.Host.DataWarehouseDocumentWindow.CreateView(IDesignerHost designerHost, Guid logicalView)
       at Microsoft.DataWarehouse.VsIntegration.PVsEditorFactory.CreateEditorInstance(UInt32 vscreateeditorflags, String fileName, String physicalView, IVsHierarchy hierarchy, UInt32 itemid, IntPtr existingDocDataIntPtr, IntPtr& docViewIntPtr, IntPtr&
    docDataIntPtr, String& caption, Guid& cmdUIGuid, Int32& ifCancelled)
       at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
       at Microsoft.DataWarehouse.VsIntegration.Interop.NativeMethods.ThrowOnFailure(Int32 hr, Int32[] expectedHRFailure)
       at Microsoft.DataWarehouse.VsIntegration.Shell.Project.FileProjectHierarchy.OpenFile(IFileProjectNode fileProjectNode, Boolean isNewFile, Boolean useOpenWith, Boolean showFrame, Guid& rguidLogicalView, IntPtr punkDocDataExisting, IVsWindowFrame&
    ppWindowFrame)
       at Microsoft.DataWarehouse.VsIntegration.Shell.Project.Extensibility.ProjectItemExt.Open(String ViewKind)
       at Microsoft.DataWarehouse.VsIntegration.Shell.Project.FileProjectHierarchy.OpenDesignerWindowEx(IComponent component)
       at Microsoft.DataWarehouse.VsIntegration.Shell.Project.FileProjectHierarchy.OpenDesignerWindow(IComponent component)
       at Microsoft.AnalysisServices.Wizards.RoleWizardPages.RoleWizardTask.Execute(WizardInputs wizardInputs)

  • An update — I uninstalled and then re-installed SQL SERVER 2008 R2. Unfortunately — the same error occurs.

    Any creative ideas, please? If not, I guess that I’ll have to format my C drive and re-install Windows 7, SQL SERVER R2, etc. 🙁

  • «Office 2003 Add-in: Office Web Components»? I tired to. Thanks, but still no change.

  • Were you able to find a solution to this?  This just started happening to me and it’s impossible to view Execution Plans now.

    Thanks!

  • Can you please check the windown event log for any errors. This seems to be some permission issues.

    Any software patches applied recently? or any firewall rules changes?

Some quick solutions if you don’t want to read the story:

  1. Check if package variables referenced in script task are correct
  2. Check if package variables are being set correctly outside of the script task
  3. Check if the script task’s references match up with the server’s framework
  4. My issue: check if you have permissions

Back to my story:

The other day, one of the packages I maintain broke in nearly every region it was deployed to. I’m thinking “Omg, why?” since this process has never failed in the years it has been implemented. So, I looked at the log to find the descriptive error message : Exception has been thrown by the target of an invocation:

I’m thinking, “Cool, I’ve seen this before, it should be easy“. So I go through the code to trace it to where it was bombing out, then I go through the routine of debugging the common issues:

  1. Check if package variables referenced in script task are correct – nope!
  2. Check if package variables are being set correctly outside of the script task – nope!
  3. Check if the script task’s references match up with the server’s framework – nope!

Nothing seemed to be off in the cases. Eventually, I assume that it has to be a security issue – because that seems to be the solution to everything for me. I run the process in a dev server to find that everything is fine. Now I’m like “Seriously?!“.

Frustrated, I end up wrapping the code in a try catch to print out the error and deploy:

Ah, I knew it! Unauthorized access:

Short story, I looked at previous versions of the directory to find the security had changed. I end up getting permissions added for the users, and ta da! Worked like a charm.

Lessons learned:

  1. Think outside the box. How the heck would someone think it’s a security issue from “…target of invocation”?
  2. Better error handling
  3. Don’t forget to rollback the changes you deployed to quickly find out what was going on since it’s not really good code and you could get in trouble for it

Hopefully that helps! Happy coding!

0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

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

А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • Ошибка f006 16 на форд фокус 3
  • Ошибка exception ereaderror in module