Welcome Guest Search | Active Topics | Members | Log In | Register

tostr is not working in VS 2008 Options · View
franky
Posted: Wednesday, August 20, 2008 7:29:13 AM
Rank: Newbie
Groups: Member

Joined: 8/20/2008
Posts: 1
Points: 3
Location: Georgia
Hi, I try to use tostr and get the following msg. Any solutions? Thanks a lot.

Error executing command 'ToString', command line 'tostr'.
Can't find element 'vsCMElementClass' from current position. Try positioning cursor inside a valid code element (class, method, etc.)
Alvaro
Posted: Wednesday, August 27, 2008 3:29:44 AM
Rank: Administration
Groups: Administration

Joined: 3/16/2008
Posts: 22
Points: 72
Location: Spain
The error message seems like the cursor is not inside a class.

Try executing the command inside a a class but outside any method o property. Example:

public class MyClass
{
public int X { get { return x; } }

// Locate cursor here and execute "tostr <ctrl+enter>"
}
jgyo
Posted: Wednesday, September 03, 2008 12:10:23 PM
Rank: Newbie
Groups: Member

Joined: 9/3/2008
Posts: 1
Points: 3
Location: Houston, TX
Quote:
The error message seems like the cursor is not inside a class.

Try executing the command inside a a class but outside any method o property. Example:

public class MyClass
{
public int X { get { return x; } }

// Locate cursor here and execute "tostr <ctrl+enter>"
}


This is a minor bug I guess, but even following these instructions, if there are no public properties in the class, tostr still generates an error. In this case:

Quote:
Error executing command 'ToString', command line 'tostr'.
Object reference not set to an instance of an object.


Some code however is generated.
Alvaro
Posted: Thursday, September 04, 2008 1:40:31 PM
Rank: Administration
Groups: Administration

Joined: 3/16/2008
Posts: 22
Points: 72
Location: Spain
Thanks for reporting the error.

I'll fix it for the next release.
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by Yet Another Forum.net version 1.9.1.8 (NET v2.0) - 3/29/2008