Reference an exe as a .NET assembly and deploy with ClickOnce
I am trying to reference LINQPad.exe, a .NET executable, so that my code can make use of its wonderful .Dump() extension method. Adding a reference to the exe allows me to use the following code on my dev machine, but it breaks ClickOnce ("Reference in the manifest does not match the identity of the开发者_开发知识库 downloaded assembly LINQPad.exe.").
public static string DumpString<T>(this T o)
{
var w = LINQPad.Util.CreateXhtmlWriter();
w.WriteLine(o);
return w.ToString();
}
Does anyone know how to reference a .exe and deploy it with ClickOnce (or a similarly easy method)? Note that I cannot just include the .exe and call it as a process - I need to reference it as an API. Also, LINQPad.exe has assemblies inside of it which cause problems when attempting to use ILMerge on the file, so ILMerge doesn't seem to be an option.
The LINQPad EULA does not allow you to redistribute without written permission from the owner of LINQPad.
You are not permitted to do what you want to do because it is illegal.
However, there is permission granted on the website to disassemble the executable to satisfy your own curiosity. I therefore suggest that you reverse engineer Dump() and post it to Codeplex as a separate library for all to use.
Not knowing about LinqPad, here's a stab in the dark:
You could try this: (no promises) I'm assuming you are referencing it in your project.
Add the linkqpad.exe to your project. Set the build action to none, set copy-to-output-directory to false.
If you have a reference to it, delete your reference to it, set your reference to point at the file you just included in your project. This way, it will reference the local copy rather than the one in the GAC. If you don't have a reference to it, set the build action to "content" and set copy-to-output-directory to false. Then where you're calling it, look for it locally.
This is how you would generally deploy a 3rd party dll locally rather than installing it in the GAC (works for DirectX, but not for Infragistics). I don't know if it will work for an exe...
RobinDotNet
精彩评论