Azure辅助角色 - 在调试中启动时出现“TargetInvocationException”

时间:2013-06-29 17:52:22

标签: c# .net azure azure-web-roles

当尝试在debug(Visual Studio 2012)中运行我的WorkerRole项目时,我得到了一个' TargetInvocationException'这是因为它无法找到所需的cfg文件。暂时我已经为所有用户提供了对C:\ Users \ johsmith \ AppData \ Local \ dftmp的完全写入权限,但这没有任何区别。

此处的任何人都表示赞赏,因为我现在很困惑。

作为参考,我正在运行Windows 8,VS2012和最新的Azure SDK。

这是堆栈跟踪

 at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.ConstructorInfo.Invoke(Object[] parameters)
   at Microsoft.WindowsAzure.ServiceRuntime.Implementation.Loader.RoleRuntimeBridge.GetDebugListener()
   at Microsoft.WindowsAzure.ServiceRuntime.Implementation.Loader.RoleRuntimeBridge.Initialize(String[] args)
   at Microsoft.WindowsAzure.ServiceRuntime.Implementation.Loader.RoleRuntimeBridge.Initialize(String[] args)
   at Microsoft.WindowsAzure.Hosts.Worker.Loader.CreateConsoleRole(Parameters parameters)
   at Microsoft.WindowsAzure.Hosts.Worker.Loader.Main(String[] args)

内部消息是

{"Could not find a part of the path 'C:\\Users\\johsmith\\AppData\\Local\\dftmp\\deployment20(21)\\config\\deployment20(21).EventHandler.WorkerRoleWithSBQueue1_IN_0.1.cfg'."}



 at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
   at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy)
   at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)
   at System.Xml.XmlTextReaderImpl.FinishInitUriString()
   at System.Xml.XmlTextReaderImpl..ctor(String uriStr, XmlReaderSettings settings, XmlParserContext context, XmlResolver uriResolver)
   at System.Xml.XmlReaderSettings.CreateReader(String inputUri, XmlParserContext inputContext)
   at System.Xml.XmlReader.Create(String inputUri, XmlReaderSettings settings, XmlParserContext inputContext)
   at System.Xml.XmlReader.Create(String inputUri, XmlReaderSettings settings)
   at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options)
   at System.Xml.Linq.XDocument.Load(String uri)
   at Microsoft.ServiceHosting.Tools.DevelopmentFabric.Runtime.DevelopmentFabricTraceListener.TryGetProviderGuid(Guid& ret)
   at Microsoft.ServiceHosting.Tools.DevelopmentFabric.Runtime.DevelopmentFabricTraceListener.Init()

1 个答案:

答案 0 :(得分:0)

我已经设法通过卸载所有'Azure'相关程序并重新安装最新的SDK来实现它。我注意到我安装了一些较旧的Azure SDK应用程序,可能会搞砸了。