Hi, I am facing strange problem with MbUnit
references in some projects. The MBUnit dlls have been referenced from J: drive
which is mapped to a network folder. Some projects (that reference MbUnit dlls)
are building fine (NAnt). However in some other projects, NAnt is throwing the
following exception: BUILD FAILED Error resolving module references of
'J:\ThirdParty\MbUnit\MbUnit.Framework.dll' .: NAnt.Core.BuildException: Error
resolving module references of 'J:\ThirdParty\Mb Unit\MbUnit.Framework.dll'. --->
System.Security.Policy.PolicyException: Require d permissions cannot be acquired. Server stack trace: at
System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, B oolean isStringized, Evidence
assemblySecurity, Boolean throwOnFileNotFound, Ass embly locationHint, StackCrawlMark&
stackMark) at
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Boolean stringized, Evidence assemblySecurity,
StackCrawlMark& stackMark) at
System.Reflection.Assembly.LoadFrom(String assemblyFile, Evidence security Evidence, Byte[] hashValue,
AssemblyHashAlgorithm hashAlgorithm) at
NAnt.VSNet.ReferencesResolver.AppendReferencedModulesLocatedInGivenDirecto ry(String moduleDirectory, String
moduleName, Hashtable& allReferences, Hashtabl e& unresolvedReferences) at
System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(M ethodBase mb, Object[] args, Object
server, Int32 methodPtr, Boolean fExecuteInC ontext, Object[]& outArgs) at
System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMes sage msg, Int32 methodPtr, Boolean
fExecuteInContext) Exception rethrown at [0]: at
System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage req Msg, IMessage retMsg) at
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgDa ta, Int32 type) at
NAnt.VSNet.ReferencesResolver.AppendReferencedModulesLocatedInGivenDirecto ry(String moduleDirectory, String
moduleName, Hashtable& allReferences, Hashtabl e& unresolvedReferences) at
NAnt.VSNet.FileReferenceBase.GetAllReferencedModules(String module) --- End of inner exception
stack trace --- at
NAnt.VSNet.FileReferenceBase.GetAllReferencedModules(String module) at
NAnt.VSNet.FileReferenceBase.GetAssemblyOutputFiles(String assemblyFile) at
NAnt.VSNet.AssemblyReferenceBase.GetOutputFiles(ConfigurationBase config) at
NAnt.VSNet.ProjectBase.GetOutputFiles(String configuration) at
NAnt.VSNet.ProjectBase.Prepare(ConfigurationBase config) at
NAnt.VSNet.ManagedProjectBase.Prepare(ConfigurationBase config) at
NAnt.VSNet.ProjectBase.Compile(String configuration) at
NAnt.VSNet.SolutionBase.Compile(String configuration) at
NAnt.VSNet.Tasks.SolutionTask.ExecuteTask() at NAnt.Core.Task.Execute() at
NAnt.Core.Target.Execute() at
NAnt.Core.Project.Execute(String targetName, Boolean forceDependencies) at
NAnt.Core.Project.Execute() at NAnt.Core.Project.Run() I have copied all the MbUnit dlls/executables
in the 'J:\ThirdParty\MbUnit\ folder. I am trying to figure this out for last
2-3 days but unsuccessful. Is it that the other project is using some MBUnit
functionality that is causing “Required permissions cannot be acquired”
exception? How come same reference is working in one project (A POC project)
and not other. Also please note that it is only MBUnit reference that is causing
the issue. I have reference to Nunit dlls, custom dlls from same folder (J:\...)
but all the references are being resolved correctly. Please note that the same
project is building successfully using VS.Net. Please let me know if someone can provide any
clues about it. Many thanks. Regards, Sandeep |