Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / May 2006

Tip: Looking for answers? Try searching our database.

The "ResolveNativeReference" task failed unexpectedly

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tony Wong - 26 Apr 2006 23:31 GMT
I have a C++ project (assembly) and a C# project (client that uses the C++
assembly).  These projects used to work when compiled under VS 2003 but when
I upgraded my projects to VS 2005 I got the following error when I compile
the C# client,

----------------------------------------------------------------------------
--------------------------------------------
The "ResolveNativeReference" task failed unexpectedly.
System.ArgumentNullException: Parameter "metadataValue" cannot be null.
  at Microsoft.Build.Shared.ErrorUtilities.VerifyThrowArgumentNull(Object
parameter, String parameterName)
  at Microsoft.Build.Utilities.TaskItem.SetMetadata(String metadataName,
String metadataValue)
  at
Microsoft.Build.Tasks.ResolveNativeReference.ExtractFromManifest(ITaskItem
taskItem, String path, Hashtable containingReferenceFilesTable, Hashtable
containedPrerequisiteAssembliesTable, Hashtable containedComComponentsTable,
Hashtable containedTypeLibrariesTable, Hashtable
containedLooseTlbFilesTable, Hashtable containedLooseEtcFilesTable)
  at Microsoft.Build.Tasks.ResolveNativeReference.Execute()
  at Microsoft.Build.BuildEngine.TaskEngine.ExecuteTask(ExecutionMode
howToExecuteTask, Hashtable projectItemsAvailableToTask, BuildPropertyGroup
projectPropertiesAvailableToTask, Boolean& taskClassWasFound)
----------------------------------------------------------------------------
--------------------------------------------

I searched the MSDN forum and found another guy had the same problem
(http://forums.microsoft.com/msdn/ShowPost.aspx?postid=370426&isthread=false
&siteid=1&authhash=300d160e0f32a3abd006853e62466660da83fab9&ticks=6328166038
53148671
).  Any one seen this and know how to fix it?

Thanks.
Marcus Heege - 27 Apr 2006 15:48 GMT
What happens if you remove the referene and add it again?

> I have a C++ project (assembly) and a C# project (client that uses the C++
> assembly).  These projects used to work when compiled under VS 2003 but
[quoted text clipped - 32 lines]
>
> Thanks.
Tony Wong - 27 Apr 2006 16:16 GMT
I did that and I am still getting the same error.

> What happens if you remove the referene and add it again?
>
[quoted text clipped - 13 lines]
> > String metadataValue)
> >   at

Microsoft.Build.Tasks.ResolveNativeReference.ExtractFromManifest(ITaskItem
> > taskItem, String path, Hashtable containingReferenceFilesTable, Hashtable
> > containedPrerequisiteAssembliesTable, Hashtable
[quoted text clipped - 11 lines]
> >
> > I searched the MSDN forum and found another guy had the same problem

(http://forums.microsoft.com/msdn/ShowPost.aspx?postid=370426&isthread=false

&siteid=1&authhash=300d160e0f32a3abd006853e62466660da83fab9&ticks=6328166038
> > 53148671
> > ).  Any one seen this and know how to fix it?
> >
> > Thanks.
Marcus Heege - 27 Apr 2006 17:29 GMT
I have been able to repoduce your problem. It is very likely that your
problem is related to the CRT libraries. In VS2005, these are deployed as
native assemblies (in the %windir%\WinSxS directory). To be able to load the
CRT dlls, you need a native manifest. If you create a new C++/CLI class
library project, the project settings ensure that such a native manifest
will be embedded. If you port pojects from older versions, you will have to
update your porject settings for the manifest tool. Create a new C++/CLI
class lib project and update your old project settings for the manifest tool
according to the new project settings. Let me know if this does not solve
the problem.

Marcus Heege

>I did that and I am still getting the same error.
>
[quoted text clipped - 47 lines]
>> >
>> > Thanks.
Tony Wong - 27 Apr 2006 23:54 GMT
The project settings doesn't seem to make a difference.   I looked into this
matter further and am now thinking the issue may be related to how the
VC2005 upgrader handles resource files.  I will post more information if I
know more.

> I have been able to repoduce your problem. It is very likely that your
> problem is related to the CRT libraries. In VS2005, these are deployed as
[quoted text clipped - 33 lines]
> >> > String metadataValue)
> >> >   at

Microsoft.Build.Tasks.ResolveNativeReference.ExtractFromManifest(ITaskItem
> >> > taskItem, String path, Hashtable containingReferenceFilesTable,
> > Hashtable
[quoted text clipped - 13 lines]
> >> >
> >> > I searched the MSDN forum and found another guy had the same problem

(http://forums.microsoft.com/msdn/ShowPost.aspx?postid=370426&isthread=false

&siteid=1&authhash=300d160e0f32a3abd006853e62466660da83fab9&ticks=6328166038
> >> > 53148671
> >> > ).  Any one seen this and know how to fix it?
> >> >
> >> > Thanks.
Marcus Heege - 28 Apr 2006 07:40 GMT
> The project settings doesn't seem to make a difference.   I looked into
> this
> matter further and am now thinking the issue may be related to how the
> VC2005 upgrader handles resource files.  I will post more information if I
> know more.

I have also made the experience that the pure existence of an external
native manifest  file for a dependant dll (xxx.dll.manifest) in the output
directory can cause this problem.

Just in case...

Marcus
Vitaly  Belman - 23 May 2006 13:18 GMT
That's exactly that

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.