Avatar of lasenzait
lasenzait

asked on 

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

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.
Visual Basic.NETWindows Server 2003Windows XP

Avatar of undefined
Last Comment
lasenzait
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Are you using any third party DLLs?
Avatar of lasenzait
lasenzait

ASKER

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.
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

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.
Avatar of lasenzait
lasenzait

ASKER

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
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

ProcessMonitor records all requests made by an exe. It will record those events even if the exe does not load fully.
Avatar of lasenzait
lasenzait

ASKER

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
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

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.
Avatar of lasenzait
lasenzait

ASKER

Here is the file with everything except file access disabled.

Thanks again.
Logfile.CSV
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

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?
Avatar of lasenzait
lasenzait

ASKER

Both the Client Profile and the Extended profile are installed on the server.
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Some of these files are Winsocks DLLs. Are you using any sockets/networking?
Avatar of lasenzait
lasenzait

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of lasenzait
lasenzait

ASKER

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.
Avatar of lasenzait
lasenzait

ASKER

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.
Windows Server 2003
Windows Server 2003

Windows Server 2003 was based on Windows XP and was released in four editions: Web, Standard, Enterprise and Datacenter. It also had derivative versions for clusters, storage and Microsoft’s Small Business Server. Important upgrades included integrating Internet Information Services (IIS), improvements to Active Directory (AD) and Group Policy (GP), and the migration to Automated System Recovery (ASR).

129K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo