About migrating the managed Dll from VS2003 to VS2005

Hi everyone!
I have a managed C++ Dll which compiled by Visual Studio 2003,and I migrate it to Visual Studio 2005 these days,and call it by some C# applications.Unfortunately it always report error:"is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)",I also can not tarce into it,for once I refer the class in the dll,the C# console application will report that error when I press F5!
Please suggess me if any one have solve.


Birch Howe
0
lizhizhe2000
8/9/2007 9:27:03 AM
asp.net.migrate-vs2003-vs2005 590 articles. 0 followers. Follow

5 Replies
716 Views

Similar Articles

[PageSpeed] 50
Get it on Google Play
Get it on Apple App Store

First, make sure you are compiling in the proper mode.  Check Visual Studio 2005's Configuration Manager (Build menu, Configuration Manager item) and select Win32.

Second, if you are missing a dll that the code references inside your Managed C++ dll (this is typically what happens), use Dependency Walker to find out what's missing. 


Darrell Norton, MVP
Darrell Norton's Blog


Please mark this post as answered if it helped you!
0
DarrellNorton
8/9/2007 12:28:14 PM
Thanks for your reply, DarrellNorton.I do encounter the questions you mention above.   

First the debugger says "The specified module could not be found. (Exception from HRESULT: 0x8007007E)", with the help of depends.exe,I fix the error.

 

But then the debugger says "BadImageFormatException was unhanlded(is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)".

 I do configure the managed C++ Dll project to Win32 platform, so I do not what I do to resolve it. What I want to know is is there any configure options or compile options can cause this error?

 


Birch Howe
0
lizhizhe2000
8/10/2007 2:06:22 AM

I correct this error just by commenting the follow code:

BOOL APIENTRY DllMain( HANDLE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
      )
{
 switch (ul_reason_for_call)
 {
 case DLL_PROCESS_ATTACH:
 case DLL_THREAD_ATTACH:
 case DLL_THREAD_DETACH:
 case DLL_PROCESS_DETACH:
  break;
 }
    return TRUE;
}


Birch Howe
0
lizhizhe2000
8/13/2007 1:27:03 AM

I correct this error just by commenting the follow code:

BOOL APIENTRY DllMain( HANDLE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
      )
{
 switch (ul_reason_for_call)
 {
 case DLL_PROCESS_ATTACH:
 case DLL_THREAD_ATTACH:
 case DLL_THREAD_DETACH:
 case DLL_PROCESS_DETACH:
  break;
 }
    return TRUE;
}

Does


Birch Howe
0
lizhizhe2000
8/13/2007 1:27:17 AM

I correct this error just by commenting the follow code:

BOOL APIENTRY DllMain( HANDLE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
      )
{
 switch (ul_reason_for_call)
 {
 case DLL_PROCESS_ATTACH:
 case DLL_THREAD_ATTACH:
 case DLL_THREAD_DETACH:
 case DLL_PROCESS_DETACH:
  break;
 }
    return TRUE;
}

Does anyone know why?Thanks


Birch Howe
0
lizhizhe2000
8/13/2007 1:27:52 AM
Reply:

Similar Artilces:

Upgrade/migration issues from VS2003+.NET 1.1 to VS2005+.NET 2.0
Hi,  Visual Studio is great when everything works well and you don't know what is happening under the hood. However when things don't work it is really frustrating since you just don't know what is going on.  I have a project (a web site) that was originally developed for VS2003 and ASP.NET 1.1. When I loaded this project on VS2005 (and ASP.NET 2.0), VS told me that it will migrate it to the new environment: it did a number of things, generated a migration report and created/moved files under App_code and such directories. I tried this process a number of times b...

Migrating VS2003 to VS2005.
Hello, I have recently migrated VS2003 web application(ASP.NET 1.0) to VS2005 (ASP.NET2.0). But after migration I am getting an error saying a particular DLL is not defined. How do I register this DLL in the server so that I can overcome this problem. Note: I have migrated the application which is in different machine(i.e., Shared drive).   Thanks, Renil. You don't have to register the dll on the server.  Just put it in your App_Code folder  and then add a reference to it in Solution Explorer.http://msdn2.microsoft.com/en-us/library/1886a4bb-c9d8-4ba6-8078-04b...

Migrate from VS2003 to VS2005
Hello, please help me with my problem. Projects were successfully migrated from 2003 to 2005. I have VS2005 Team Edition, installed: VS80-KB898904-X86-ENU.exe, VS80-KB915364-X86-ENU.exe, WebApplicationProjectSetup.msi. I tried to open solution. At first I couldn’t open solution at all I have done the next changes: “You will need to change the MSBuild targets in the project file. Open this file with a text editor and replace the VSTO target with this one <Import Project="$(MSBuildExtensionsPath)\Microsoft.VisualStudio.OfficeTools.targets" />”. Now I can open solution but...

Migrating a VS2003 project to VS2005
I need to migrate a web project from VS2003 to VS2005. I am a novice user. List down the steps that need to take care before migrating. Is there a tool (don't want that tool in VS2005 setup) that will migrate my solution to 2005 hassle free? Thanks! Viswanth V.G Check out this article:Step-By-Step Guide to Converting Web Projects from Visual Studio .NET 2002/2003 to Visual Studio 2005 Darrell Norton, MVPDarrell Norton's BlogPlease mark this post as answered if it helped you! Great link... Thanks a ton! My problem is to convert all the *.vb code files to Partial classes. ...

HTML problems while migrating from VS2003 to VS2005
Hi, all. I tried to get the existing code for my website (originally built on .NET 1.1 using VS2003 as the development tool) to compile within VS2005 for .NET 2.0, but have run into the following problem : The existing code uses include files (i.e. files that are included in .aspx pages using the include macro) that contain inline VB scripting code (for example,  <%=myvariable%> or <% if  IsValidFlag = true then %> ) : The error message is "Character '<' , hexadecimal value 0x3c is illegal in an XML attribute values. If I remove the offending include...

Error on migrating webapplication from VS2003 to VS2005
I created web application with C# with VS2003 successfully. Now I pulled the solution to VS2005.  But a build error appears as " It is an error to use a section registred as allowDefinition = " Machine to application" beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS". The error occrurs with in the authentication tag in web.config. I have confiremed that the virtual directory is configurated as an application through virtual directory properties.  Can some one help on this issue?  Can you make sure you...

Couldn’t open solution which was migrate from VS2003 to VS2005
Hello, please help me I spend huge time for that problem. I’m trying to run project which was migrated from VS203 to VS2005. I installed VS80-KB915364-X86-ENU.exe, VS80-KB898904-X86-ENU.exe, WebApplicationProjectSetup.msi. When I open the solution I have the same error: --------------------------- Microsoft Visual Studio --------------------------- Unable to read the project file 'SolutionName.csproj'. C:\path\ProjectName.csproj(1585,11): The imported project "C:\Program Files\MSBuild\Microsoft\VisualStudio\v8.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confir...

Faced many errors after migration from VS2003 to VS2005
 Dear Forum Members,I have a ASP.NET 1.1 project and it is successfully run. Now i am going to migrate it into 2.0. I used the Migration wizard that is already in VS2005. After migration when i build it, it will return many errors. In the below i listed some of them..1. Error    1    Validation (): Element 'html' occurs too few times.    2. Error    2    Cannot switch views: This end tag has no matching start tag.    3. Error    3    Validation (Internet Explor...

Visual Studio 2005 Crashes after migrating from VS2003 to VS2005
I have migrated my project from vs2003 to vs2005 after installing application project. Everything is very smooth. And my project in vs 2005 can be compiled and run. However, when I use master page and try to drag a third party control component into the design region (in the content page), vs 2005 crashes. Well, this is not the headache yet. So I removed master page. And start running the project in debug mode, I keep getting the error message as listed next. Visual studio is frozen to death. No matter if I restart the visual studio or restart the computer, I keep getting the following infor...

(Scott?) Migrated Vs2003 to web app vs2005 Page_load fires twice...
Hi there,I have migrated a web project from vs 2003 to vs 2005 using web application projects... It works but page_load always fires twice. I know why this is ... because AutoEventWireUp is set to true BUT if i create a new page then AutoEventWireUp is also set to true and these don't fire twice..I was looking for some hookup source code but it doesn't exist.... I swear i looked high and low... it isn't there.... i was looking for something like this this.Load+=new EventHandler(thi.Page_Load);This means that the autoeventwireup would launch page_load and also above would... hence twice....

Does anybody know how to migrate a VS2003 WSE2.0 program to VS2005 WSE3.0?
Hello. I'm trying to migrate a VS2003.NET(VB), ASP.NET 1.1, .NET Framework 1.1, WSE 2.0 SP3, IIS 5.1 Web Application to VS2005(VB), ASP.NET 2.0, .Net Framwwork 2.0, WSE 3.0, Web Application. There were some errors which i resolved and still two warnings unresolved, but there is just one outstanding error that i cannot figure out how to fix. In the following function i get the error "'Attachments' is not a member of 'Microsoft.Web.Services3.SoapContext'" on the "doc.load" line.     Private Function GetList(ByVal classID As xatanetconduitwebservice.ClassType, ByVal orgID As ...

Just migrated to VS2005 now can't get VS2003 debugger to work
Hi, I just migrated my project from VS2003 to VS2005. Before I started I backed up my VS2003 solution. I now need to go back to VS2003 for a while (my boss has something urgent he wants doing so don't have time to get it working and do proper testing because of the new CLR 2.0). The problem is that I've restored my VS2003 solution and can't get the VS2003 debugger to start. It says: "Error while trying to run project: Unable to start debugging on the web server". I've looked at the help file but I need to narrow it down a bit (I can't check all that stuff!): Am I looking at a...

Upgraded VB.NET from VS2003 to VS2005
I have added new components in C#.  The C# code preforms normally.  But changes in the VB code are not executed.  I can step through the VB code and watch it execute code that is no longer there.  I have run clean, and rebuilt the solution and web site. But I still get old code executed.  Where is the old module stored and how can I replace it? Thanks, Hi, Based on my understanding, when you run the code, the changes on the code is not applied. If we insert the breakpoint on that code, does it can be hit or show some warning message on the breakpoint? This looks ...

To migrate or not to migrate...
I am currently working on a project that is written in PHP...  Very poorly.  I have to do a complete re-write.  I can code in either language, so I am trying to determine if I should convert to .Net or not. Is one really any more scalable than the other?  Is there a noticeable difference in speed between the compiled code and the interpreted code? Is there a list of large, high-volume, commercial web sites (other than MS, of course) that run on .NET? Thanks. J  >Is there a noticeable difference in speed between the compiled code and the inte...

Web resources about - About migrating the managed Dll from VS2003 to VS2005 - asp.net.migrate-vs2003-vs2005

Thunderclap Migrating From Twitter to Facebook
Thunderclap, a mass-messaging service that gained popularity on Twitter, has set its sights on Facebook . Twitter recently booted Thunderclap ...

Facebook Migrating Unofficial Page Fans to Official Pages at Brand Owner’s Request
Rupesh Mandal is such an avid fan of the Opera Mini web browser that he set up a Page on Facebook totally devoted to celebrating it, and then ...

Teens Migrating From Facebook To Comments Section Of Slow-Motion Deer Video - YouTube
Subscribe to The Onion on YouTube: http://bit.ly/xzrBUA Trendwatchers say more and more teens are leaving Facebook and Twitter in favor of the ...

UAE is the global leader in attracting migrating professionals, study finds
... with 28 per cent, was the leading source of professionals, according to the LinkedIn study. The UAE is the global leader in attracting migrating ...

Record Numbers of New Zealanders Migrating to Australia
Acting on impulse: why the Kiwis keep coming ... and coming and coming

The krilling season: Whales keep tourists migrating south
Earlybird whale watchers in Eden have been rewarded with astounding acrobatic displays in the bay.

Migrating Swans were bound for glory, says great
Migrating Swans were bound for glory, says great

Researchers say Irukandji jellyfish migrating further south along Qld coast
Researchers say climate change could be altering the migration patterns of the dangerous Irukandji jellyfish along Qld's east coast.

Apple chip supplier TSMC announces record profits, migrating to more advanced technology
... Company , iPhone , and iPad continue reading at 9to5Mac . What do you think? Discuss "Apple chip supplier TSMC announces record profits, migrating ...

More eBay Merchants Migrating to Amazon in Search of Sales Growth
EBay's once-loyal merchants are moving more of their business to Amazon, saying they get more for their money by selling merchandise via the ...

Resources last updated: 12/4/2015 3:51:31 AM