gpt4 book ai didi

c# - 由于写权限,单元测试在 Visual Studio Team Services Build runner 上失败?

转载 作者:行者123 更新时间:2023-11-30 18:22:07 24 4
gpt4 key购买 nike

我有一个在 Visual Studio Team Services 上运行的构建,它运行一套 XUnit 测试,这些测试都在我的本地计算机上通过。该错误与加载我的项目中引用的 c++ dll (Interface.dll) 有关。当它们在构建服务器上运行时,出现以下错误

2015-12-18T17:40:24.3167397Z ##[error]Error Message:
2015-12-18T17:40:24.3197403Z ##[error] Microsoft.Practices.Unity.ResolutionFailedException : Resolution of the dependency failed, type = "myapp.EntityModule.Entities.calc", name = "(none)".
2015-12-18T17:40:24.3197403Z ##[error]Exception occurred while: Calling constructor myapp.EntityModule.Entities.calc().
2015-12-18T17:40:24.3207417Z ##[error]Exception is: FileLoadException - Could not load file or assembly 'Interface.DLL' or one of its dependencies. The media is write protected. (Exception from HRESULT: 0x80070013)
2015-12-18T17:40:24.3217444Z ##[error]-----------------------------------------------
2015-12-18T17:40:24.3217444Z ##[error]At the time of the exception, the container was:
2015-12-18T17:40:24.3227399Z ##[error]
2015-12-18T17:40:24.3237398Z ##[error] Resolving myapp.EntityModule.Entities.calc,(none)
2015-12-18T17:40:24.3237398Z ##[error] Calling constructor myapp.EntityModule.Entities.calc()
2015-12-18T17:40:24.3247420Z ##[error]
2015-12-18T17:40:24.3247420Z ##[error]---- System.IO.FileLoadException : Could not load file or assembly 'Interface.DLL' or one of its dependencies. The media is write protected. (Exception from HRESULT: 0x80070013)
2015-12-18T17:40:24.3257416Z ##[error]Stack Trace:
2015-12-18T17:40:24.3267400Z ##[error] at Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name, IEnumerable`1 resolverOverrides)
2015-12-18T17:40:24.3267400Z ##[error] at Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, String name, IEnumerable`1 resolverOverrides)
2015-12-18T17:40:24.3277398Z ##[error] at Microsoft.Practices.Unity.UnityContainer.Resolve(Type t, String name, ResolverOverride[] resolverOverrides)
2015-12-18T17:40:24.3277398Z ##[error] at Microsoft.Practices.Unity.UnityContainerExtensions.Resolve[T](IUnityContainer container, ResolverOverride[] overrides)
2015-12-18T17:40:24.3287422Z ##[error] at myapp.EntityModule.Tests.Entities.Car.OutingSetup.OutingsetupTests.GetNewcalc()
2015-12-18T17:40:24.3297428Z ##[error] at myapp.EntityModule.Tests.Entities.Car.OutingSetup.OutingsetupTests.OutingSetups_Ready_Rule_CasterSlugFrontInRangeWithUpperControlArmForeAdjLength_Right_TestReadyStatusValues(String simDescription, Double casterSlugFront, Double mountAdjustmentLengthFore, ReadyStatus expected)
2015-12-18T17:40:24.3297428Z ##[error]----- Inner Stack Trace -----
2015-12-18T17:40:24.3307426Z ##[error] at myapp.EntityModule.Entities.Results.DymolaResults..ctor()
2015-12-18T17:40:24.3307426Z ##[error] at myapp.EntityModule.Entities.calc..ctor()
2015-12-18T17:40:24.3317440Z ##[error] at lambda_method(Closure , IBuilderContext )
2015-12-18T17:40:24.3317440Z ##[error] at Microsoft.Practices.ObjectBuilder2.DynamicBuildPlanGenerationContext.<>c__DisplayClass1.<GetBuildMethod>b__0(IBuilderContext context)
2015-12-18T17:40:24.3327420Z ##[error] at Microsoft.Practices.ObjectBuilder2.DynamicMethodBuildPlan.BuildUp(IBuilderContext context)
2015-12-18T17:40:24.3337422Z ##[error] at Microsoft.Practices.ObjectBuilder2.BuildPlanStrategy.PreBuildUp(IBuilderContext context)
2015-12-18T17:40:24.3347418Z ##[error] at Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context)

关于如何解决这个问题有什么想法吗?

最佳答案

如果您使用的是 Hosted Agents,您必须知道构建是在没有管理员权限的情况下启动的,但我怀疑您的问题与您机器上的某些东西有关,而不是与它们的环境有关。

要尝试重现,您可以仅使用 VS 2015 和您的代码启动 Azure VM,并尝试运行相同的命令。您也许能够重现并查明您的错误:)

关于c# - 由于写权限,单元测试在 Visual Studio Team Services Build runner 上失败?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34362619/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com