I am trying to get tracing set up for PowerShell(ISE) and I came across this link, but I am running debugView, and nothing seems to be happening. Anyone know what I am doing wrong?
Basically my goal is to get tracing for System.Net.WebRequest working in PowerShell. If there is another way to do it, I'd also be open to that.
The answer - which is mine funnily enough - in that link refers to the regular console (powershell.exe) version of powershell. I have to ask some dumb questions:
You created a powershell_ise.exe.config file, not powershell.exe.config, right?
If you're viewing dbgview over remote desktop, you enabled "capture global win32," right?
You have capturing enabled on dbgview, right?
-Oisin
Related
I have written a program in C# which I would like to open automatically at startup. As such, I have added a value to the HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run key:
Name: CustomTaskbar
Data: "C:\Users\test\Documents\CustomTaskbar\CustomTaskbar.exe"
Unfortunately, when I login, I am encountered with an error. Windows says 'CustomTaskbar has stopped working' and the details say this:
Files that help describe the problem:
C:\Users\test\AppData\Local\Temp\WERECE7.tmp.WERInternalMetadata.xml
C:\Users\test\AppData\Local\Temp\WERF655.tmp.appcompat.txt
C:\Users\test\AppData\Local\Temp\WERF823.tmp.mdmp
I have no idea why this is happening, as it works just fine when I run it manually, either via Windows Explorer or cmd.
I have written the program in C#. Do I have to add anything to the code in order to make it compatible with the registry key?
I apologise in advance if this is a stupid question, with a simple answer, but I cannot find any fix online.
Thanks.
Following the instructions provided by the link (https://stackoverflow.com/a/3133249/17034) kindly provided by Hans Passant, I was able to catch the exception. It turns out that while I had thought it was an issue with the way Windows was running it, it was in fact a stupid error on my behalf. I was referencing local paths like ”appfolder” and ”config.xml”. Windows was running the program from the system32 directory and, as the program did not have admin privileges, it was throwing an error, saying it couldn’t write to them.
I feel utterly ridiculous for having not noticed what would be happening before.
recently I encountered a problem. Every time when I make some changes in page after I debug it on device when going to said page the app minimizes (crashes) and after about 30-50 seconds in output window I get
The program 'XXX' has exited with code -1073741819 (0xc0000005) 'Access violation'.
But when I uninstall and then debug again It works. I already tied reseting phone. Is it something with my debbuger or more likely with my code?
Edit:
Right now sometimes it occurs and sometime it doesnt ... I'll need to inspect code more. Is there a way to obtain more debug info with Access violation information?
I'll post as answer so others can see it easily.
You can see the dump of debug on the test device, Follow this
link.
Basically the link explains how to turn on "Save Information option" from Feedback application inside Settings of your device. After that when you debug the app, you will find dump file of your application inside,Phone -> Documents ->Debug.
Please post a sample of your code. I had similar problems when I tried using {unsafe code} and included pointers. They are extremely useful, but often lead you to memory problems (reading from a NULL pointer or something like that), so check if that's your problem.
Good luck
I wanna to play around the HP webOS, and doing something system level modification. As you may know that the webOS can inspect the source code, and digging inside the system with something like WebOS doctor with ssh. But I would like to inspect when I doing something, which lines of code is being execute, or.... at least which file is being execute, any ideas on that? Thank you.
You can use the Ares debugger - https://ares.palm.com/Ares/docstemp/debug.html
Or if you are developing in Enyo - you can use the Javascript debugger to set watches and breaks in your code. CTRL+SHIFT+J on a windows machine will bring that up.
I have some code that is reading a config file, but when I open the file in TextPad, I see different values than my application does. I checked it with Notepad. Notepad agrees with my application, TextPad shows something else.
This is on Vista x64 Business.
Any idea what could be causing this? I've looked in the Context Menu->Properties->Previous Versions details, but it says "There are no previous versions available".
Here's the steps to replicate (I can't make it happen reliably):
Installed .NET app in Program files.
That app reads the config file, but is falling over.
I manually edit that config file in Textpad.
The change doesn't take effect.
I open the config file in Notepad, and see something different.
Try making the change in Notepad and saving, and get this error message:
Notepad
Cannot create the C:\Program Files (x86)\Daniel Schaffer\WorkingOn for FogBugz\FogBugz > WorkingOn.exe.config file.
Make sure that the path and file name are correct.
I can't put the content here as it's XML and is being encoded by Superuser.com, but here's a link to a screencast: http://screencast.com/t/zhERl7mocp4.
Sounds like a case of you don't have administrator privs, when you installed your app. Sometimes when you install an app with no admin privs, it behave really strangely because of vista security model. I had a similar problem to this last year. It wasn't the exactly, but it was strange behaviour, until I figured out it was vista's security model. It elevates it into application/user security context, from what I know, as my brain froze when I was reading about it, as it was pure muck and virtually useless from what I can see.
Try opening Textpad (excellent app) with Run as Administrator, and then edit the config. See what happens. If it stays then same then its a prives problem. If that doesn't work, deinstall you app, and then install it as an administrator. That will give the app the write admin privs to work. Then when you edit the config. See if that works.
Take a look at this. You can elevate an app to run as administrator, Using the techniques found here. How to elevate an application.. Try all these before you do a reinstall.
If that doesn't work, post your question to server fault. Also post it to a suitable MSDN forum.
Hope that help.
Bob.
This is interesting. My guess is that a Vista Feature called UAC Virtualization (aka Data Redirection) is at work here. It basically redirects legacy applications to %USERPROFILE%\AppData\VirtualStore\Program Files\... so they can write files in the program's directory.
Maybe Textpad tries to open the file in read-write mode while both your application and Notepad use it read-only?
You can fire up Process Monitor to see the exact magic, and please let me know ;-)
Try just to strip that whitespace character from application name; my guess is something related to canonical path building
try to copy file to another path and reopen it. see if it changes the result.
One thing you can do is observe what exact file each of those methods ends up opening. To do this,
launch Process Monitor from the sysinternal suite.
look only for file operations (deselect registry operations on the right of the toolbar)
select only your own process (filter out all the processes that you don't care about, or just include your own process name in the filter list)
You can also simply use the search function for your file name, this might be the faster route.
Process monitor has helped me find so many issues it's amazing.
I've run into this problem before and the solution has usually been to restart IIS. Basically I've made a number of changes to a .wsc file on our server. But when it runs it doesn't run the new code changes I made. I've verified this with event logging at the beginning of the file and it doesn't show up.
My problem is that obviously restarting IIS on our production server is something I'm loathe to do, but we need this running today. I've tried re-registering the file but to no avail.
The server is a 32-bit Server 2008 OS. And the code is running, it still generates the file it is supposed to, but like I said, it's not using the latest changes.
Any other info I can provide, please leave a comment and I'll edit.
Thank you,
Jeff
Edit: Oisin, thanks for the reply and yes I know I hate VBScript, and anything related to it including these Window Script Components. I've expressed such feelings to my manager, but it's a dirty job and someone has to do it!
Yes it's using a Server.CreateObject to call the component.
ANSWER: I've since realized my mistake. I was only 'registering' it over and over, when I should have first 'unregester'ed it the 'register'ed it. Man I feel stupid, but haste makes waste as they say.
Thanks for the response and link!
Eek, you mean WSC as in a Windows Script Component? I haven't written one of them since 2000.
Are you loading it using CreateObject (e.g. it's registered as a COM object via regsvr32), or are you using a file-based moniker to load it? (not registered).
If it's registered, it probably is cached until app restart. If you switched to a file based moniker, e.g. like: Set o = GetObject("script:c:\path\obj.wsc"), you might get away with runtime changes to the .wsc file.
(man, how did I even remember this)
more info here - quick before it's archived! :D
http://www.microsoft.com/technet/scriptcenter/resources/scriptshop/default.mspx
-Oisin