473,326 Members | 2,182 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

.NET Compiler or Setup is Non-Deterministic, Solution?

This is a strange problem that's plagued me for years using the .NET tools.
The problem is this:

..NET applications installed on a virgin machine (framework installed, but no
..NET tools installed) fail with an expection when the application starts.

The application works in these configurations:

1) Runs in the debugger with Debug or Release builds
2) Release build, installed on a machine with the framework and .NET tools
installed
3) Debug build, installed on a virgin machine (framework installed, but not
the .NET tools)

The application only fails in this configuration:

1) Release build, installed on a virgin machine (framework installed, but
not the .NET tools)

The same project, compiled with the same tools, on the same XP Professional
OS creates non-functional installations on my desktop system, but the laptop
worked fine. A week ago, the laptop started having the same problem of
creating bad installations (again installations worked on everything, except
machines without the .NET tools). Installations are created using the .NET
built-in installer.

After trying everything, the solution to get the PCs to create successful
builds was to change each project Optimize Code setting to False, then build
the project; the installation works in release mode on a virgin machine.
Then go back and change Optimize Code to True; project now works in release
mode on virgin machines. Absolutly no code changes or other project settings
made. The PC now just works and creates successful builds for all machines.
I performed the same proceedure on my laptop and desktop PCs, both now work.
Unable to get a bad build on either machine now.

Is this a known tool bug? If so, how can I prevent this in the future? Same
code and same tool project options produced different results, which bothers
me.

A clue might be that the inner expetion text message was:

"File or assembly name Common, or one of its dependencies, was not found."
Common.dll is my mixed language DLL (managed and unmanaged C++). The file,
and its dependencies, were indeeded in the same directory.

The main exeception was: System.TypeInitializationException. My app has 4
projects: 2 C# DLLs, 1 C++ DLL, 1 C# EXE.

Thanks for any assistance.
Sep 27 '05 #1
5 1747

Well -- if 'optimize' means optimize for that CPU -- then, if, say, you
move code developed on a Celeron to an Athlon, maybe there would be
problems.

Dave L wrote:
The main exeception was: System.TypeInitializationException. My app has 4
projects: 2 C# DLLs, 1 C++ DLL, 1 C# EXE.

Thanks for any assistance.

Sep 27 '05 #2
All test systems running Intel non-Celeron CPUs.

Anyone else have any ideas? I can't find a single bit of info regarding this
problem.

Dave

"John Bailo" <ja*****@texeme.com> wrote in message
news:43**************@texeme.com...

Well -- if 'optimize' means optimize for that CPU -- then, if, say, you
move code developed on a Celeron to an Athlon, maybe there would be
problems.

Dave L wrote:
The main exeception was: System.TypeInitializationException. My app has 4
projects: 2 C# DLLs, 1 C++ DLL, 1 C# EXE.

Thanks for any assistance.


Sep 27 '05 #3
Further testing reveals the Optimize Code option seems to have no effect.
The solution seems to be this:

1) Open the solution

2) Set the Configuration Manager to "Release"

3) Exit Visual Studio

4) Start Visual Studio and open the solution again

5) Preform the build (solution still has the "Release" setting above)

It seems that if a Debug build is used, then a swith to Release will
sometimes not be successful. Visual Studio needs to startup with the projuct
already set to Release. I think something in the VS compiler still has
leftover dependencies on debug MFC dlls, even though a switched to Release,
a clean solution, and total rebuild is performed.

Any confirmation of this VS bug?
Sep 30 '05 #4
Dave L wrote:
It seems that if a Debug build is used, then a swith to Release will
sometimes not be successful. Visual Studio needs to startup with the projuct
already set to Release. I think something in the VS compiler still has
leftover dependencies on debug MFC dlls, even though a switched to Release,
a clean solution, and total rebuild is performed.


Could it be that your references, which are attached to the release or
debug build are different.

That is:

..exe Debug build uses

Ref1.dll (Debug)
Ref2.dll (Release)
..exe Release build uses

Ref1.dll (Release)
Ref2.dll (Debug)

Sep 30 '05 #5
Nope. Same references in Debug and Release.

I think the VS build just contains a stale reference to a debug MFC version
DLL even though a complete rebuild is performed. Exiting VS and starting
again, with the Configuration Manager already set to Release seems to fix
it. Least there is a work around, but it was difficult to find.

Dave
Oct 6 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jeff Epler | last post by:
Hello. Recently, Generator Comprehensions were mentioned again on python-list. I have written an implementation for the compiler module. To try it out, however, you must be able to rebuild...
3
by: dbrown2 | last post by:
I'm trying to understand and document how to install pypar on Win2k. Pypar needs to be installed with some MPI library code and also needs libpython23.a and other files which are not included with...
188
by: Ilias Lazaridis | last post by:
I'm a newcomer to python: - E01: The Java Failure - May Python Helps? http://groups-beta.google.com/group/comp.lang.python/msg/75f0c5c35374f553 - I've download (as suggested) the python...
7
by: Matthew Del Buono | last post by:
Don't try to solve the problem. I've found a way -- around or fixing it. I'm just curious as to whether this is Microsoft's problem in their compiler or if there's a standard saying this is to be...
55
by: Steve | last post by:
I have to develop several large and complex C++ hardware test programs that should work under DOS, most likely with 32-bit DOS extender. Development workstation OS would be Microsoft XP. Quite some...
1
by: Ilias Lazaridis | last post by:
If I understood things right, setuptools extends the functionality of distutils Thus replacing within a setup.py: from distutils.core import setup with try:
22
by: James Stroud | last post by:
Hello All, This is annoying. I am trying to build scipy right now but every .so file requires my adding "-lpython2.5 -lpthread -lm -lutil -ldl -shared" to the ld flags. Main Question: When...
13
by: Albert | last post by:
Hi I'm using the lcc compiler for win32. I tried compiling a program but there's an error stating: "cpp: Can't open input file clrscr()" I don't get it - I've included <tcconio.h>. (strange why...
0
by: Grant Edwards | last post by:
I've got a system where I try to install extensions using /usr/local/bin/python setup.py install But, it fails when it tries to use a non-existant compiler path and specs file. I suspect it's...
5
by: spectrumdt | last post by:
Hello. I am trying to extend my Python program with some C code. This thread is sort of a follow-up to another thread of mine, linked below. I don't know what the conventions are in this...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.