|
The application works fine on my other development machine, so it's not the connection string.
When CATCHing the error, I get "Object reference not set to an instance of an object".
Doesn't tell me much.
I noticed the same with an application I'd made using ChartFX for .Net as well. I'd forgotten to distribute the required ChartFX DLL as well. I'm not using any strange ones though in this project, and as mentioned, the problems started happening when I started using the System.Data.OleDB stuff.
Any ideas anyone?
Pauwl
|
|
|
|
|
Here's a thought...debug your application!
Put a breakpoint at the top of your try block and step through the code in your debugger. After all, debugging your app is just as important in the development cycle. Look at each reference while stepping through and figure out what's null and on which line the exception is thrown.
And the redistribution of the .NET framework has nothing to do with it. It's the same on every machine, except some things are not supported on Windows (only Windows NT) because of the underlying OS. Anything in System.Data.OleDb should be fine because there's nothing OS-specific, but make sure you're running the right version of the .NET Framework on both machines because the various framework versions (i.e., 1.0, 1.1, etc.) are not 100% backward and forward compatible.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Heath,
funny thing is, when I run the application on a machine with a debugger - no problem.
we have 2 development machines, and 2 test machines.
We've just re-installed one development machine with Win2K. The other has XP on it.
The test machines are Win2K and XP as well.
If I run the application on either of the development machines, no problem. As soon as I move to one of the test machines (which have Framework 1.1 isntalled, and as far as I can see, exactly the same DLL's as the development machines), it stops working.
Other .Net apps I create work fine, but just as soon as I have something use the System.Data stuff, it no longer works. Strange. Have tried moving the DLL's over as well.
I'll make a sample app, and post the whole code, see if anyone can reproduce it.
thanks,
Pauwl
|
|
|
|
|
Do you run the test machines under different credentials while using integrated security on the RDBMS? Did you check the code access security policies (with the Microsoft .NET Framework Configuration tool in Administrative Tools)?
It could also be that the computer itself has different restrictions according to a domain policy. I know I don't let our test bay have the same privileges as the development machines on our little network.
There's obviously a reason for it, but the framework has nothing to do with it. Something that's affecting the functionality of the framework (i.e., user permissions, code access policies, or domain restrictions) is at fault. The framework will work the same from computer to computer without such things in place. That's kind of the whole idea of a unified framework as opposed to all sorts of DLL versions in DLL hell.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
This means your're creating an object using some API and it's returning a null. You're then trying to access properties or methods on this object.
I'd take a look at the StackTrace property of the exception and display that in your messagebox (or however you're displaying what you have above). That should give you the line number etc. (at least on a debug version of the code, not sure on release actually).
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|
|
All,
thanks for the comments and assistance. I've now found out what's causing it, but still don't know why.
When I log on to either of the development machines and run the application, it works fien. When I logon to the test machines AND LAUNCH THE APPLICATION FROM THE NETWORK then it bombs out. If I copy the files to the local test machine, it then works fine.
It's sorted me out enough to carry on testing, but still very unsure of why this could be happening.
Any ideas welcome, but I have my workaround for now
Pauwl
|
|
|
|
|
All System.Data stuff requires MDAC version 2.7 or greater, which is not installed as a component of .NET Framework (1.0 or 1.1). You can get it here[^].
However, before you install that, I'd suggest installing the VS.NET remote debugging components on your test machines so that you can debug them from your development machines. Do this, and you can be sure that it's MDAC's absense that's causing a problem, and not something else in your code.
--
Russell Morris
"So, broccoli, mother says you're good for me... but I'm afraid I'm no good for you!" - Stewy
|
|
|
|
|
I know that I have Data in the clipboard with the DataFormat.MetafilePict.
But I can't get it. My code is more or less the next:
/////////////////////////////////////////////////////////////
IDataObject iData = Clipboard.GetDataObject();
if ( iData.GetDataPresent( DataFormats.MetafilePict) )
{
System.Object obj;
System.Drawing.Imaging.Metafile pMetafile;
obj = Clipboard.GetDataObject()>GetData(System.Windows.Forms.DataFormats.MetafilePict );
}
/////////////////////////////////////////////////////////
Obviusly in the Debug, I enter inside the first if condition, so the code executes but the System::Object obj can't keep the data of clipboard and keeps a undefined value after the asignation.
It seems a contradiction, isn't it ?
Can anybody say me anything about get MetafilePict Data from Clipboard ?
Advanced Thanks, everybody.;)
|
|
|
|
|
(Not saying this is your problem, but...)
As written, the code you supplied will not work as you expect.
You declare "System.Object obj;" inside the if() statement. Therefore as soon as you exit the block (next line) - obj is no longer a valid object.
To correct this (if it isn't just a typo in your sample), move the System.Object obj; declaration before the if( Data.Get....) statement.
|
|
|
|
|
OK, thanks for reply, there was only an exemple. You are right, but if you proove the code with the correct order ( as you very well are saying ), you will see that doesn't work well ( The object 'obj' doesn't keep the data..).
I have read in Microsoft support that there is a debug in this cases that imposibility the correct retriving some kind of Data from Clipboard, as Metafiles ( I hope that the next version of .NET will correct this cuestion.)
Thank you very much Arlen
|
|
|
|
|
Can anyone help ?
A web site sends purchasers an email containing a unique URL. This page contains a button which initiates the download of their new software. Whilst this works well and allows us to track access I've got one small practical problem: When the download completes the user is left looking at the same page. I'd much prefer it if they were redirected to (say) a 'Thank you' page once the transfer is complete.
My C# code currently calls the Response.Redirect method with the URL of the file in question. But of course once this finishes the connection has been closed.
Is there a better way to do this ? Can anyone point me to an example please ?
Many thanks
Jerry
|
|
|
|
|
If I'm understanding you correctly, I've never seen a webpage detect when a download is finished since it starts another stream to download the file. This is outside of the Response you're currently interfacing with the user on. I think your best bet would be javascript that goes to a thank you page and then starts the download. I have seen pages do that.
In any event, you might have better luck posting this on ASP.NET forum since it's pretty ASP.NET specific.
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|
|
Thanks. I thought as much ...
|
|
|
|
|
I'm assuming this is relatively easy and my n00b status is hindering me. I have a set of .DLLs written in C# that want to be able to distribute to other members of development, and instead of them having to browse the hard disk to find my .DLL to place a reference into their app, I want it to come up in the list .NET references.
I had assumed that once a .DLL was given a strong name that perhaps the reference list would also show my libraries - but alas no! Is this something relatively easy to do, or are my developers forced to browse reams of folders!
Ta.
|
|
|
|
|
An assembly must be registered with the Global Assembly Cache to be accessible outside the application directory. Further, an assembly must be strong named to be added to the GAC.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/html/cpgrfglobalassemblycacheutilitygacutilexe.asp
|
|
|
|
|
Putting something into the GAC is not enough I believe to make it show up in assemblies you can reference from inside the IDE (add reference, first tab). There's some registry entries I believe as well, but I can't find that info at the moment.
EDIT: Found the KB article
Putting Assemblies into Reference List
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|
|
Thanks for that, that was the answer. Your help is much appreciated.
|
|
|
|
|
Another options if they are allowed to have the source (even if read-only) is to let them add the projects to their solution and insert a project reference (it's actually a VS.NET thing where the output of a project - depending on the current build configuration (debug, release, etc.) - is copied to the bin directory of the target project. It's handy in multi-developer projects where everyone works on various projects.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Oh yes, this is absolutely an option available to the coders. I wanted to have the best of both worlds. Unfortunately though during development everyone can pick and choose the common components with ease, we're having a bastard time at run-time.
Despite having placed the .DLLs in the GAC, the executables cannot find their dependant .DLLs. They only function when the .DLL is sitting in the exe's own directory.
I have now lost 50% of my hair. Expecting the other %50 to disappear today.
|
|
|
|
|
If you have a application config file, make sure that you're not explicitly setting the codebase for dependent assemblies. Otherwise, you're .NET installation is screwed up. Dependency resolution first checks the current and private paths (like the bin folder in ASP.NET applications), then it looks in the GAC for assemblies.
One you thing you could do to see why the bindings aren't occurring is to start fuslogvw.exe, make sure logging is turned on, then start your application. Refresh fuslogvw and see what it says. If it states something about not being able to find the localized resources for your default locale (like mine is "en-US"), you can either ignore these - or to make your assembly resolution faster, add the assembly-level attribute assembly: System.Globalization.NeutralResourcesLanguage("en-US"); (with the appropriate locale).
For each binding error, it will show you everywhere it attempted to look which might help you resolve the problem.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Is it possible to consume serviced components deployed on Windows 2000/XP machine from Windows 98 based machine?
I am using serviced components written in C# to present my business logic components and I have deployed them in a server application in the COM+ catalog. I have exported the application into a proxy library for deployment on client machines.
Client components are developed in C# also and are deployed on a Windows 98 machine. Then I installed the proxy library on the client machine and run the client application. For my surprise I got an exception in the EnterpriseServices namespace telling me that a static initializer failed!
If anyone has encountered such a problem, please share your knowledge ot the subject.
Sandman
|
|
|
|
|
I didn't install IIS on my local machine, and am trying to create a new web project and do want to point to a remote IIS. What are the steps involved for me to be able to do that?
|
|
|
|
|
I want to build a voice-chat program, so if you have any helpful information, please tell me.
thanks.
|
|
|
|
|
Hello everybody!
I'm a beginner developer in .Net and I need to know if I can convert Bitmaps to Metafiles in anyway. ( The Save method of the Image Class does´nt work beetwen vectorial images and pixelized images ).
Advanced Thanks!
|
|
|
|
|
Hi All,
Is it possible to have a .NET Server Application talk to a simple DCOM Client.
How should be the server and the client application be setup to work? I need
some articles which can explain a system where the .Net server communicates
with the DCOM client.
Any reference articles would be useful.
Abhishek.
Learning is a never ending process of Life.
|
|
|
|