After change extension from .Net 3.5 to .Net 4.0 Debugging is no more possible

3885
15
01-18-2011 05:12 AM
LionelMartz
New Contributor II
Hello everyone,

I have a strange problem trying to debug an extension.

We are developping an ArcGIS-Extension. It used to be a .Net 3.5 Project for ArcView 9.3.
Now, we want to update this extension to the .Net Framework 4.0 on ArcGIS 10.
First, we made it work for ArcGIS 10 without any problems following the guide vom ESRI.
We also can change the version of the framework in Visual Studio 2010 from 3.5 to .Net 4.0.

After this change, wie can still compile the extension and start ArcMap in the VS debuggin mode properly. First we thougth that it worked. But then we tryed to debug this version. By setting a breakpoint in VS, is says:
"The break point currently will not be hit, no symbols have been loaded to this document".

Then we saw, our extension wasn't even registered to the Global Assembly Cash, however,
I don't know how this is possible, because it seemed to be startet properly with ArcMap.

Does anybody have an idea?
0 Kudos
15 Replies
AlexanderGray
Occasional Contributor III
This is usually an indication that ArcMap is loading an older version of the dll.  Try cleaning out the bin folder of your project, try searching and deleting any other dll with the same name on your machine.
0 Kudos
CaleBerkey
New Contributor
I've had similar problems but was never able to fully sort it out before moving on to other tasks.  I've noted that even when receiving that same message when setting breakpoints, the breakpoint is still hit when debugging, so you might want to give it a shot anyways.

Aside from clearing out the bin folder as the prior poster suggests, you might also want to edit ArcMap.exe.config.  Find

<supportedRuntime version="v2.0.50727"/>

And add

<supportedRuntime version="v4.0"/>

Some users have had success with this, from what I've been able to gather reading the forums.  In my case, ArcMap simply opens and closes. 

Please let us know if you are able to solve the issue.
0 Kudos
LionelMartz
New Contributor II
Thank you for the fast answers.

The idea, the breakpoint could work anyway was good - I never tryed, but unfortunately it didn't worked.

I know the problem with other versions of Dlls. To assure that isn't the problem, I verified the version of the running extension, and its allways like the version I'm compiling. After cleaning the Project, no extension was loaded anymore by starting ArcMap

I now tryed to manipulate the ArcMap.exe.config without success.

What I really don't understand is: I can attach a process to Visual Studio. That shows me the loaded Modules(dlls). Our extension is not listet, while it is compiled für .NET 4.0.

Thanks anyway
Lionel


Edit: I forgot to mention, I already modified the ESRIRegAsm.exe.config adding <supportedRuntime version="v4.0"/>
When I register the DLL in the Shell with the ESRIRegAsm.exe the system tells me the registration was successful.
0 Kudos
AlexanderGray
Occasional Contributor III
If your extension is longer showing up in ArcMap, it is no longer registered and the one loading before was an old one.  When running arcmap, can you load the tlb manually?  If so your dll is fine just the registration is not being done.  If not, there is some other problem.
0 Kudos
LionelMartz
New Contributor II
That's the point. The extension is shown-up in ArcMap, even in the newest version. It works, but the extension.DLL is not loaded with ArcMap. I don't know how that works, but it does.

When I compile in .Net 3.5 I can do this:
1. Register the DLL
2. Start ArcMAP
3. Attach the ArcMap process to Visual studio
4. Open the List of the running modules of ArcMap
5. Thas shows me my "extension".dll

Now I Can stop ArcMap, unregister the extension, restart arcMap, an no extension is loaded anymore.

When I comile in .Net 4.0 everything it's the same, except of point 5. My "extension".Dll is NOT listet within the modules, but works fine with ArcMap. After unregistering this DLL, ArcMap starts without the extension.
0 Kudos
AlexanderGray
Occasional Contributor III
0 Kudos
LionelMartz
New Contributor II
So, ArcGIS 10 SDK doesn't support .NET 4.0 yet. Does someome know, if support could come sometime ?
0 Kudos
Venkata_RaoTammineni
Occasional Contributor
So, ArcGIS 10 SDK doesn't support .NET 4.0 yet. Does someome know, if support could come sometime ?


http://forums.arcgis.com/threads/16137-.NET-4-DLL-in-3.5-Add-in-(Or-.NET-4-Add-in-not-Debugging)
0 Kudos
ManmeetKaur
New Contributor

I am facing the same issue. Is any one have solution to this problem.

After change extension from .Net 3.5 to .Net 4.0 Debugging is no more possible

0 Kudos