|
-
Sep 5th, 2009, 09:37 PM
#1
Thread Starter
Hyperactive Member
Really Frustrated
I've been using VB 2008 now for a couple of months and I've made the transition from VB6 quite well.
Now, I've hit a granite wall. I cannot take a simple application and have it run on another computer. I've been on this most of the day. I thought all I needed on the other computer was the correct version of Framework.
I've tried around a dozen variations of "deployment" files and none have worked. When I try to run my application, I get the pop-up that says it has encountered a problem and needs to close.
I don't know where to go with it now. I am considering reworking the entire project in VB6. I know I can move that and have it run properly.
This appears to be an issue that needs some major attention at some level by Microsoft. As to what it needs exactly, I have no idea. What I do know is that it does not work.
-
Sep 5th, 2009, 10:06 PM
#2
Re: Really Frustrated
This appears to be an issue that needs some major attention at some level by Microsoft
I can understand your frustration, but I doubt it's an issue with Microsoft.
Maybe you can begin by telling us the method of deployment you've used. We'll also need to know what type of computers you're attmepting to install it on, Framework version, and which framework you're targeting.
Also, if it is failing on load, there might be something that isn't loading correctly on those machines.
Have you tried walking through the code with break points?
Any actual information pertaining to errors and the application will help us identify your issue.
CodeBank contributions: Process Manager, Temp File Cleaner
 Originally Posted by SJWhiteley
"game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....
-
Sep 5th, 2009, 10:12 PM
#3
Re: Really Frustrated
I agree. I've only written a few dozen programs in .NET, and about a quarter that in installation routines (I think that's true, and I can't quite say why it is...I think that half the programs are perpetual beta) without an issue. I can see that what you are doing would be frustrating, but it doesn't happen all that often, so something odd is going on, and perhaps we can help you track it down.
My usual boring signature: Nothing
 
-
Sep 5th, 2009, 11:10 PM
#4
Thread Starter
Hyperactive Member
Re: Really Frustrated
 Originally Posted by weirddemon
I can understand your frustration, but I doubt it's an issue with Microsoft.
Maybe you can begin by telling us the method of deployment you've used. We'll also need to know what type of computers you're attmepting to install it on, Framework version, and which framework you're targeting.
Also, if it is failing on load, there might be something that isn't loading correctly on those machines.
Have you tried walking through the code with break points?
Any actual information pertaining to errors and the application will help us identify your issue.
The computer in question is an HP Pavilion with a P4 CPU and 1 GB of RAM running XP SP2.
I downloaded and installed .Net Framework 3.5 and Windows Installer 3.1 prior to trying to install my app.
The first attempt was to put the application on a flash drive and move it that way. When this failed, then I went to the deployment packages.
After this, I tried a 3rd party install application. In every case, I get the error reporting pop-up with says the applications has encountered an error and needs to close. It never completely loads.
Here's a bit of information from the error reporting dialog:
Event Type: CLR20R3 System.InvalidOperationException.
It runs fine on this computer which has VB2008 installed. The other one has almost nothing at all. Just the OS.
Edit: I tried another app that I wrote and it loads and runs just fine, so it is something specific to this application that happens during the load process. I don't see anything unusual in the declarations or the form-load section.
Last edited by storm5510; Sep 5th, 2009 at 11:36 PM.
-
Sep 6th, 2009, 12:49 AM
#5
Fanatic Member
Re: Really Frustrated
The other folks who have responded probably have much better information than I do on this. However, I have run into this occasionally, when I have asked the framework to do something it can't do during component intialization.
The first thing I would do is go back to my source code, and examine all of my initialization code that would occur during start-up.
In my case, the problem did NOT show it's face in the compiler as an error or warning until run-time. Mind you, I had not yet even tried to place my app on another machine; it was behaving similarly to what you describe in the development environment. But only when the project was loaded with the form which was the error source showing in the design window.
It turned out that there was a problem in the initialization of a custom control I had created, which was occurring as part of the host form's initialization.
Since vs kept trying to execute the offending code in order to load the project and display the form in the designer, the project could not complete loading, even to the point of allowing me to diagnose. SO vs would error out and close.
Eventually, I created a NEW project, used "Add Existing Ite" to bring in one component at a time (in order from the first item to initialize on up). THEN, I Commented out All the code in suspect Methods, and ran the debugger; If the load succeded, I did it again, after uncommenting another line or code block, until the problem reared it's ugly head.
Like I said, vs for some reason did NOT recognize the problem either in as a warning, or an error at design time. eventually, and as long as the initialization routine which contained the error was not required to display a from in the designer, the error would rear it's head during the Build process.
I never actually was able to make sense of what was causing the problem, other than to remove the offending line of code. As I recall, it had to do with a GDI + Drawing function ("Draw Text I believe). Since I was totally learning how to use GDI + at the time, I doesn't surprise me that I tried to do something stupid!
Good Luck.
-
Sep 6th, 2009, 01:45 AM
#6
Thread Starter
Hyperactive Member
Re: Really Frustrated
I checked the event log on the other computer. It's related to Framework 2.0. I found some information on different sites about it, but nothing really relative to what I have. One site said it was a null pointer in a C# or C++ library. I thought about changing some, or all, of my data type declarations. I considered installing VB2008 on the other computer to debug, but I was afraid that doing so would mask the problem.
It runs fine on my primary computer. There is a lot of hardware differences between this one and the other. They both have the same OS, XP Pro SP2. I'll just have to experiment a bit and see if I can figure out what it is. Some of the sites I visited asked for anyone to post solutions they found.
-
Sep 6th, 2009, 02:09 AM
#7
Re: Really Frustrated
Did you move all files from your bin (or Debug/Release) folder on your dev machine to the target machine? On the target machine are you using a local folder or a network location?
Are you using Crystal Reports in your application?
-
Sep 6th, 2009, 03:08 AM
#8
Thread Starter
Hyperactive Member
Re: Really Frustrated
Only from the "Release" parent folder. It had some sub-folders. I didn't move the contents of those. No Crystal.
As I suspected, when I installed VB2008 on that machine, my app would run. The setup jumped over the .NET Framework installs because they were already there. It only installed VB2008 and some small SQL items below it on the list.
So, what I did turned out to be self-defeating. I also have a laptop I could try it on, but it is has Vista on it. I suspect it would run on that without anything extra on my part.
-
Sep 6th, 2009, 11:49 AM
#9
Fanatic Member
Re: Really Frustrated
Do you possibly have dependencies between your project which are not complied into the release .exe or .dll
-
Sep 6th, 2009, 11:55 AM
#10
Thread Starter
Hyperactive Member
Re: Really Frustrated
I didn't add anything extra to it. There was something it needed that installing VB2008 supplied. No sure how to track it down now.
-
Sep 6th, 2009, 12:20 PM
#11
Re: Really Frustrated
Hey,
The best way to start tracking this down would be to look at what references you have added to your project. Are they all part of the .Net Framework, or have you got any external references? If you do, it is likely that you will have to bundle these into the installer as well.
Another thing to check would be Service Packs, and security fixes for the .net framework. Go to Windows Update on the target machine and make sure everything is up to date.
One other question I would have is, is the error generated when you try to install the application, or when you try and run it for the first time.
Gary
-
Sep 6th, 2009, 12:48 PM
#12
Thread Starter
Hyperactive Member
Re: Really Frustrated
The references was something I looked at hard on the project settings page. The items were not marked for inclusion. "Copy Local" is set to false on every file.
The error message seemed to point to Framework 2.0. In the references, there is an item from Framework 2.0: System.dll.
Perhaps this was the issue.
-
Sep 6th, 2009, 02:38 PM
#13
Re: Really Frustrated
Hey,
You mentioned that you had installed .Net 3.5, have you also installed .Net 2.0. I assume you would have had to do this, since .Net 3.5 is based on .Net 2.0, but I don't think I have ever installed .Net 3.5 without .Net 2.0 being installed.
I assume it must install it if it isn't there.
You never answered the other part of my question. Does this error occur during installation, or when you try and run the application.
Also, what exactly does this application do?
Gary
-
Sep 6th, 2009, 03:03 PM
#14
Re: Really Frustrated
 Originally Posted by storm5510
I didn't add anything extra to it. There was something it needed that installing VB2008 supplied. No sure how to track it down now.
A normal .net executable should run by just copying and running it on a PC that has the framework installed.
For a test, just make a dummy executable (ony 1 form, "Hello World" type ). Does that work?
-
Sep 7th, 2009, 10:24 PM
#15
Thread Starter
Hyperactive Member
Re: Really Frustrated
I refuses to run on my laptop which has Vista on it. It only has Framework 3.5 SP1 on it. No 2.0. I have another VB2008 app that runs on the laptop just fine.
The error is the same, CLR20R3. It happens when I try to run the program, as before.
Edit: When I use Windows Explorer on the laptop and look at Windows\Microsoft.NET\Framework, I find folders for v1.0.3075, v1.1.4322, v2.0.50727, v3.0, and v3.5.
Last edited by storm5510; Sep 7th, 2009 at 10:31 PM.
-
Sep 8th, 2009, 01:43 AM
#16
Re: Really Frustrated
Hey,
So that suggests that you have all the necessary frameworks installed.
You still haven't told us what the application is doing? It may be the case that it is trying to do something that is prevented in Vista with it's new security model.
Gary
-
Sep 8th, 2009, 08:41 AM
#17
Fanatic Member
Re: Really Frustrated
It's been a while, but I seem to recall having to download some extra stuff when I installed vs Express on a friend's laptop that was running Vista. It MIGHT have been sp2 that was required.
Not sure if any of that would affect how an app was compiled; it seems to me that one should be able to compile an .exe or .dll for distribution, and it should all work fine on ANY machine.
THIS is what I was wondering about:
The references was something I looked at hard on the project settings page. The items were not marked for inclusion. "Copy Local" is set to false on every file.
DO you have anything added as a reference to your project (such as a .dll of your own creation, which lives on your development mchine but is NOT present on your Laptop) which is NOT being copied local, therefore NOT available to the app on the laptop?
This same thing would apply to Resource files (I think) if you have set some reqources in the app Settings and have NOT indicated that they be compiled into the app (Defulat, for images anyway, is to link at compile time). I could be wrong about this, but it's worth looking into.
-
Sep 8th, 2009, 10:42 AM
#18
Thread Starter
Hyperactive Member
Re: Really Frustrated
The program is a prime number sieve using a lot of ULong declarations. I intended on running it a long time.
I didn't create any Dll's or resource files.
Remember, this failed on my old computer with XP SP2 until I installed VB2008 on it.
-
Sep 8th, 2009, 11:26 AM
#19
Re: Really Frustrated
Hey,
Based on what you have said, I can't think of any reason why this would be happening.
How big is your project, and how sensitive is the contents? Is it possible you can provide the source code so that we can have a look?
Gary
-
Sep 8th, 2009, 07:44 PM
#20
Thread Starter
Hyperactive Member
Re: Really Frustrated
 Originally Posted by gep13
How big is your project, and how sensitive is the contents? Is it possible you can provide the source code so that we can have a look?
The problems seems to be in the loading, so I'll give that part first.
First, the declarations:
Code:
Dim Number As ULong
Dim LastFound As ULong
Dim Half As ULong
Dim Found As ULong
Dim Counter As ULong
Dim TimeCounter As ULong
Dim LastNameUsed As Integer
Dim LenOfFile As Integer
Dim LenOfEntry As Integer
Dim tickCount As Integer
Dim Iteration As Short
Dim IterCount As Short
Dim TotalTime As Single
Dim ExitFlag As Boolean
Dim FilePath As String
Dim fName As String
Dim idxString As String
Dim DataFile As System.IO.StreamWriter
Dim IdxFile As System.IO.StreamWriter
Const AppName = "Prime2V4"
Const idxfName = "_Index.Txt"
Const Section = "Settings"
Const vString = "Prime2 - v4.2.4 [20090904]"
Const MaxSize = 1048576
Below is the form load sub:
Code:
Private Sub frmMain_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Me.Text = vString
TimeCounter = CULng(GetSetting(AppName, Section, "TimeCounter", "0"))
Number = CULng(GetSetting(AppName, Section, "Number", "1"))
LastFound = CULng(GetSetting(AppName, Section, "LastFound", "0"))
Counter = CULng(GetSetting(AppName, Section, "Counter", "0"))
Found = CULng(GetSetting(AppName, Section, "Found", "0"))
LastNameUsed = CShort(GetSetting(AppName, Section, "LastNameUsed", "0"))
Iteration = CShort(GetSetting(AppName, Section, "Iteration", "0"))
IterCount = Iteration
TotalTime = TimeCounter / 3600
UpdateDisplay()
Me.shp1.FillColor = Color.Red
FilePath = Command() & "\"
End Sub
That sub calls "UpdateDisplay" which is fired by a timer at one second intervals, once it is enabled.
Code:
Sub UpdateDisplay()
Me.lblTested.Text = FormatNumber(Counter, 0, TriState.False, TriState.False, TriState.True)
Me.lblFound.Text = FormatNumber(Found, 0, TriState.False, TriState.False, TriState.True)
Me.lblRunTime.Text = FormatNumber(TotalTime, 3, TriState.True, TriState.False, TriState.True)
Me.lblLastPrime.Text = FormatNumber(LastFound, 0, TriState.False, TriState.False, TriState.True)
Me.lblFileName.Text = fName
Me.lblSize.Text = FormatNumber(LenOfFile, 0, TriState.False, TriState.False, TriState.True)
Me.lblIteration.Text = CStr(Iteration)
End Sub
Once these three finish, the program just sits and waits for a command button to be clicked.
Whatever the problem is, it is right here.
-
Sep 8th, 2009, 07:49 PM
#21
Re: Really Frustrated
I'm pretty sure that this part would cause an error.
Code:
Const AppName = "Prime2V4"
Const idxfName = "_Index.Txt"
Const Section = "Settings"
Const vString = "Prime2 - v4.2.4 [20090904]"
Const MaxSize = 1048576
You need to state the datataype, which I'm guessing is a string for the first ones and integer for the last?
I don't have much experience with Constants so maybe you don't have to do that, because I was pretty sure it would raise an immediate error and not even let you debug your program until you fixed the datatype, which would have been fixed by you.
-
Sep 8th, 2009, 08:54 PM
#22
Thread Starter
Hyperactive Member
Re: Really Frustrated
I've never done that before, but it makes sense. This is something Option Explicit should catch, but doesn't. I think I now what the syntax needs to be:
Code:
Const AppName As String = "Prime2V4"
-
Sep 8th, 2009, 09:09 PM
#23
Lively Member
Re: Really Frustrated
Yes, this is something that you will have to do. Assign a datatype to your variables.
Such as:
Const AppName as string = "Prime2V4"
Const idxfName as string = "_Index.Txt"
Const Section as string = "Settings"
Const vString as string = "Prime2 - v4.2.4 [20090904]"
Const MaxSize as integer = 1048576
-
Sep 8th, 2009, 09:10 PM
#24
Re: Really Frustrated
 Originally Posted by storm5510
This is something Option Explicit should catch, but doesn't.
No, it isn't. Just as the documentation says, Option Explicit On requires that you explicitly declare a variable before using it. It doesn't require that you specify the type of that variable. If you don't specify a type then Object is assumed. It is Option Strict On that enforces strict typing and requires you to specify the type of everything you declare.
-
Sep 8th, 2009, 09:12 PM
#25
Thread Starter
Hyperactive Member
Re: Really Frustrated
Good idea, but it didn't solve the problem. I'll make a point to remember it though.
-
Sep 8th, 2009, 11:34 PM
#26
Re: Really Frustrated
I assume this code runs fine on your computer, correct.
So it probably isn't the code directly but possible files that your code needs like _Index.txt.
Is that on the target machine? Is it in the right spot? Is anything about the location hard coded to the location on your dev machine? Something in GetSetting maybe (or is that a framework function I've just never heard of).
To make life easier what we need is a more helpful message so I'd suggest wrapping your code in a Try Catch block like this:
vb Code:
Private Sub frmMain_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Try Me.Text = vString TimeCounter = CULng(GetSetting(AppName, Section, "TimeCounter", "0")) Number = CULng(GetSetting(AppName, Section, "Number", "1")) LastFound = CULng(GetSetting(AppName, Section, "LastFound", "0")) Counter = CULng(GetSetting(AppName, Section, "Counter", "0")) Found = CULng(GetSetting(AppName, Section, "Found", "0")) LastNameUsed = CShort(GetSetting(AppName, Section, "LastNameUsed", "0")) Iteration = CShort(GetSetting(AppName, Section, "Iteration", "0")) IterCount = Iteration TotalTime = TimeCounter / 3600 UpdateDisplay() Me.shp1.FillColor = Color.Red FilePath = Command() & "\" Catch ex As Exception Msgbox(ex.ToString) End Try End Sub
Run that on the target machine and see if anything helpful pops up.
-
Sep 9th, 2009, 12:15 AM
#27
Thread Starter
Hyperactive Member
Re: Really Frustrated
I put the Try - Catch in just as shown. I didn't see anything any different on the laptop. Just the same message as before. Below are some details:
Problem Event Name: CLR20r3
Problem Event Signature 01: prime2.exe
Problem Event Signature 02: 1.5.2.0
Problem Event Signature 03: 4aa735f0
Problem Event Signature 04: Prime2
Problem Event Signature 05: 1.5.2.0
Problem Event Signature 06: 4aa735f0
Problem Event Signature 07: d
Problem Event Signature 08: c6
Problem Event Signature 09: System.InvalidOperationExceptioin
OS Version: 6.0.6001.2.1.0.768.2
Locale ID: 1033
-
Sep 9th, 2009, 12:50 AM
#28
Re: Really Frustrated
Hey,
Is your application called Prime2? Or are you calling another external program?
Where exactly are you seeing this error message? Are you getting a window which says there was an unhandled exception?
Gary
-
Sep 9th, 2009, 01:12 AM
#29
Thread Starter
Hyperactive Member
Re: Really Frustrated
 Originally Posted by gep13
Hey,
Is your application called Prime2? Or are you calling another external program?
Where exactly are you seeing this error message? Are you getting a window which says there was an unhandled exception?
Gary
Prime2 is the name and yes, I get a window for an unhandled exception.
I have an application here called "Dependency Walker". What it does is to display all the modules a program or library is dependent on. I put it on the laptop and pointed it to my application.
The first thing that jumps out is a message in red. It says, "Warning: At least one module has an unresolved import due to a missing export function or a delay-load dependent module."
This points at two files: ieframe.dll and shlwapi.dll. Beyond that, I'm not sure what the meaning is.
Note: on my XP desktop, which the app will run on, points to a totally different file, mpr.dll. Same error message.
Last edited by storm5510; Sep 9th, 2009 at 01:15 AM.
-
Sep 9th, 2009, 01:16 AM
#30
Re: Really Frustrated
Hey,
I haven't played with any of those dll's so I can't give you much of a clue on that score, but the question would be, do you have references to any of those dll's in your application? If so, have you included them in your installation package so that they can be placed on the machine that you are installing onto?
Gary
-
Sep 9th, 2009, 02:50 AM
#31
Thread Starter
Hyperactive Member
Re: Really Frustrated
No. The references listed are those created as the result of the small group of libraries that VB2008 uses for all applications compiled within. In short, I have no customs. I didn't need any.
-
Sep 9th, 2009, 08:23 AM
#32
Re: Really Frustrated
Is it possible that something is wrong with the .NET framework on your target PC? Like version, servicepacks etc? This because the the CLR compiler generates errors. Check the versions on your development pc and your target pc. Perhaps deinstall and install again and use windows update.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|