Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 366459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T13:38:06+00:00 2026-05-12T13:38:06+00:00

After moving a project from .NET 1.1 to .NET 2.0, MsBuild emits lots of

  • 0

After moving a project from .NET 1.1 to .NET 2.0, MsBuild emits lots of warnings for some COM objects.

Sample code for test (actual code doesn’t matter, just used to create the warnings):

using System;
using System.DirectoryServices;
using ActiveDs;
namespace Test
{
    public class Class1
    {
        public static void Main(string[] args)
        {
            string adsPath = String.Format("WinNT://{0}/{1}", args[0], args[1]);
            DirectoryEntry localuser = new DirectoryEntry(adsPath);
            IADsUser pUser = (IADsUser) localuser.NativeObject;
            Console.WriteLine("User = {0}", pUser.ADsPath);
        }
    }
}

Warning messages look like

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets : warning : At least one of the arguments for ‘ITypeLib.RemoteGetLibAttr’ cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.

Observations:

  • Happens for ActiveDs (11 warnings) and MSXML2 (54 warnings).
  • Not seen for our own COM objects.
  • <Reference> entry in .csproj file contains attribute WrapperTool = "tlbimp"
  • Despite of all warnings, no problems have been observed in the running system.

Any idea how to get rid of the warnings?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T13:38:06+00:00Added an answer on May 12, 2026 at 1:38 pm

    According to a comment in the MDSN article about TLBIMP for 2.0, you can’t fix this problem w/o running TLBIMP yourself.

    It was easy to reproduce your problem using VS. I also reproduced it running TLBIMP manually from a VS comment prompt:

       tlbimp c:\WINNT\system32\activeds.tlb /out:interop.activeds.dll
    

    The fix was to use the /silent switch

       tlbimp c:\WINNT\system32\activeds.tlb /silent /out:interop.activeds.dll
    

    As pointed out in the comment in the MSDN article, the COM reference becomes a .net assembly reference to the interop assembly you built yourself.

    I’m not a VS expert, but I made this work by adding a prebuild to project of:

        "$(DevEnvDir)\..\..\SDK\v2.0\bin\tlbimp" c:\WINNT\system32\activeds.tlb
                /namespace:ActiveDs /silent /out:"$(ProjectDir)interop.activeds.dll"
    

    Built it once so I’d have a dll to add a reference with the browse tab. Added a reference to the interop.activeds.dll in my project root and then built again. You may want to do this some other way, like with an external make file via a C++ project. This is more of a POC.

    Note a funny difference in MSBUILD vs VS, $(DevEnvDir) has a trailing backslash but MSBUILD does not.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm experiencing some weird behaviour after moving from Windows XP to Windows 7 on
We're moving our version control from some old VCS to SVN, for ease of
for a project in OpenCV I would like to segment moving objects as good
I'm moving a project from SubSonic to NHibernate and am using Fluent NHibernate to
I'm getting several of the following warnings in VS2005 on an old project after
I'm having a problem with a project in Visual Studio 2010 after moving to
After moving to the new server, I'm getting plenty of such notifications: A PHP
I'm trying the moving limit after zoom with canvas scale, but new coordinates does
I want to access RegEx results after I am done moving files with this
After some time researching and trying different things I still cannot get my @ExceptionHandler

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.