简体   繁体   中英

How to add a third party DLL to a CSharp Project using Roslyn?

How to add a third party DLL using Roslyn to a CSharp Project?

I am not getting any code where we can add third party DLL-s ..

Achieved it using following code

 NameSyntax name = SyntaxFactory.IdentifierName("your namespace");
 UsingDirectiveSyntax obj = SyntaxFactory.UsingDirective(name);
 var newusing = newDocRoot.Usings.Add(obj);
 root = root.WithUsings(newusing);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM