Home
Options

CS0246 The type or namespace name 'This' could not be found (Press F4 to check imported namespaces

So I just ran LINQPad as usual and running any query (even a blank one) gave this error: CS0246 The type or namespace name 'This' could not be found (Press F4 to check imported namespaces)

When I pressed F4 I saw this in the Additional Namespace imports: This.File.Is.Not.Used.Anymore

Also, Additional References were empty.

What file is "This.File" and what should I use instead of it? I see nothing about this in "What's New" nor on the linked http://www.linqpad.net/PortableDeployment.aspx page.

Comments

  • Options
    could it be somehow referenced from your My Extensions.linq file and therefore used in all new queries?
  • Options
    This makes no sense.

    Can you submit a bug report (Help | Report Bug) and check 'Include Current Query'. Also, please include your email address and a note referencing this thread, so that I can give it priority.

    Also, if there is anything in your My Extensions query, (or if it references anything), let me know.

  • Options
    An update in case anyone else is running into this problem:

    I tried deleting and re-creating DefaultQuery.xml in the LINQPad directory and the problem went away. When I re-created "%appdata%\LINQPad\DefaultQuery.xml" I could repro the problem again. It would appear that LINQPad 5.08.01 reads whichever file has the later creation time.

    If so, this is behaviour that badly violates the principle of least surprise - a user would have no way of figuring out what's happening, let alone expect that this is what the program would do.
  • Options
    Are you certain of this? LINQPad doesn't look at the creation time of the DefaultQuery.xml file.

    It looks for DefaultQuery.xml first in the LINQPad directory, and if it doesn't find it there, it looks for it in %appdata%\LINQPad.
  • Options
    I can't repro it anymore, so I don't know what was going on! However, I wasn't the only user in the company who reported the original problem ("This.File.Is.Not.Used.Anymore" namespace import), so whatever it was, it happened on multiple machines.
Sign In or Register to comment.