-2

I wrote an application with .Net4 and C# and also deploy it to user system with install shield.

After I changed few lines of code, one of my Winforms automatically disposes** without error in client system which has .Net4 but does not have Visual Studio installed.

All prerequisites are installed and it used to work fine...

If I install Visual Studio in client's system, it will work perfectly. I tried to debug it but visual studio does not find any exception.

Please help

Artemix
  • 2,113
  • 2
  • 23
  • 34
Sepehr Kazemi
  • 115
  • 1
  • 2
  • 7
  • maybe u need .net freamwork on machine and it installs with VS – Roar Apr 24 '13 at 07:49
  • @Roar Well, it worked before? – User 12345678 Apr 24 '13 at 07:50
  • 2
    @Sepehr What lines of code did you add? – User 12345678 Apr 24 '13 at 07:50
  • Have you checked your eventlog? – JMan Apr 24 '13 at 07:51
  • nobody could help you this way. What you should do is to write a log entry at each crucial steps and action of your APP. that way, when your program crashes as you say, you can go and inspect the log to find out, to what extent it ran. and then you can look from there. Besides, NO, you don't need visual studio to run an exe developed using visual Studio – Manish Mishra Apr 24 '13 at 07:51
  • What investigations have you done? How do you know it "automatically disposes" (and what do you mean by this term)? – Richard Apr 24 '13 at 07:53
  • I dont know exactly how can I get a log file in client system. can u help? – Sepehr Kazemi Apr 24 '13 at 07:58
  • There are two versions of .net 4 framework: Full version and Client Profile. With Visual Studio Full version is installed. Maybe on user system only Client Profile is installed and your 2 lines of code require full framework installation. See [Difference between .NET 4 Client Profile and Full Framework download](http://stackoverflow.com/questions/2759228/difference-between-net-4-client-profile-and-full-framework-download) for more details. – Artemix Apr 24 '13 at 08:10
  • What it says in the EventLog? Check there for the reason. It could be pretty everything. Please, update with the log, so we can have direction, and not guessing. – d.popov Apr 24 '13 at 08:11
  • @Artemix: My Client had .Net4 Client Framework and it was fine. can u help me I dont know anything about EventLog. – Sepehr Kazemi Apr 24 '13 at 08:15
  • @ByteBlast: I just deleted some table adapters and tables from my dataset. it is fine in computers with visual studio but disposes in other pcs. – Sepehr Kazemi Apr 24 '13 at 08:16
  • @d.popov: Can u help me make one so I can check it and find exact problem plz – Sepehr Kazemi Apr 24 '13 at 08:17
  • EventViewer: http://windows.microsoft.com/en-ph/windows-vista/open-event-viewer, or go to myComputer-> RightClick -> Manage -> EventViewer. Once there go to Windows -> Application log, and search the logs. Windows event log is a good thing to now how to use, for every windows developer. – d.popov Apr 24 '13 at 08:44
  • @d.popov: I cleared all logs and tried to run again. When winform closed again, it did not add any new log – Sepehr Kazemi Apr 24 '13 at 09:14
  • check also the other logs. also check the app.config file. if no, try to reinstall the framework. check all references in the project, and if necessary set the reference "Copy Local" to True. are you using any external COM objects. they can cause some behavior like what you dedcribe. what are these "fiew lines of code" – d.popov Apr 24 '13 at 09:25
  • @d.popov: checked them but I cant see any particular log. it was just few simple line. I think maybe my app is trying to access an invalid data in database. – Sepehr Kazemi Apr 24 '13 at 10:24
  • @d.popov: I found the exception. It is System.IO.FileNotFound... – Sepehr Kazemi Apr 27 '13 at 05:42
  • :) where did you found it? – d.popov Apr 29 '13 at 06:26

2 Answers2

0

Form may contain components that are not present in client's system.

It depends upon way in which you are deploying your application.

General way is:

  1. Install framework.

  2. Copy-Paste debug folder to client's system.

  3. Bring shortcut to desktop.

OR

  1. Simply publish the application.

  2. Copy paste publish folder to cliet's System.

  3. Execute publishing setup.

  4. Bring shortcut to desktop.

It works in this way.

Hope its helpful

Freelancer
  • 9,008
  • 7
  • 42
  • 81
0

You wrote on the user machine .Net 4 Client framework is installed. Try to uninstall it and install full .Net 4 framework (here is a link to MS download site).

Those 2 lines that you have added may now reference the features that are available only in full .Net 4 installation. (Unfortunately you did not post those lines so we can only guess what the problem is).

With Visual Studio full .Net 4 is installed and maybe because of this your app starts to work after VS installation.

See Difference between .NET 4 Client Profile and Full Framework download for more details.

Community
  • 1
  • 1
Artemix
  • 2,113
  • 2
  • 23
  • 34