Share via


Rejecting native image because native image dependency – shown in immediate window

Question

Monday, February 11, 2013 12:05 AM | 1 vote

Greetings community,

This question is about VS2012 Pro installed on Windows 7 Pro x64. Project is VB.NET and windows forms application type.

When I start the application (F5) this is message appears in immediate window repeated several times:

CLR:(C:\Windows\Microsoft.Net\assembly\GAC_64\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll) Rejecting native image because native image dependency C:\Windows\Microsoft.Net\assembly\GAC_64\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll had a different identity than expected

Now let me have said little history of that application. I started writing it few months ago with project’s “Target CPU” setting to “x64”. I was able to do so until beginning of this January when, after some VS update, it became impossible to create data source from class I had defined in my project. I reported the issue in these forums

http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/e47d64b0-bcc6-47a4-8fe0-5c0fcf3479aa/

and Moderator Shanks Zen told me that he/she was able to reproduce the issue and directed me to report the bug to Microsoft Connect. I did it, here’s the link

http://connect.microsoft.com/VisualStudio/feedback/details/776575/project-s-setting-target-cpu-when-set-on-x64-doesn-t-really-work

but nothing happened till now.

Also, I’ve been suggested to change “Target CPU” setting to “Any CPU”, until better solution comes up, which I did.

Now, I started getting this in immediate window, and sometimes in that window I also have some first chance exception in visual studio hosting process, but I cannot reproduce it whenever I want.

Most strange of all, my application works fine so far in spite of all these warnings. This bugs me: being a beginner, I would like to know if I’m the one to be blamed when immediate window reports some exception.

Now my questions:

Do I have something improperly installed, and can I do something about it?

Does anyone of you, who had been asked to write the windows form application for x64 processor, have any similar issues?

Thanks for any answer.

All replies (6)

Tuesday, February 12, 2013 9:04 AM

Hello IvicaNesic,

Thank you for your post.

I would like to know if you get this issue when you debug your application and set the Target CPU of the project  to x64.

If you set it to Any CPU, will you get this exception in Immediate window when you debug it?

Based on your description, it seems that you must set Target CPU to Any CPU in order to make it work fine.

“Do I have something improperly installed, and can I do something about it?”

I am not a VS Setup and Installation expert. Not sure if this issue is related to VS installation. If you think that your issues may be about VS installation, you can get some suggestions from Visual Studio Setup and Installation forum.

In addition, you said that “my application works fine so far in spite of all these warnings”.

I suggest that you could locate to the IDE folder then run these commands to check if it can help:

C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE

Devenv.exe /SafeMode: Launches the IDE in safe mode loading minimal windows.

Devenv.exe /ResetSettings: Restores the IDE's default settings, optionally resets to the specified VSSettings file.

Devenv.exe /ResetAddin: Removes commands and command UI associated with the specified Add-in.

Devenv.exe /ResetSkipPkgs: Clears all SkipLoading tags added to VSPackages.

Best regards,

Amanda Zhu [MSFT]
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.


Saturday, February 16, 2013 9:49 PM

Hi Amanda

Sorry for the late reply, I’ve been pretty sick last few days.

To answer your first question: It’s not possible to start this project if you set Target CPU to x64. Actually it’s not possible to have any data source created from object (class) from within your project, if you set Target CPU to x64. It was possible in the beginning, but since this January it is not possible any more.

I presume that was the result of some VS (or .NET) update, but I cannot tell for sure. It might be that update was bad by itself, or it was badly installed on my computer. Anyone’s computer actually, because one of the moderators here told me that the issue is reproducible on other people computers.

Thing is that I had to reset my project’s Target CPU setting to Any CPU in order to have my project to start. It won’t even build if I set it to x64, because in that mode some data sources could not be created. Classes (objects) are not seen by New data source wizard.

 Now, I have a project previously created in x64 mode, and I changed it (been forced to do that) to Any CPU, and as a result of it I have warnings about wrong CLR version in GAC_64.

Is there any way to manually update mscorlib.dll in GAC? Maybe just a part of my updating process simply went wrong.


Tuesday, February 19, 2013 5:29 AM

Hello,

Maybe the following KB about How to install an assembly into the Global Assembly Cache can help you:

http://support.microsoft.com/kb/815808?wa=wsignin1.0

Best regards,

Amanda Zhu [MSFT]
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.


Wednesday, February 20, 2013 1:51 AM

Hi Amanda,

Thanks for trying, but this link got me to the page with instructions how to install my own DLL in GAC. It is useful info, but my intent was to reinstall mscorlib.dll if this issue was about it.

Now, I’m not sure where to find it and how to verify if it is the last correct version. Do you have any suggestion about it?


Thursday, February 21, 2013 5:49 AM

Hello,

“but my intent was to reinstall mscorlib.dll”

I am afraid that the issue is out of support of VS General Question forum which mainly discusses WPF & SL designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System and Visual Studio Editor. And I am not sure if you can uninstall the mscorlib.dll and then reinstall it into GAC.

I suggest that maybe you can consult on Common Language Runtime Internals and Architecture forum to check if you can do that and how to do it.

Best regards,

Amanda Zhu [MSFT]
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.


Monday, June 10, 2013 8:30 AM

Hi Amanda

I have just started having the same problem since vs update 2 and the update cycle last month.

Last month's windows update included some security enhancements to the .net framework and I suspect that this error is a mismatch between the symbol server (and the symbol downloads since I was originally using a symbol download) and the current version of the dlls in the framework.

It could simply be that a process needs to be put in place to keep them in sync.