本文整理汇总了C#中Microsoft.SPOT.Debugger.Engine.Deployment_Execute方法的典型用法代码示例。如果您正苦于以下问题:C# Engine.Deployment_Execute方法的具体用法?C# Engine.Deployment_Execute怎么用?C# Engine.Deployment_Execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.SPOT.Debugger.Engine
的用法示例。
在下文中一共展示了Engine.Deployment_Execute方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeployToDevice
internal static void DeployToDevice(string buildPath, ArrayList referenceList,
Engine engine, string transport, bool isDevEnvironment, string assemblyName)
{
ArrayList peList = GetPeFileList(buildPath, referenceList, isDevEnvironment, assemblyName, engine);
// Deploy the pe files to the device.
Console.Write("\tDeploying the device test..");
bool isDeployed = engine.Deployment_Execute(peList, false, null);
if (string.Equals(transport.ToLower(), "emulator"))
{
isDeployed = true;
}
if (isDeployed)
{
Console.WriteLine(" deployed successfully");
}
else
{
Console.WriteLine(" deployment failure");
throw new ApplicationException("Unable to deploy the test to the device");
}
}
示例2: OnRun
protected override void OnRun (DebuggerStartInfo startInfo)
{
var mfStartInfo = startInfo as MicroFrameworkDebuggerStartInfo;
if (mfStartInfo == null)//This should never happen...
throw new InvalidOperationException ();
var command = mfStartInfo.MFCommand;
var portDefinition = ((MicroFrameworkExecutionTarget)command.Target).PortDefinition;
using (var deployEngine = new Engine (portDefinition)) {
deployEngine.Start ();
string newCommand = "/CorDebug_DeployDeviceName:" + portDefinition.PersistName;
var listOfAseemblies = new ArrayList ();
//TODO: Check if this is robust enough will "be" and "le" really always be in output folder?
OutputDirectory = command.OutputDirectory;
string dir = command.OutputDirectory;
if (deployEngine.IsTargetBigEndian)
dir = Path.Combine (dir, "be");
else
dir = Path.Combine (dir, "le");
string[] files = Directory.GetFiles (dir, "*.pe");
foreach (var file in files) {
newCommand = "/load:" + file + " " + newCommand;
using (var fs = new FileStream (file, FileMode.Open)) {
byte[] data = new byte[fs.Length];
fs.Read (data, 0, data.Length);
listOfAseemblies.Add (data);
}
}
startInfo.Command = newCommand;
deployEngine.Deployment_Execute (listOfAseemblies, false, (str) => OnDebuggerOutput (false, "Deploy: " + str + Environment.NewLine));
deployEngine.RebootDevice (Engine.RebootOption.RebootClrWaitForDebugger);
}
VsPackage.MessageCentre.Session = this;
try {
CorDebugProcess process = CorDebugProcess.CreateProcess (new DebugPortSupplier ().FindPort ("USB"), startInfo.Command);
process.StartDebugging (this, false);
// StartDebugging() will either get a connected device into a debuggable state and start the dispatch thread, or throw.
} catch (ProcessExitException) {
VsPackage.MessageCentre.DeploymentMsg (DiagnosticStrings.InitializeProcessFailedProcessDied);
} catch (Exception ex) {
VsPackage.MessageCentre.DeploymentMsg (DiagnosticStrings.InitializeProcessFailed);
VsPackage.MessageCentre.InternalErrorMsg (false, ex.Message);
}
}