{"action":"created","issue":{"url":"https://api.github.com/repos/fsprojects/Paket/issues/827","labels_url":"https://api.github.com/repos/fsprojects/Paket/issues/827/labels{/name}","comments_url":"https://api.github.com/repos/fsprojects/Paket/issues/827/comments","events_url":"https://api.github.com/repos/fsprojects/Paket/issues/827/events","html_url":"https://github.com/fsprojects/Paket/issues/827","id":78117534,"number":827,"title":"`paket pack` fails when assembly uses attribute defined in other assembly.","user":{"login":"dmitryvk","id":120884,"avatar_url":"https://avatars.githubusercontent.com/u/120884?v=3","gravatar_id":"","url":"https://api.github.com/users/dmitryvk","html_url":"https://github.com/dmitryvk","followers_url":"https://api.github.com/users/dmitryvk/followers","following_url":"https://api.github.com/users/dmitryvk/following{/other_user}","gists_url":"https://api.github.com/users/dmitryvk/gists{/gist_id}","starred_url":"https://api.github.com/users/dmitryvk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmitryvk/subscriptions","organizations_url":"https://api.github.com/users/dmitryvk/orgs","repos_url":"https://api.github.com/users/dmitryvk/repos","events_url":"https://api.github.com/users/dmitryvk/events{/privacy}","received_events_url":"https://api.github.com/users/dmitryvk/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/fsprojects/Paket/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2015-05-19T14:43:13Z","updated_at":"2015-05-20T13:14:25Z","closed_at":"2015-05-20T10:13:45Z","body":"See example C# solution: https://github.com/dmitryvk/PaketPackExample\r\n\r\nI have a 2 projects: project `ClassLibrary1` defines custom attribute, and project `PaketPackExample` attaches this attribute to the output assembly. I'm trying to pack the `PaketPackExample` as nuget package and I'm getting the following output:\r\n\r\n```\r\n$ /c/users/user/Downloads/paket pack output build buildconfig Debug\r\nPaket version 1.4.13.0\r\nLoading custom attributes failed for PaketPackExample, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.\r\nMessage: Could not load file or assembly 'ClassLibrary1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one o\r\nf its dependencies. The system cannot find the file specified.\r\nPaket failed with:\r\n        Could not load file or assembly 'ClassLibrary1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of\r\n its dependencies. The system cannot find the file specified.\r\n```\r\n\r\nIf I comment out the following line from `PaketPackExample/Properties/AssemblyInfo.cs`:\r\n```\r\n[assembly: ExampleCustom]\r\n```\r\nthen `paket pack` produces nuget package.\r\n\r\nThe problem seems to be that `GetCustomAttributes` tries to load assemblies that define custom attributes (and `GetCustomAttributesData` seems to do the same).\r\n\r\nWith `--verbose` the output is as follows:\r\n```\r\n$ /c/users/user/Downloads/paket pack output build buildconfig Debug --verbose\r\nPaket version 1.4.13.0\r\nfound: c:\\bars\\code\\git\\PaketPackExample\\paket.dependencies\r\nParsing c:\\bars\\code\\git\\PaketPackExample\\paket.dependencies\r\nLoading assembly metadata for c:\\bars\\code\\git\\PaketPackExample\\PaketPackExample\\bin\\Debug\\PaketPackExample.exe\r\nLoading custom attributes failed for PaketPackExample, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.\r\nMessage: Could not load file or assembly 'ClassLibrary1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one o\r\nf its dependencies. The system cannot find the file specified.\r\nPaket failed with:\r\n        Could not load file or assembly 'ClassLibrary1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of\r\n its dependencies. The system cannot find the file specified.\r\nStackTrace:\r\n     at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount\r\n, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type)\r\n   at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInsta\r\nntiationContext, RuntimeTypeHandle[] methodInstantiationContext)\r\n   at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethod\r\nArguments)\r\n   at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope\r\n, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilte\r\nrType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMeth\r\nodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg)\r\n   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken,\r\n Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecorate\r\ndTargetSecurityTransparent)\r\n   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType)\r\n   at System.Reflection.RuntimeAssembly.GetCustomAttributes(Boolean inherit)\r\n   at Paket.PackageMetaData.loadAssemblyAttributes(Assembly assembly)\r\n   at Paket.PackageProcess.merged$cont@55(String buildConfig, TemplateFile templateFile, ProjectFile projectFile, Option\r\nalPackagingInfo opt, ProjectCoreInfo md, Unit unitVar)\r\n   at Paket.PackageProcess.f@1-97(String buildConfig, FSharpOption`1 version, HashSet`1 allTemplateFiles, ProjectFile pr\r\nojectFile, TemplateFile templateFile)\r\n   at Paket.PackageProcess.Pack(DependenciesFile dependencies, String packageOutputPath, FSharpOption`1 buildConfig, FSh\r\narpOption`1 version, FSharpOption`1 releaseNotes, FSharpOption`1 templateFile)\r\n   at Paket.Dependencies.Pack(String outputPath, FSharpOption`1 buildConfig, FSharpOption`1 version, FSharpOption`1 rele\r\naseNotes, FSharpOption`1 templateFile)\r\n   at Paket.Program.clo@268-26.Invoke(ArgParseResults`1 results)\r\n   at Paket.Program.processWithValidation[T](FSharpFunc`2 validateF, FSharpFunc`2 commandF, Command command, String[] ar\r\ngs)\r\n   at Paket.Program.processCommand@71-1.Invoke(Command command, String[] args)\r\n   at <StartupCode$paket>.$Paket.Program.main@()\r\n```"},"comment":{"url":"https://api.github.com/repos/fsprojects/Paket/issues/comments/103880745","html_url":"https://github.com/fsprojects/Paket/issues/827#issuecomment-103880745","issue_url":"https://api.github.com/repos/fsprojects/Paket/issues/827","id":103880745,"user":{"login":"forki","id":57396,"avatar_url":"https://avatars.githubusercontent.com/u/57396?v=3","gravatar_id":"","url":"https://api.github.com/users/forki","html_url":"https://github.com/forki","followers_url":"https://api.github.com/users/forki/followers","following_url":"https://api.github.com/users/forki/following{/other_user}","gists_url":"https://api.github.com/users/forki/gists{/gist_id}","starred_url":"https://api.github.com/users/forki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/forki/subscriptions","organizations_url":"https://api.github.com/users/forki/orgs","repos_url":"https://api.github.com/users/forki/repos","events_url":"https://api.github.com/users/forki/events{/privacy}","received_events_url":"https://api.github.com/users/forki/received_events","type":"User","site_admin":false},"created_at":"2015-05-20T13:14:25Z","updated_at":"2015-05-20T13:14:25Z","body":"@dimitryvk did it at least solve your issue?"}}