Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

ASP .NET 3.5 application converted to ASP.NET 4.0 no longer runs on server

Posted on 2011-10-04
15
Medium Priority
?
364 Views
Last Modified: 2012-05-12
Hello,

There is an application that I recently converted to use .NET framework 4.0 (using the wizard in visual studios 2010) and it runs fine on my local PC (Windows XP SP3).

However, this same application when deployed on the server does not work and generates the following two errors in the Event Viewer.
----------------------------------------------------------------------------------------------------------------
Error 1:
EventType clr20r3, P1 tc2sa_interface.exe, P2 1.0.0.0, P3 4e8b2197, P4 tc2sa_interface, P5 1.0.0.0, P6 4e8b2197, P7 137, P8 e3, P9 system.invalidoperationexception, P10 NIL.

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

Error 2:
Application: TC2SA_Interface.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.InvalidOperationException
Stack:
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(System.String[])
   at TC2SA_Interface.My.MyApplication.Main(System.String[])


For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.
----------------------------------------------------------------------------------------------------------------
What I did for the time being was to reopen the backup that the conversion wizard does, and add my changes into that code (exact same changes), and recompile with Visual Studios 2008 and deploy, and then it works again on the server.

I tried another application coded entirely in Visual Studios 2010 (targeting .NET framework 4) and it opens fine on the server, so i'm not sure what else it could be?  I read about putting the
            <startup useLegacyV2RuntimeActivationPolicy="true">
                <supportedRuntime version="v2.0"/>  
                <supportedRuntime version="v4.0"/>
            </startup>  
tags in the configuration file, but that didn't really help (although it provided me with the errors above, before it would just be the 1st error with .NET 2.0 listed as framework)

I'd really like to ensure that projects converted from older .NET frameworks are able to run on this server so that we can keep our applications up to date, but i'm at a loss as to why it won't run on the server, but will work fine on my PC.

(I can't really provide code, as it is happening before the application even opens, so it's not even making it to the form_load where the written code begins)

Thank you for any help.
0
Comment
Question by:lasenzait
  • 8
  • 7
15 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 36911082
Are you using any third party DLLs?
0
 

Author Comment

by:lasenzait
ID: 36911506
There is one 3rd party DLL, Iconic.Zip.dll, which could possibly be not the most recent version, but the application has already existed using this in .NET 2.0, and still works on my PC using this same dll in .NET 4.0.
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 36912224
Can you show us a screenshot of your references folder?

Also, try to use ProcessMonitor (free SysInternals utility) to see what files you exe is trying to access.
0
Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

 

Author Comment

by:lasenzait
ID: 36912782
I've attached a screenshot of the references in the project.  The problem with seeing what files the exe is trying to reference is that the EXE never fully opens, it shows up in task manager for a few seconds, then crashes and closes.
References.png
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 36912837
ProcessMonitor records all requests made by an exe. It will record those events even if the exe does not load fully.
0
 

Author Comment

by:lasenzait
ID: 36916293
I have run process monitor on the server with the new version of the application, but i'm not 100% sure what I should be looking for in here.  I've attached the log file from processmonitor in hopes that you might be able to help.

Thank you
Logfile.CSV
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 36916585
On the toolbar, there are buttons to enable/disable different types of events. Disable everything else except file access (there are registry, network... events). 748KB csv file is too big to read through.
0
 

Author Comment

by:lasenzait
ID: 36916731
Here is the file with everything except file access disabled.

Thanks again.
Logfile.CSV
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 36918080
I noticed the following


F:\Program Files\TC2SA Interface\ws2_32.dll      NAME NOT FOUND

F:\Program Files\TC2SA Interface\WS2HELP.dll      NAME NOT FOUND

F:\Program Files\TC2SA Interface\hnetcfg.dll      NAME NOT FOUND

F:\Program Files\TC2SA Interface\rsaenh.dll      NAME NOT FOUND

F:\Program Files\TC2SA Interface\PSAPI.DLL      NAME NOT FOUND

F:\Program Files\TC2SA Interface\crypt32.dll      NAME NOT FOUND

F:\Program Files\TC2SA Interface\uxtheme.dll      NAME NOT FOUND

F:\Program Files\TC2SA Interface\shfolder.dll      NAME NOT FOUND


Did you install the full .NET 4 framework or just client profile?
0
 

Author Comment

by:lasenzait
ID: 36918187
Both the Client Profile and the Extended profile are installed on the server.
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 36919374
Some of these files are Winsocks DLLs. Are you using any sockets/networking?
0
 

Author Comment

by:lasenzait
ID: 36919533
It connects to several SQL servers using connection strings, and copies some files to different windows shares, but nothing else major.  I just don't understand why if I compile the same code in Visual Studios 2008, it works fine on the server, but if I compile it in Visual Studios 2010 (after the conversion wizard) it works on my PC, but not on the server.
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 2000 total points
ID: 36919568
What else is different between VS2008 and VS2010? Just the framework version? There must be some DLL which is not working with the version 4.
0
 

Author Comment

by:lasenzait
ID: 36919715
Finally found it!  The problem was that there is a dll generated along with the building of the solution called Microsoft.VisualBasic.PowerPacks.Vs.dll which, when compiling with VS2008, is version 9.0, but when compiling with VS2010 is version 10.0.  For some reason, when I reran the installer, it didn't overwrite this file (it is a dependancy) even though it is included in the installer.  By manually copying the new dll to the folder, the application now works.  Thank you very much for your help.
0
 

Author Closing Comment

by:lasenzait
ID: 36919761
Amazing help, although i'm still not sure why from my PC, it would still work with the old dll, but from the server it would cause an issue.  Eitherway the steps to debugging and finding the issue were very helpful and will certainly be used in the future.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question