5 Replies - 471 Views - Last Post: 26 August 2011 - 04:19 AM Rate Topic: -----

#1 Billzum  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 25-August 11

Command Line Compilation Assistance

Posted 25 August 2011 - 05:45 PM

Greetings Code Monkeys!

I have recently taken up development of C# code. I come from a C/C++ and Java background. The language is not an issue... at least not yet. My problems lies within the command line interface provided by Microsoft. Namely csc.exe.

Details:
The target system has the .Net 1.0, 2.0, 3.0, and 3.5 frameworks installed. It also has the .Net 2.0 SDK and the "Windows SDK for Windows Server 2008 and .NET Framework 3.5". I need to compile under the .Net 3.5 framework to take advantage of the System.DirectoryServices.AccountManagement namespace.

Problem:
I launch the SDK command line utility and attempt to compile my *.cs file. No matter which command line utility I use I am still compiling under the .Net 2.0 framework. As such I receive an error to the effect of, "AccountManagement" is not a member of the "System.DirectoryServices" namespace. The exact error wording eludes me as it is produced on my work system. (Yes I am working from home currently...)

Please kindly provide me with some insight as to what I am doing wrong. I will update this post with further information from work tomorrow unless some brilliant soul can solve my issue before I get in in the morning!

**Edit** Not to be a new D.I.C. Head... If there is a searchable solution to this I cannot find it.

Thanks for reading about my troubles!
Bill

This post has been edited by Billzum: 25 August 2011 - 05:51 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Command Line Compilation Assistance

#2 Curtis Rutland  Icon User is online

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 4425
  • View blog
  • Posts: 7,693
  • Joined: 08-June 10

Re: Command Line Compilation Assistance

Posted 25 August 2011 - 05:51 PM

Make sure you're referencing the "System.DirectoryServices.AccountManagement.dll" assembly as well as "System.DirectoryServices.dll". Namespaces aren't necessarily contained to a single assembly.

Also, I'd suggest using Visual Studio rather than CSC.exe. It's just easier to use, and it's free (the Express edition, anyway).
Was This Post Helpful? 0
  • +
  • -

#3 Billzum  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 25-August 11

Re: Command Line Compilation Assistance

Posted 25 August 2011 - 05:54 PM

Quote

Make sure you're referencing the "System.DirectoryServices.AccountManagement.dll" assembly as well as "System.DirectoryServices.dll". Namespaces aren't necessarily contained to a single assembly.


This would be done through /r:System.DirectoryServices.AccountManagement.dll correct? If so I have tried this and received a response to the effect of Metadata is not available/unlocatable.
Was This Post Helpful? 0
  • +
  • -

#4 Curtis Rutland  Icon User is online

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 4425
  • View blog
  • Posts: 7,693
  • Joined: 08-June 10

Re: Command Line Compilation Assistance

Posted 25 August 2011 - 05:59 PM

Well, that seems to be an issue with the code itself, or possibly the way AD is set up, not an issue with CSC. I'm not very familiar with AD or DirectoryServices, so I probably can't help more with that. Have you tried googling the exact error text? Usually there's some good info from people with the same error as you.
Was This Post Helpful? 0
  • +
  • -

#5 Billzum  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 25-August 11

Re: Command Line Compilation Assistance

Posted 25 August 2011 - 06:02 PM

Thank you Curtis. I will be posting more detailed information tomorrow when I have it available. Exact error messages, source, and anything else I might think of! I'll become fully familiarized with this language in no time!

This post has been edited by Billzum: 25 August 2011 - 06:03 PM

Was This Post Helpful? 0
  • +
  • -

#6 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6034
  • View blog
  • Posts: 23,417
  • Joined: 23-August 08

Re: Command Line Compilation Assistance

Posted 26 August 2011 - 04:19 AM

Are you using the Visual Studio Command Line shortcut that sets up your environment for you?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1