{"id":1502,"date":"2013-02-27T15:31:40","date_gmt":"2013-02-27T13:31:40","guid":{"rendered":"http:\/\/mariusbancila.ro\/blog\/?p=1502"},"modified":"2013-02-27T15:31:40","modified_gmt":"2013-02-27T13:31:40","slug":"error-c3510-cannot-locate-dependent-type-library-bed7f4ea-1a96-11d2-8f08-00a0c9a6186d-v-2-4","status":"publish","type":"post","link":"https:\/\/mariusbancila.ro\/blog\/2013\/02\/27\/error-c3510-cannot-locate-dependent-type-library-bed7f4ea-1a96-11d2-8f08-00a0c9a6186d-v-2-4\/","title":{"rendered":"error C3510: cannot locate dependent type library &#8221; {bed7f4ea-1a96-11d2-8f08-00a0c9a6186d} v.2.4"},"content":{"rendered":"<h3>Problem<\/h3>\n<p>I have recently migrated a C# 2.0 project registered for COM interop to .NET 4.5 and when I imported the type library in a C++ project with <strong>no_registry<\/strong>, suddenly I got some errors because the type library could not be imported. Here are the steps to reproduce:<\/p>\n<ul>\n<li>create a .NET Class Library project and set platform target to .NET framework 4.5<\/li>\n<li>check <strong>Register for COM interop<\/strong><\/li>\n<li>build the project<\/li>\n<li>import the type library in a C++ project:\n<pre class=\"cpp\" name=\"code\">\r\n#import \"DemoClassLibrary.tlb\" no_dual_interfaces no_registry\r\n<\/pre>\n<\/li>\n<\/ul>\n<p>The result is the following error:<\/p>\n<pre class=\"vsoutput\">\r\n1>[...]: error C3510: cannot locate dependent type library '' {bed7f4ea-1a96-11d2-8f08-00a0c9a6186d} v.2.4\r\n1>[...]: fatal error C1083: Cannot open type library file: '[...]\\democlasslibrary.tlb': Error loading type library\/DLL.\r\n<\/pre>\n<h3>Solution<\/h3>\n<p>Searching for the solution I found that this was a known issue when you have both CLR 2.0 and 4.0 installed on the same machine. See this KB article: <a href=\"http:\/\/support.microsoft.com\/kb\/2590020\">VC++ 2010 #import with no_registry fails with error C1083 or C3510<\/a>. Unfortunately I was unable to fix the problem with the solution indicated there.<\/p>\n<p>There are two tools that can generate a type library from an assembly:<\/p>\n<ul>\n<li><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/hfzzah2c.aspx\">tlbexp.exe<\/a>: generates a type library from a specified .NET assembly<\/li>\n<li><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/tzat5yw6.aspx\">regasm.exe<\/a>: registers metadata from an assembly to the Windows Registry, but in addition can create a type library from for the input assembly when \/tlb switch is used.<\/li>\n<\/ul>\n<p>When a project specifies to register for COM interop what Visual Studio does is similar to calling regasm.exe with \/codebase switch specified. Since I had before problems with interop assemblies automatically generated by Visual Studio (with tlbimp.exe) I though it would be the same (only the other way around). Therefore I unchecked &#8220;register for COM interop&#8221; and added as a custom build step registration with regasm.exe, like this:<\/p>\n<pre class=\"console\">\r\nc:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\regasm.exe DemoClassLibrary.dll \/tlb:DemoClassLibrary.tlb\r\n<\/pre>\n<p>Not very surprisingly, the generated file was different and the #import command executed without problems.<\/p>\n<p>Problem solved!<\/p>\n<h3>Cause<\/h3>\n<p>The question that arises is why are the two files, generated with Visual Studio and with regasm.exe, different? You can see they are different if you open them in an hex editor. But if you just use oleview.exe, the disassembled type library looks identical.<\/p>\n<p>The obvious answer that occurred to me, but eventually proved wrong, was that Visual Studio is not actually using regasm.exe to register the assembly and generate the type library. It actually uses a MSBuild task for that.<\/p>\n<p>When the RegisterForComInterop property is set in a .csproj an MSBuild task is executed.<\/p>\n<pre class=\"vsoutput\">\r\n1>Using \"RegisterAssembly\" task from assembly \"Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\".\r\n1>Task \"RegisterAssembly\" (TaskId:32)\r\n1>  Task Parameter:Assemblies=[...]\\DemoClassLibrary.dll (TaskId:32)\r\n1>  Task Parameter:TypeLibFiles=[...]\\DemoClassLibrary.tlb (TaskId:32)\r\n1>  Task Parameter:AssemblyListFile=obj\\DemoClassLibrary.csproj.UnmanagedRegistration.cache (TaskId:32)\r\n1>  Task Parameter:CreateCodeBase=True (TaskId:32)\r\n1>  Registering assembly \"[...]\\DemoClassLibrary.dll\" for COM Interop. (TaskId:32)\r\n1>  Exporting and registering type library \"[...]\\DemoClassLibrary.tlb\". (TaskId:32)\r\n1>  Type 'P' exported. (TaskId:32)\r\n1>  Type 'P' exported. (TaskId:32)\r\n1>Done executing task \"RegisterAssembly\". (TaskId:32)\r\n<\/pre>\n<p>The task can be found in Microsoft.Common.targets (in c:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\)<\/p>\n<pre class=\"xml\" name=\"code\">\r\n  &lt;!--\r\n    ============================================================\r\n                                        UnmanagedRegistration\r\n\r\n    Registers the main assembly for COM interop.\r\n    ============================================================\r\n    -->\r\n  &lt;PropertyGroup>\r\n    &lt;UnmanagedRegistrationDependsOn>&lt;\/UnmanagedRegistrationDependsOn>\r\n  &lt;\/PropertyGroup>\r\n  &lt;Target\r\n      Name=\"UnmanagedRegistration\"\r\n      Condition=\"'$(RegisterForComInterop)'=='true' and '$(OutputType)'=='library'\"\r\n      DependsOnTargets=\"$(UnmanagedRegistrationDependsOn)\"\r\n        >\r\n\r\n    &lt;PropertyGroup>\r\n      &lt;RegisterAssemblyMSBuildArchitecture Condition=\"'$(RegisterAssemblyMSBuildArchitecture)' == ''\">$(PlatformTargetAsMSBuildArchitecture)&lt;\/RegisterAssemblyMSBuildArchitecture>\r\n    &lt;\/PropertyGroup>\r\n\r\n    &lt;PropertyGroup Condition=\"'$(TargetFrameworkAsMSBuildRuntime)' != '' and '$(RegisterAssemblyMSBuildArchitecture)' != ''\">\r\n      &lt;!-- Falling back to the current runtime if we are targeting CLR2 and the task host doesn't exist will lead to \r\n           incorrect behavior in some cases, but it's the same incorrect behavior as Visual Studio 2010, and thus better\r\n           than causing build breaks on upgrade to Win8 the way not doing so would.  For more details, see the \r\n           corresponding comment in GenerateResource. -->\r\n      &lt;RegisterAssemblyMSBuildRuntime \r\n          Condition=\"'$(RegisterAssemblyMSBuildRuntime)' == '' and \r\n                     $([MSBuild]::DoesTaskHostExist(`$(TargetFrameworkAsMSBuildRuntime)`, `$(RegisterAssemblyMSBuildArchitecture)`))\">$(TargetFrameworkAsMSBuildRuntime)&lt;\/RegisterAssemblyMSBuildRuntime>\r\n\r\n      &lt;!-- If the targeted runtime doesn't exist, fall back to current -->\r\n      &lt;RegisterAssemblyMSBuildRuntime Condition=\"'$(RegisterAssemblyMSBuildRuntime)' == ''\">CurrentRuntime&lt;\/RegisterAssemblyMSBuildRuntime>\r\n    &lt;\/PropertyGroup>\r\n\r\n    &lt;RegisterAssembly\r\n        Assemblies=\"@(_OutputPathItem->'%(FullPath)$(TargetFileName)')\"\r\n        TypeLibFiles=\"@(_OutputPathItem->'%(FullPath)$(TargetName).tlb')\"\r\n        AssemblyListFile=\"@(_UnmanagedRegistrationCache)\"\r\n        CreateCodeBase=\"true\"\r\n        MSBuildRuntime=\"$(RegisterAssemblyMSBuildRuntime)\"\r\n        MSBuildArchitecture=\"$(RegisterAssemblyMSBuildArchitecture)\"\r\n        Condition=\"!Exists('@(_UnmanagedRegistrationCache)')\"\/>\r\n\r\n    &lt;ItemGroup>\r\n      &lt;FileWrites Include=\"@(_OutputPathItem->'%(FullPath)$(TargetName).tlb')\"\/>\r\n    &lt;\/ItemGroup>\r\n  &lt;\/Target>\r\n<\/pre>\n<p>To check if I can reproduce, I have created MSBuild file (explicitreg.xml) with some hard-coded values that only runs that registration task.<\/p>\n<pre class=\"xml\" name=\"code\">\r\n&lt;?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n&lt;Project ToolsVersion=\"4.0\" DefaultTargets=\"UnmanagedRegistration\" xmlns=\"http:\/\/schemas.microsoft.com\/developer\/msbuild\/2003\">\r\n  &lt;PropertyGroup>\r\n    &lt;UnmanagedRegistrationDependsOn>&lt;\/UnmanagedRegistrationDependsOn>\r\n  &lt;\/PropertyGroup>\r\n  &lt;Target\r\n      Name=\"UnmanagedRegistration\"\r\n      DependsOnTargets=\"$(UnmanagedRegistrationDependsOn)\"\r\n        >\r\n\r\n    &lt;PropertyGroup>\r\n      &lt;RegisterAssemblyMSBuildArchitecture Condition=\"'$(RegisterAssemblyMSBuildArchitecture)' == ''\">$(PlatformTargetAsMSBuildArchitecture)&lt;\/RegisterAssemblyMSBuildArchitecture>\r\n    &lt;\/PropertyGroup>\r\n\r\n    &lt;PropertyGroup Condition=\"'$(TargetFrameworkAsMSBuildRuntime)' != '' and '$(RegisterAssemblyMSBuildArchitecture)' != ''\">\r\n      &lt;RegisterAssemblyMSBuildRuntime \r\n          Condition=\"'$(RegisterAssemblyMSBuildRuntime)' == '' and \r\n                     $([MSBuild]::DoesTaskHostExist(`$(TargetFrameworkAsMSBuildRuntime)`, `$(RegisterAssemblyMSBuildArchitecture)`))\">$(TargetFrameworkAsMSBuildRuntime)&lt;\/RegisterAssemblyMSBuildRuntime>\r\n\r\n      &lt;!-- If the targeted runtime doesn't exist, fall back to current -->\r\n      &lt;RegisterAssemblyMSBuildRuntime Condition=\"'$(RegisterAssemblyMSBuildRuntime)' == ''\">CurrentRuntime&lt;\/RegisterAssemblyMSBuildRuntime>\r\n    &lt;\/PropertyGroup>\r\n\r\n    &lt;RegisterAssembly\r\n        Assemblies=\"bin\\Debug\\DemoClassLibrary.dll\"\r\n        TypeLibFiles=\"bin\\Debug\\DemoClassLibrary.tlb\"\r\n        AssemblyListFile=\"obj\\DemoClassLibrary.csproj.UnmanagedRegistration.cache\"\r\n        CreateCodeBase=\"true\" \/>\r\n\r\n    &lt;ItemGroup>\r\n      &lt;FileWrites Include=\"bin\\Debug\\DemoClassLibrary.tlb\"\/>\r\n    &lt;\/ItemGroup>\r\n  &lt;\/Target>\r\n&lt;\/Project>\r\n<\/pre>\n<pre class=\"console\">\r\nc:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\msbuild.exe explicitreg.xml\r\n<\/pre>\n<p>But surprise: this produced the exact same output as the regasm.exe command. Comparing the diagnose logs from MSBuild (for the build of the .csproj and my custom file) I couldn&#8217;t spot any difference in the execution of the task. Also using the Process Monitor (procmon.exe from Sysinternals) to check access to the TLB file, I could clearly see the difference for the file writing, because different lengths were produced from Visual Studio build and explicit MSBuild run, though again I could not see any difference in the call stacks.<\/p>\n<p>So, the actual cause for this behavior is still unknown to me and I would appreciate if anyone that knows the answer clarifies it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Problem I have recently migrated a C# 2.0 project registered for COM interop to .NET 4.5 and when I imported the type library in a C++ project with no_registry, suddenly I got some errors because the type library could not be imported. Here are the steps to reproduce: create a .NET Class Library project and &#8230; <a title=\"error C3510: cannot locate dependent type library &#8221; {bed7f4ea-1a96-11d2-8f08-00a0c9a6186d} v.2.4\" class=\"read-more\" href=\"https:\/\/mariusbancila.ro\/blog\/2013\/02\/27\/error-c3510-cannot-locate-dependent-type-library-bed7f4ea-1a96-11d2-8f08-00a0c9a6186d-v-2-4\/\" aria-label=\"Read more about error C3510: cannot locate dependent type library &#8221; {bed7f4ea-1a96-11d2-8f08-00a0c9a6186d} v.2.4\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","advgb_blocks_editor_width":"","advgb_blocks_columns_visual_guide":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[13,11,7,52,10,8],"tags":[454,451,461,301,133,350,351,317],"class_list":["post-1502","post","type-post","status-publish","format-standard","hentry","category-net","category-csharp","category-c","category-tools","category-visual-studio","category-windows-programming","tag-net","tag-c","tag-com","tag-interop","tag-msbuild","tag-regasm","tag-tlbexp","tag-vs2012"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.3 - aioseo.com -->\n\t<meta name=\"description\" content=\"resolving the problem of importing TLB file generated from an assembly that targets .NET 4.5\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Marius Bancila\"\/>\n\t<meta name=\"keywords\" content=\"vs2012,.net,c++,msbuild,regasm,tlbexp,com,interop\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/mariusbancila.ro\/blog\/2013\/02\/27\/error-c3510-cannot-locate-dependent-type-library-bed7f4ea-1a96-11d2-8f08-00a0c9a6186d-v-2-4\/\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.3\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Marius Bancila&#039;s Blog | About code. Mostly on C++\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"error C3510: cannot locate dependent type library &#039;&#039; {bed7f4ea-1a96-11d2-8f08-00a0c9a6186d} v.2.4\" \/>\n\t\t<meta property=\"og:description\" content=\"resolving the problem of importing TLB file generated from an assembly that targets .NET 4.5\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/mariusbancila.ro\/blog\/2013\/02\/27\/error-c3510-cannot-locate-dependent-type-library-bed7f4ea-1a96-11d2-8f08-00a0c9a6186d-v-2-4\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2013-02-27T13:31:40+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2013-02-27T13:31:40+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"error C3510: cannot locate dependent type library &#039;&#039; {bed7f4ea-1a96-11d2-8f08-00a0c9a6186d} v.2.4\" \/>\n\t\t<meta name=\"twitter:description\" content=\"resolving the problem of importing TLB file generated from an assembly that targets .NET 4.5\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2013\\\/02\\\/27\\\/error-c3510-cannot-locate-dependent-type-library-bed7f4ea-1a96-11d2-8f08-00a0c9a6186d-v-2-4\\\/#article\",\"name\":\"error C3510: cannot locate dependent type library '' {bed7f4ea-1a96-11d2-8f08-00a0c9a6186d} v.2.4\",\"headline\":\"error C3510: cannot locate dependent type library &#8221; {bed7f4ea-1a96-11d2-8f08-00a0c9a6186d} v.2.4\",\"author\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/author\\\/admin\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#organization\"},\"datePublished\":\"2013-02-27T15:31:40+02:00\",\"dateModified\":\"2013-02-27T15:31:40+02:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2013\\\/02\\\/27\\\/error-c3510-cannot-locate-dependent-type-library-bed7f4ea-1a96-11d2-8f08-00a0c9a6186d-v-2-4\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2013\\\/02\\\/27\\\/error-c3510-cannot-locate-dependent-type-library-bed7f4ea-1a96-11d2-8f08-00a0c9a6186d-v-2-4\\\/#webpage\"},\"articleSection\":\".NET, C#, C++, Tools, Visual Studio, Windows Programming, .NET, C++, COM, interop, msbuild, regasm, tlbexp, VS2012\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2013\\\/02\\\/27\\\/error-c3510-cannot-locate-dependent-type-library-bed7f4ea-1a96-11d2-8f08-00a0c9a6186d-v-2-4\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/#listItem\",\"name\":\"IT\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/#listItem\",\"position\":2,\"name\":\"IT\",\"item\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/#listItem\",\"name\":\"Software\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/#listItem\",\"position\":3,\"name\":\"Software\",\"item\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/net\\\/#listItem\",\"name\":\".NET\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/#listItem\",\"name\":\"IT\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/net\\\/#listItem\",\"position\":4,\"name\":\".NET\",\"item\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/net\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/net\\\/csharp\\\/#listItem\",\"name\":\"C#\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/#listItem\",\"name\":\"Software\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/net\\\/csharp\\\/#listItem\",\"position\":5,\"name\":\"C#\",\"item\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/net\\\/csharp\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2013\\\/02\\\/27\\\/error-c3510-cannot-locate-dependent-type-library-bed7f4ea-1a96-11d2-8f08-00a0c9a6186d-v-2-4\\\/#listItem\",\"name\":\"error C3510: cannot locate dependent type library &#8221; {bed7f4ea-1a96-11d2-8f08-00a0c9a6186d} v.2.4\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/net\\\/#listItem\",\"name\":\".NET\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2013\\\/02\\\/27\\\/error-c3510-cannot-locate-dependent-type-library-bed7f4ea-1a96-11d2-8f08-00a0c9a6186d-v-2-4\\\/#listItem\",\"position\":6,\"name\":\"error C3510: cannot locate dependent type library &#8221; {bed7f4ea-1a96-11d2-8f08-00a0c9a6186d} v.2.4\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/net\\\/csharp\\\/#listItem\",\"name\":\"C#\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#organization\",\"name\":\"Marius Bancila's Blog\",\"description\":\"About code. Mostly on C++\",\"url\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/author\\\/admin\\\/#author\",\"url\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/author\\\/admin\\\/\",\"name\":\"Marius Bancila\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2013\\\/02\\\/27\\\/error-c3510-cannot-locate-dependent-type-library-bed7f4ea-1a96-11d2-8f08-00a0c9a6186d-v-2-4\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a84dd2831d955c38355ddea55df4df260809b88f36408bc14fd4eab8f7f131c9?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Marius Bancila\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2013\\\/02\\\/27\\\/error-c3510-cannot-locate-dependent-type-library-bed7f4ea-1a96-11d2-8f08-00a0c9a6186d-v-2-4\\\/#webpage\",\"url\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2013\\\/02\\\/27\\\/error-c3510-cannot-locate-dependent-type-library-bed7f4ea-1a96-11d2-8f08-00a0c9a6186d-v-2-4\\\/\",\"name\":\"error C3510: cannot locate dependent type library '' {bed7f4ea-1a96-11d2-8f08-00a0c9a6186d} v.2.4\",\"description\":\"resolving the problem of importing TLB file generated from an assembly that targets .NET 4.5\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2013\\\/02\\\/27\\\/error-c3510-cannot-locate-dependent-type-library-bed7f4ea-1a96-11d2-8f08-00a0c9a6186d-v-2-4\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/author\\\/admin\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/author\\\/admin\\\/#author\"},\"datePublished\":\"2013-02-27T15:31:40+02:00\",\"dateModified\":\"2013-02-27T15:31:40+02:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/\",\"name\":\"Marius Bancila's Blog\",\"description\":\"About code. Mostly on C++\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"error C3510: cannot locate dependent type library '' {bed7f4ea-1a96-11d2-8f08-00a0c9a6186d} v.2.4","description":"resolving the problem of importing TLB file generated from an assembly that targets .NET 4.5","canonical_url":"https:\/\/mariusbancila.ro\/blog\/2013\/02\/27\/error-c3510-cannot-locate-dependent-type-library-bed7f4ea-1a96-11d2-8f08-00a0c9a6186d-v-2-4\/","robots":"max-image-preview:large","keywords":"vs2012,.net,c++,msbuild,regasm,tlbexp,com,interop","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/mariusbancila.ro\/blog\/2013\/02\/27\/error-c3510-cannot-locate-dependent-type-library-bed7f4ea-1a96-11d2-8f08-00a0c9a6186d-v-2-4\/#article","name":"error C3510: cannot locate dependent type library '' {bed7f4ea-1a96-11d2-8f08-00a0c9a6186d} v.2.4","headline":"error C3510: cannot locate dependent type library &#8221; {bed7f4ea-1a96-11d2-8f08-00a0c9a6186d} v.2.4","author":{"@id":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/#author"},"publisher":{"@id":"https:\/\/mariusbancila.ro\/blog\/#organization"},"datePublished":"2013-02-27T15:31:40+02:00","dateModified":"2013-02-27T15:31:40+02:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/mariusbancila.ro\/blog\/2013\/02\/27\/error-c3510-cannot-locate-dependent-type-library-bed7f4ea-1a96-11d2-8f08-00a0c9a6186d-v-2-4\/#webpage"},"isPartOf":{"@id":"https:\/\/mariusbancila.ro\/blog\/2013\/02\/27\/error-c3510-cannot-locate-dependent-type-library-bed7f4ea-1a96-11d2-8f08-00a0c9a6186d-v-2-4\/#webpage"},"articleSection":".NET, C#, C++, Tools, Visual Studio, Windows Programming, .NET, C++, COM, interop, msbuild, regasm, tlbexp, VS2012"},{"@type":"BreadcrumbList","@id":"https:\/\/mariusbancila.ro\/blog\/2013\/02\/27\/error-c3510-cannot-locate-dependent-type-library-bed7f4ea-1a96-11d2-8f08-00a0c9a6186d-v-2-4\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/#listItem","position":1,"name":"Home","item":"https:\/\/mariusbancila.ro\/blog\/","nextItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/#listItem","name":"IT"}},{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/#listItem","position":2,"name":"IT","item":"https:\/\/mariusbancila.ro\/blog\/category\/it\/","nextItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/#listItem","name":"Software"},"previousItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/#listItem","position":3,"name":"Software","item":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/","nextItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/net\/#listItem","name":".NET"},"previousItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/#listItem","name":"IT"}},{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/net\/#listItem","position":4,"name":".NET","item":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/net\/","nextItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/net\/csharp\/#listItem","name":"C#"},"previousItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/#listItem","name":"Software"}},{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/net\/csharp\/#listItem","position":5,"name":"C#","item":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/net\/csharp\/","nextItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/2013\/02\/27\/error-c3510-cannot-locate-dependent-type-library-bed7f4ea-1a96-11d2-8f08-00a0c9a6186d-v-2-4\/#listItem","name":"error C3510: cannot locate dependent type library &#8221; {bed7f4ea-1a96-11d2-8f08-00a0c9a6186d} v.2.4"},"previousItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/net\/#listItem","name":".NET"}},{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/2013\/02\/27\/error-c3510-cannot-locate-dependent-type-library-bed7f4ea-1a96-11d2-8f08-00a0c9a6186d-v-2-4\/#listItem","position":6,"name":"error C3510: cannot locate dependent type library &#8221; {bed7f4ea-1a96-11d2-8f08-00a0c9a6186d} v.2.4","previousItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/net\/csharp\/#listItem","name":"C#"}}]},{"@type":"Organization","@id":"https:\/\/mariusbancila.ro\/blog\/#organization","name":"Marius Bancila's Blog","description":"About code. Mostly on C++","url":"https:\/\/mariusbancila.ro\/blog\/"},{"@type":"Person","@id":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/#author","url":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/","name":"Marius Bancila","image":{"@type":"ImageObject","@id":"https:\/\/mariusbancila.ro\/blog\/2013\/02\/27\/error-c3510-cannot-locate-dependent-type-library-bed7f4ea-1a96-11d2-8f08-00a0c9a6186d-v-2-4\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/a84dd2831d955c38355ddea55df4df260809b88f36408bc14fd4eab8f7f131c9?s=96&d=mm&r=g","width":96,"height":96,"caption":"Marius Bancila"}},{"@type":"WebPage","@id":"https:\/\/mariusbancila.ro\/blog\/2013\/02\/27\/error-c3510-cannot-locate-dependent-type-library-bed7f4ea-1a96-11d2-8f08-00a0c9a6186d-v-2-4\/#webpage","url":"https:\/\/mariusbancila.ro\/blog\/2013\/02\/27\/error-c3510-cannot-locate-dependent-type-library-bed7f4ea-1a96-11d2-8f08-00a0c9a6186d-v-2-4\/","name":"error C3510: cannot locate dependent type library '' {bed7f4ea-1a96-11d2-8f08-00a0c9a6186d} v.2.4","description":"resolving the problem of importing TLB file generated from an assembly that targets .NET 4.5","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/mariusbancila.ro\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/mariusbancila.ro\/blog\/2013\/02\/27\/error-c3510-cannot-locate-dependent-type-library-bed7f4ea-1a96-11d2-8f08-00a0c9a6186d-v-2-4\/#breadcrumblist"},"author":{"@id":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/#author"},"creator":{"@id":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/#author"},"datePublished":"2013-02-27T15:31:40+02:00","dateModified":"2013-02-27T15:31:40+02:00"},{"@type":"WebSite","@id":"https:\/\/mariusbancila.ro\/blog\/#website","url":"https:\/\/mariusbancila.ro\/blog\/","name":"Marius Bancila's Blog","description":"About code. Mostly on C++","inLanguage":"en-US","publisher":{"@id":"https:\/\/mariusbancila.ro\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"Marius Bancila's Blog | About code. Mostly on C++","og:type":"article","og:title":"error C3510: cannot locate dependent type library '' {bed7f4ea-1a96-11d2-8f08-00a0c9a6186d} v.2.4","og:description":"resolving the problem of importing TLB file generated from an assembly that targets .NET 4.5","og:url":"https:\/\/mariusbancila.ro\/blog\/2013\/02\/27\/error-c3510-cannot-locate-dependent-type-library-bed7f4ea-1a96-11d2-8f08-00a0c9a6186d-v-2-4\/","article:published_time":"2013-02-27T13:31:40+00:00","article:modified_time":"2013-02-27T13:31:40+00:00","twitter:card":"summary","twitter:title":"error C3510: cannot locate dependent type library '' {bed7f4ea-1a96-11d2-8f08-00a0c9a6186d} v.2.4","twitter:description":"resolving the problem of importing TLB file generated from an assembly that targets .NET 4.5"},"aioseo_meta_data":{"post_id":"1502","title":"error C3510: cannot locate dependent type library '' {bed7f4ea-1a96-11d2-8f08-00a0c9a6186d} v.2.4","description":"resolving the problem of importing TLB file generated from an assembly that targets .NET 4.5","keywords":[{"label":"VS2012","value":"VS2012"},{"label":".NET","value":".NET"},{"label":"C++","value":"C++"},{"label":"MSBuild","value":"MSBuild"},{"label":"regasm","value":"regasm"},{"label":"tlbexp","value":"tlbexp"},{"label":"COM","value":"COM"},{"label":"interop","value":"interop"}],"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2021-03-18 21:12:20","updated":"2025-12-12 07:39:24","seo_analyzer_scan_date":null,"focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"author_meta":{"display_name":"Marius Bancila","author_link":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/"},"featured_img":null,"jetpack_publicize_connections":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"Marius Bancila","author_link":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/"},"uagb_comment_info":0,"uagb_excerpt":"Problem I have recently migrated a C# 2.0 project registered for COM interop to .NET 4.5 and when I imported the type library in a C++ project with no_registry, suddenly I got some errors because the type library could not be imported. Here are the steps to reproduce: create a .NET Class Library project and&hellip;","coauthors":[],"tax_additional":{"categories":{"linked":["<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/net\/\" class=\"advgb-post-tax-term\">.NET<\/a>","<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/net\/csharp\/\" class=\"advgb-post-tax-term\">C#<\/a>","<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/c\/\" class=\"advgb-post-tax-term\">C++<\/a>","<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/tools\/\" class=\"advgb-post-tax-term\">Tools<\/a>","<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/visual-studio\/\" class=\"advgb-post-tax-term\">Visual Studio<\/a>","<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/windows-programming\/\" class=\"advgb-post-tax-term\">Windows Programming<\/a>"],"unlinked":["<span class=\"advgb-post-tax-term\">.NET<\/span>","<span class=\"advgb-post-tax-term\">C#<\/span>","<span class=\"advgb-post-tax-term\">C++<\/span>","<span class=\"advgb-post-tax-term\">Tools<\/span>","<span class=\"advgb-post-tax-term\">Visual Studio<\/span>","<span class=\"advgb-post-tax-term\">Windows Programming<\/span>"]},"tags":{"linked":["<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/windows-programming\/\" class=\"advgb-post-tax-term\">.NET<\/a>","<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/windows-programming\/\" class=\"advgb-post-tax-term\">C++<\/a>","<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/windows-programming\/\" class=\"advgb-post-tax-term\">COM<\/a>","<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/windows-programming\/\" class=\"advgb-post-tax-term\">interop<\/a>","<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/windows-programming\/\" class=\"advgb-post-tax-term\">msbuild<\/a>","<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/windows-programming\/\" class=\"advgb-post-tax-term\">regasm<\/a>","<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/windows-programming\/\" class=\"advgb-post-tax-term\">tlbexp<\/a>","<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/windows-programming\/\" class=\"advgb-post-tax-term\">VS2012<\/a>"],"unlinked":["<span class=\"advgb-post-tax-term\">.NET<\/span>","<span class=\"advgb-post-tax-term\">C++<\/span>","<span class=\"advgb-post-tax-term\">COM<\/span>","<span class=\"advgb-post-tax-term\">interop<\/span>","<span class=\"advgb-post-tax-term\">msbuild<\/span>","<span class=\"advgb-post-tax-term\">regasm<\/span>","<span class=\"advgb-post-tax-term\">tlbexp<\/span>","<span class=\"advgb-post-tax-term\">VS2012<\/span>"]}},"comment_count":"0","relative_dates":{"created":"Posted 14 years ago","modified":"Updated 14 years ago"},"absolute_dates":{"created":"Posted on February 27, 2013","modified":"Updated on February 27, 2013"},"absolute_dates_time":{"created":"Posted on February 27, 2013 3:31 pm","modified":"Updated on February 27, 2013 3:31 pm"},"featured_img_caption":"","series_order":"","jetpack_shortlink":"https:\/\/wp.me\/pYNdv-oe","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/posts\/1502","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/comments?post=1502"}],"version-history":[{"count":12,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/posts\/1502\/revisions"}],"predecessor-version":[{"id":1514,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/posts\/1502\/revisions\/1514"}],"wp:attachment":[{"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/media?parent=1502"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/categories?post=1502"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/tags?post=1502"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}