|
| Hi all,
I am trying to deploy a Biztalk assembly using WMI.But soon after i am
done with my deployment if i try to rebuild my BizTalk solution i get
"Access denied. dll in use error"
My code runs as a COM+ service and the only way i can rewrite my biztalk dll
is by restarting my COM+ service.
Did anyone get this error before throw insight
My simple code looks like as shown below:
ManagementClass Instance =null;
ManagementBaseObject inParams =null;
ManagementBaseObject outParams =null;
try
{
Instance = new
ManagementClass(@\\testmachine\ROOT\Micr
osoftBizTalkServer:MSBTS_DeploymentS
ervice);
Instance.Get();
inParams = Instance.GetMethodParameters("Deploy");
inParams["Server"] = "testmachine";
inParams["Database"] = "BizTalkMgmtDB";
inParams["Assembly"] = assemblyPath; { Absolute path to the dll
is given here}
inParams["Install"] = true;
outParams = Instance.InvokeMethod("Deploy",inParams,null);
return true;
}
catch(Exception e)
{
throw e;
}
finally
{
if(Instance !=null)
{
Instance.Dispose();
Instance=null;
}
if(inParams !=null)
{
inParams.Dispose();
inParams=null;
}
if(outParams !=null)
{
outParams.Dispose();
outParams=null;
}
}
Regards
|
|