Rename the page get error on windows phone - windows-phone-7

I want to rename the xaml and cs file, so I selected this file (in solution explorer) then pressed F2 and entered the new name. When I run it, it get error on this line system.Diagnostics.Debugger.Break(); Why I get error?

You also need to open the cs file and change the public class name on the cs file. In addition, change the x:Class= namespace.yourpagename on design view by yourself.

That's not an error.
As its name clearly indicates, that method pauses the debugger when called.

Related

How can I solve Error with opening Studio App in Odoo?

I have the following Problem, when beeing logged in as admin:
I can access the Contacts Module and the records in it.
When I try to open the Studio App in Contacts Modul nothing happens. It does not open.
When I try to open a record after trying to open the Studio App I get the following Error:
Traceback (most recent call last):
File "/home/secusmart/odoo15-prod/odoo/odoo/http.py", line 644, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/home/secusmart/odoo15-prod/odoo/odoo/http.py", line 302, in _handle_exception
raise exception.with_traceback(None) from new_cause
ValueError: Element '<xpath expr="//field[#name='id']">' cannot be located in parent view
So the error only appears, when I first try to open the Studio App. Other wise I can open the records! And it only happens in this specific module.
I looked up which field is mentioned in the xpath expression and its technical name is "translate". But I can`t find the xpath expression in any view from res.partner model.
Has anyone a tip how I can find the mentioned xpath ?
Thanks
Error loaded Odoo Studio custom views don't lead to errors for normal users (anymore), because Odoo will just ignore them in this case. But opening studio itself on models views customized by studio, will always try to load those error loaded views. Unfortunately studio doesn't show any errors to the studio user.
What can you do? If you don't know the error, search for every studio view on the related model and archive them or try to look into them to find the error. You could also try the trial-and-error approach by commenting things out from the end of the view arch one after the other.
If you know the error, you have the possibility to search for views having the element named in the error message. But don't forget to replace HTML codes with real characters. Your example should be replaced by:
expr="//field[#name='id']"
Just search on the arch field in the search bar of the views. It's the last field and is labeled "View Architecture". In the end fix the error.

settingcontent-ms file tag meaning

Windows 8 has a feature: it can launch an application from the search panel (on the right side of the screen). It works like following:
Developer registers his or her application following this instruction. It is a bit legacy instruction, but the project I participate in uses this way to register its settings.
At user logon Windows creates (if none exists) a special .xml file in C:\User\<UserName>\AppData\Packages\windows.immersivecontrolpanel_cw5n1h2txyewy\LocalState\Indexed\Settings\en-US with content shown below. This file has extension settingscontent-ms
As soon as user clicked on this file, the system launches the specified application (actually explorer calls for it, as I discovered by ProcMon).
Xml file content:
<?xml version="1.0" encoding="UTF-8"?>
<PCSettings>
<SearchableContent xmlns="http://schemas.microsoft.com/Search/2013/SettingContent">
<ApplicationInformation>
<AppID>windows.immersivecontrolpanel_cw5n1h2txyewy!microsoft.windows.immersivecontrolpanel</AppID>
<DeepLink>%Canonical name or application path%</DeepLink>
<Icon>%App path%,-%Resource number%</Icon>
</ApplicationInformation>
<SettingIdentity>
<PageID>%GUID as in instruction above%</PageID>
<HostID>{7E0522FC-1AC4-41CA-AFD0-3610417A9C41}</HostID>
<Condition>shcond://v1#RegkeyExists;0;Regkey;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel\NameSpace\%GUID as in instruction above%</Condition>
</SettingIdentity>
<SettingInformation>
<Name>#%App path%,-%Resource number%</Name>
<Description>#%App path%,-%Resource number%</Description>
<HighKeywords>%App decription%</HighKeywords>
</SettingInformation>
</SearchableContent>
</PCSettings>
We can see node with the name HostID. Windows writes specified in code GUID to this node, but it breaks the ability of my application to work. If I try to execute my app through this "shortcut" by clicking on xml file or chosing my app in search panel, the system shows me a message: "Unspecified error".
When I manually change the HostID value to {12B1697E-D3A0-4DBC-B568-CCF64A3F934D}, it starts to wrk fine.
I looked through registry in order to find something about these two GUIDs, but I didn't find anything. Also I looked for the difference between registry values corresponding to my app and to another, but working, app and didn't find any significand differences too.
Also I tried to delete this file and login into the system under ProcMon, I caught some moments: explorer tries to open the file and fails with ERROR_FILE_NOT_FOUND, explorer creates missing file, reads registry and writes something to created file, then it closes the file. But I didn't find anything interesting in between of these messages, that can help me to solve my problem.
I found out that registry key HKEY_CLASSES_ROOT\CLSID\%App GUID%\System.ApplicationName contains exactly the same with DeepLink tag (it was the first error in my app - specified key was empty), but the proble with "wrong" HostID remains.
Does anyone know, what it is and how to make Windows to write the rigth GUID to this tag, or at least some useful info about this tag? I just can't imagine anything else to change, but I think, that I need to change something in corresponding to my app registry keys.
I found the solution: just put app's GUID (the same as in PageID) into DeepLink.
To do this, you need to write this GUID as string value to HKEY_CLASSES_ROOT\CLSID\%App GUID%\System.ApplicationName.
That's the solution. However, I haven't found the meaning of HostID tag :(

Method or data member not found compile issue

I have a VB6 project that I didn't create but I have to update, when I go to make the exe I get a compile error: Method or data member not found, and it points too "SCom1.FileReceive" in the code below. When I look at the Main form, the SCom1 control is a PictureBox.
This code has been working for the last 5 years but I don't know why SCom1 is a picturebox, or why I'm getting the error, is it a reference? SCom1 to me looks like a MSComm function? Let me know if anyone has any ideas, I just don't know VB enough to know how to troubleshoot this. Thanks
If SCom1.FileReceive = True Then
WriteToLog (Now() & " FileReceive was true, now false")
SCom1.FileReceive = False
End If
The machine which you have opened the code doesn't have the mscomm32.ocx file or the ocx file not registered properly.
When vb cannot reference an ocx, it'll convert the relevant control to a picture box control.
What you have to do is, close the project without saving. Then open system32 folder and check for mscomm32.ocx file. If the file is not there then you have to download that from the intenet. The register the file using regsvr32 command in command prompt.
After this you can open the vb6 project and start working.
=========================================================
EDIT : Included the update in the comments to the answer, this will help other users in the future... :-)
if the method name doesn't look familiar to a known ocx file (in this case the SCom1.FileReceive), the missing component can be a custom ocx file.
So check on the working machine or in project folder whether there are any ocx file exists in the relevant name (in this case SCom.ocx).
if there is a file exists in such name, register that file using regsvr32 (if not registered), then add that to toolbox, then replace the picture box control with the relevant control (make sure the name tally).

"open in IE 1.4" addon stopped working

Whenever I press on the open in IE icon, I get an error in the console:
Error: NS_ERROR_FILE_NOT_FOUND: Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIProcess.init]
Source File: chrome://openinie/content/openinie.js
Line: 126 (This happened ever since upgrade to 16.0 and I assume it's probably security related)
I found that js file to be inside some "openinie#wittersworld.com.xpi" file (which I cleverly renamed to zip), and saw the offending line:
var iePath = openinie.getIEPath();
// create an nsILocalFile for the executable
var file = Components.classes["#mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
file.initWithPath(iePath);
// create an nsIProcess
var process = Components.classes["#mozilla.org/process/util;1"].createInstance(Components.interfaces.nsIProcess);
process.init(file); // <-line 126
is it possible to fix it and "re-compile" it zipping and renaming?
(I assume it's something with security maybe).
can I debug this using for example an alert box to display values of variables?
is it possible to fix it and "re-compile" it zipping and renaming
Yes, you can simply replace a file in the ZIP archive, most extensions aren't signed (you can remove the META-INF directory from the XPI file if this one is). In fact, for your debugging it is better to unpack openinie#wittersworld.com.xpi into a directory named openinie#wittersworld.com in the same folder and remove the original file - this way you won't need to pack/unpack on each change. You should also start Firefox with the -purgecaches command line parameter, otherwise the file you are changing might get cached.
can I debug this using for example an alert box to display values of variables?
Yes. However, I would rather recommend Components.utils.reportError() method that will log to the Error Console (press Ctrl-Shift-J to open it) without opening modal dialogs. In this particular case I would write:
Components.utils.reportError(iePath);
This seems to point to a non-existent file meaning that the getIEPath() function is faulty.
Good luck!

TFS API DownloadFile( ) functions cause exception when debugging

Whenever I call Item.DownloadFile(string localFileName) or VersionControlServer.DownloadFile(string serverPath, string localFileName) I get a FileNotFoundException whenever I try to debug in Visual Studio: Could not find file 'C:[Project Path]\bin\Debug\[ProjectName].vshost.exe.config'.
When I build the application and run it outside of visual studio there is no problem calling these functions. It works perfectly fine. Anyone know what could be causing it?
Before you ask, no, that file does not exist. I'm not doing anything with a config file, I don't need or want it to exist. I don't understand why it is even trying to access that file when I debug. When I run the application outside of visual studio that .config file still does not exist but I get no exception because it's not trying to access that file.
Also, it is not a vshost problem either. When I uncheck "Enable the Visual Studio hosting process" I get the same exception except when debugging but the file name changes from "[ProjectName].vshost.exe.config" to "[ProjectName].config"
Currently, when I want to debug this project I have to put a MessageBox.Show( ) function right after every call to DownloadFile( ) and run my application outside of visual studio. When that MessageBox is displayed then I can use attach to process and put a break point on the next line after that MessageBox, click OK on the messagebox and then it will catch the break point. But when I'm downloading files in a loop and want to debug the loop it's extremely annoying and time consuming to attach to process after DownloadFile is called, stop debugging before the next DownloadFile is called, attach to process again after DownloadFile is called, and keep repeating that all day long.
I'm not totally sure, but looks like it has something to do with the current path and the Workspace where you download the file to.
If you don't explicitly specify the workspace, the TFS API will try to determine it from the current path of your application by looking if that path is declared in a Workspace as a Mapping.
If I remember correctly, you can download an item from a Workspace object (or specify the Workspace in the operation), try to modify your code to do that and see if it's better.
You can also try to change the current path of your debugging session to something "inside a Workspace"

Resources