|
2 Vista machines: building a Windows app on machine 1 and deploying to the test server works fine.
Building the exact same app on machine 2 and deploying to the same server fails.
It won't launch. In the Windows Application log shows .NET Runtime 2.0 Error Reporting and system.io.fileloadexception.
Both machines have the same .NET Runtimes installed so, I'm thinking this could be a security issue with machine 2?
Any thought?
Thanks.
|
|
|
|
|
UsielDR wrote: In the Windows Application log shows .NET Runtime 2.0 Error Reporting and system.io.fileloadexception.
UsielDR wrote: Any thought?
I think I would want to know that the message in that exception is.
|
|
|
|
|
Hello,
is it possible to find a window with the WIN32 API Function "FindWindow" in a VB.NET Service ?
If I search in a VB.NET Service with the Function Win32API.FindWindow, I don't find the specified Window. FindWindow sets the windows handle to 0. If I make the same search in a Form, FindWindow find the specified Window.
'I need following Function
' FindWindow searches for a window by class name and window name.
hWnd_Alarm = Win32API.FindWindow(txtClassName_Alarm, txtWindowCaption_Alarm)
Can anybody help me ?
Thanks
Best Regards
kl_ko
|
|
|
|
|
Bad news - services run under an entirely different desktop than the one the user sees. Screen savers have their own desktop, as well as the Ctrl-Alt-Del screen, and others...
Your service can't find the window because it doesn't exist on the same desktop as the service is using. To change this, you have to go into the Service Manager and change the LogOn type of your service to run as the Local System, then enable the checkbox that says something like "Allow service to interact with Desktop".
Though, services should NOT be interacting with the desktop anyway. What would your service do if noone is logged on???
|
|
|
|
|
Hello Dave,
thank you for your helpfull answer ! It has taken me another step towards my target.
Yes, Windows Vista isolates services in Session 0 and runs applications in other sessions.
In XP my code is running, because services run in Session 0 along with my application (casual).
usefull link to a white paper:
http://www.microsoft.com/whdc/system/vista/services.mspx
I think I found some information to realize it under Vista (maybe !?) with the CreateProcessAsUser function to create a process in the user's session.
But at the moment I don't know if this is the right way ! Mainly in regard to security.
Anymore I didn't find an example.
How do you feel about this?
Thanks
Best Regards
Kl_ko
|
|
|
|
|
I'm wondering why you're even bothering with a service at all. I have no idea what your app is doing, so this is just a guess, but since you're interacting with the users session, wouldn't it better to write a "normal" application and launch it out of the Run key?
|
|
|
|
|
the request for procedure 'tablename' failed because 'tablename' is a table object
'fill the dataset using default values for datatable names etc
dataAdapter.fill(ds)
'detach the sqlparameters from the command object,so they can be used again
pls I could not figure out this server error
|
|
|
|
|
Hi All,
I have located a Mutex system in code outside my control which causes execution to be delayed until after the current process has completed (Sequential).
Inside this Mutex system events are raised, which seems to lead to events being raised only after the current process has completed.
This doesn't help my unit tests as the events which should supply the results only occur after the test has failed.
So my question is, is there any way to suspend the thread and free the Mutex (Which i have no direct access too), so that it can do it's work, raise it's event
etc. before continuing?
I've tried Thread.Spin(), Thread.Sleep() and Application.DoEvents() as ways of suspending execution, but they don't seem to work.
Any thoughts?
Regards
Tris
[Edit: The Mutex appears to be owned by a different thread to the executing one.]
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
modified on Thursday, May 7, 2009 5:25 AM
|
|
|
|
|
Sorry, I don't understand your description. But you could use a named
Mutex. So you could get access to this Mutex. The Mutex can just be freed
by the thread owning it. Is this the thing you mean with no direct access?
|
|
|
|
|
Sorry, by No direct access i meant no refference to the object. It's internal to a class in a 3rd party lib library.
I've succeeded in avoiding the issue with a retry loop and Thread.Sleep().
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
Hello, I have a .Net desktop application that was originally written using Visual Studio 2005. The code has been converted to Visual Studio 2008. When I build .msi for the converted application, I'm getting the following error:
Assembly 'Microsoft.Practices.EnterpriseLibrary.Data.SqlCe, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' uses 'System.Data.SqlServerCe, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' which has a higher version than referenced assembly 'System.Data.SqlServerCe, Version=3.5.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' f:\MyApp\Lib\Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.dll
Apparently, I couldn't find the dll System.Data.SqlServerCe with version # 9.0.242.0
Please advise how this error can be resolved.
Thanks in advance
|
|
|
|
|
crazylad wrote: Apparently, I couldn't find the dll System.Data.SqlServerCe with version # 9.0.242.0
What this error means is that the Microsoft.Practices.EnterpriseLibrary.Data.SqlCe assembly is trying to reference System.Data.SqlServerCe, Version=9.0.242.0 but your main application assembly is trying to reference System.Data.SqlServerCe, Version=3.5.0.0. It's not that it can't find the assembly, it's because you can't load references to two different versions of the same assembly at the same time in one app domain.
The simplest thing to do is make sure everything references the same version of the assembly.
This is weird I know, but:
9.0.242.0 is the old version used by SQL CE 3.1
3.5.1.0 is the newer one used by SQL CE 3.5
Which version of the enterprise library are you using? Perhaps you need to upgrade to the latest version of the enterprise library which I assume will target 3.5.1.0 of the SQL CE assembly.
Also check the app.config file and see if there are any config elements that target the SQL CE assembly and check the version numbers listed. You could try making sure that they are all 3.5.1.0
Simon
|
|
|
|
|
i am very buzy in my personal works
|
|
|
|
|
Hi everyone,
I have developed a WPF application that works fine, but if I put a link to this app's .exe in Environment.SpecialFolder.Startup so that it is started at system startup, when I boot the computer, what I get is the typical error: "my app" has encountered a problem and needs to close.
If I start the application later on (not at system startup), it works, so I think it maybe has to do with CLR is not full ready when the app is executed at startup.
Anybody knows how to resolve this situation? It seems that in computers with long startup (a lot of apps have to run at system startup) this error doesn't happen. I guess it is so because CLR is completely up when my app is launched.
How do you think this could be 'workarounded'?
Thank you.
|
|
|
|
|
What about adding exception handler block that logs errors? Is the app accessing any files on startup that reside in the same directory as the executable itself?
|
|
|
|
|
Thank you very much for the exception handler tip. I'm going to check it.
Yes, the app accesses some dll files that reside in the same directory as the executable, but I don't understand why this could be a problem. Could you explain me, please?
Thank you.
|
|
|
|
|
Luis_codeProject wrote:
Yes, the app accesses some dll files that reside in the same directory as the executable
Looks similar to the problem I had. I guess you are using relative path for accessing the files, don't you?
When you launch the application yourself the current directory is the same where the executable resides but when it is launched at startup current directory is set to c:\documents and setting\youruser
So you can either change the current directory or use absolute path
|
|
|
|
|
Thank you for your support.
I have some "Environment.CurrentDirectory" in the code, but the point is that on some computers the app starts at system startup with no problems... So that should not be the problem, I guess.
I'm going to test the app catching AppDomain.CurrentDomain.UnhandledException so that I can log the exceptions to a file.
I hope this is the right way.
|
|
|
|
|
|
Yes, you were right
I don't know why it only happens in some machines but not in others. Anyway, the problem was related to the Environment.CurrentDirectory path.
I used it to load some i18n resources. In some cases, the current directory was changed externally and that was producing the unhandled exception.
I have read that Environment.CurrentDirectory has nothing to do with the application and can be changed outside of the application so for my purpose, it's better to use the following:
System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location)
instead of:
Environment.CurrentDirectory
That change solved my problem. I really appreciate your very useful help. Thank you very much!!!
|
|
|
|
|
You are welcome
|
|
|
|
|
Hi all,
I am working with a non-profit organization on a project for elderly and people with disability. The project is on "re-adjusting" a normal computer mouse. Some of these folks can not double-click, nor hold the left-click down for dragging files/folders. I found the following codes off this website for changing the middle-click to left-double-click.
http://www.codeproject.com/KB/cs/MBtn2DblClick.aspx
http://www.codeproject.com/KB/cpp/MBtn2DblClickVC.aspx
This program would be very handy for them.
Regarding the 2nd part, what I am looking for, should work like the following:
1. Move the pointer on a file/folder
2. Press and release the Middle/Wheel Click
3. Move the pointer and it moves/drags the file/folder.
4. Press and release the click again and the pointer releases the file/ folder
This should work for the Windows environment. Does the description make sense?
Can somebody please point me in the right direction for the second part?
Thanks,
-Farzad
|
|
|
|
|
Hello Farzad,
I know this was posted a while back, but I want to help.
As it turns out, I was working on a similar program not to long ago and was able to modify it for your use.
It's kind of hodge-podged together. It uses a Mouse-hooking class written in C# I came across somewhere on the net and modified for my use. The main form is written in Visual Basic .NET.
You can download the code from: HERE
Hope that's what you needed,
Ray
|
|
|
|
|
Hi All.
I have bound the Text property of several Textboxes to the properties of an Object with DataSourceUpdateMode.Never .
A foreach loop cycles through all textboxes and the DataBindings.WriteValue() function is called for each modified textbox to give the changes back to the object (which stores them in a database):
foreach (TextBox ctrl in gbCAddress.Controls)
{
if (ctrl.Modified)
{
ctrl.DataBindings["Text"].WriteValue();
ctrl.Modified = false;
}
}
This works fine so far, but after calling WriteValue(), all other DataBindings reload the data from the object, which overwrites the changes made to the other textboxes (probably because the Datasource changed ?).
Example:
textbox1 and textbox2 were modified.
The loop calls the WriteValue() function for textbox1
All Bindings reload their data - textbox2.Text is now the old value
The loop calls the WriteValue() function for textbox2
Can I suppress this reloading somehow ? I cannot see why everything is reloaded after one field changes...
Help !
|
|
|
|
|
Hi ezeew.
you binded all text boxes to DB.
As you and all people know! the data in those text boxes will change when DB update.
so I suggest you to collect your all data in each text box (if it modified) and in the end Update them to DB. (not exactly after modification)
I dont know, probably into a dailog form. It depend on you.
sorry, my english is not good
|
|
|
|