I have created a C# console application that contains the namespaces System and System.Data
Additionally, I have added Microsoft.SqlServer.Smo.
When I try to compile from command prompt it shows the error as:
SqlSmoDiscovery.cs(3,27): error
CS0234: The type or namespace name
‘Management’
does not exist in the namespace ‘Microsoft.SqlServer’ (are
you missing
an assembly reference?) SqlSmoDiscovery.cs(4,27): error
CS0234: The type or namespace name
‘Management’
does not exist in the namespace ‘Microsoft.SqlServer’ (are
you missing
an assembly reference?)
But it compiles from Visual Studio.
I am compiling from command prompt to have output as pure C# dll.
My Project in g:
then i navigate to G:\SqlDisc:> csc /target:library /r Micrsoft.SqlServer.Smo.Dll
SqlSmoDiscovery.cs but it shows the erroe as
error CS0006: Metadata file ‘Microsoft.SqlServer.Smo.dll’ could not be found
Use the
/rflag to reference additional assemblies from the command line.