Home

defaultquery.xml and myextensions

edited March 2017
Hi,

I use LinqPad very happily, with all folders (Query, Snippet and Plugins) pointing at OneDrive so they can be shared across multiple machines. My only difficulty is trying to reference different assembly versions on different machines. Up to this point I've added the reference to the Visio 2013 PIA to MyExtensions including an aliased namespace.

However now I want to include a Visio 2010 PIA reference on one machine only, I've moved the namespace and reference to DefaultQuery.xml and left this under the %APPDATA%\LinqPad directory. New queries get the namespace and assembly reference ok, but I then lose all of the code in MyExtensions. ("MyExtensions does not exist in the current context")

So, are DefaultQuery.xml and MyExtensions mutually exclusive or do I need to include MyExtensions within DefaultQuery.xml somehow?

Ultimately I'd just like to use the aliased namespace and have my extension methods available so that the code can largely ignore which version of the PIA I'm using, so if I'm tackling this in the wrong way please do point me the right direction.

Thanks

John

[Based on v5.10.00]

Comments

  • Hi, Are there any changes in 5.22 that might help with this?
  • DefaultQuery.xml and My Extensions should not be mutually exclusive. Could there be something odd in your DefaultQuery.xml?

    Also note that you can selectively localize most settings:
    http://www.linqpad.net/PortableDeployment.aspx

    (I don't know whether this will help in your case.)
  • Hello Jo,

    Thanks for the reply. I've double checked this and removed the DefaultQuery to let Linqpad generate it (when hitting the Set as Default button) and the resulting xml appears the be identical as the version I'm copying to the Linqpad.exe folder.

    I'm thinking though, that DefaultQuery doesn't set up the reference for MyExtensions, just for new queries - is that correct? If that's the case, then what I'm trying to do is share MyExtensions and other queries across machines, but both or all should have one reference on one machine and another reference (a different Visio version) on another machine. I guess I'm trying to separate the MyExtensions references from the actual code so I can have a single reference for a machine that both MyExtensions and queries point to. Does that make sense?

    Best regards

    John
  • (Sorry will concatenate your name back to full health "Jo" + "e") :smile:
  • If you want to share My Extensions across machines, the common references will need to work across all machines.

    Although if a DLL is not present, it should give a warning and still allow the query to run - as long as the query doesn't require that DLL.
  • Hello Joe,

    Ok, I think I've understand the problem better now - thank you.

    As a workaround then, I've defined a common path on both machines and copied the PIAs there so the reference now resolves correctly in both places.

    I guess a useful option for this might be to allow a standalone xml file so that MyExtensions and the references it uses could be separated. Maybe that's just an edge case though.

    Anyway, thanks very much for your help.

    Best regards

    John
Sign In or Register to comment.