65.9K
CodeProject is changing. Read more.
Home

Exception Has Been Thrown by the Target of an Invocation using Visual Studio and TFS

starIconstarIconstarIconstarIconstarIcon

5.00/5 (1 vote)

Jan 27, 2015

CPOL
viewsIcon

10964

Exception has been thrown by the target of an invocation using Visual Studio and TFS

Introduction

This kind of issue can also happens on improper check-in by others.

Solution

I had this issue after getting the latest from TFS. It turns out in my case, it happens if other colleagues don't merge or resolve your code properly.

I checked in an XAML and its .cs file, but my colleague did not resolve my changes and checked-in his changes.

In my case, the solution was to copy Itemgroup from history and place it in the latest sln file.

<ItemGroup>
    <EmbeddedResource Include="Pages\Job\AssetJobsList.xaml">
        <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
        <SubType>Designer</SubType>
    </EmbeddedResource>
</ItemGroup>