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.
lasenzaitAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CodeCruiserCommented:
Are you using any third party DLLs?
0
lasenzaitAuthor Commented:
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
CodeCruiserCommented:
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
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

lasenzaitAuthor Commented:
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
CodeCruiserCommented:
ProcessMonitor records all requests made by an exe. It will record those events even if the exe does not load fully.
0
lasenzaitAuthor Commented:
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
CodeCruiserCommented:
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
lasenzaitAuthor Commented:
Here is the file with everything except file access disabled.

Thanks again.
Logfile.CSV
0
CodeCruiserCommented:
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
lasenzaitAuthor Commented:
Both the Client Profile and the Extended profile are installed on the server.
0
CodeCruiserCommented:
Some of these files are Winsocks DLLs. Are you using any sockets/networking?
0
lasenzaitAuthor Commented:
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
CodeCruiserCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
lasenzaitAuthor Commented:
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
lasenzaitAuthor Commented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.