I wanted to compile c++ code at runtime in c# application.To compile c# code in c# application,i used CSharpCodeProvider(CodeDom).So,now i want to compile c++ code,i checked some resources,topics,and all of them says,to compile c++ code,i need to use CppCodeProvider,so,its in Microsoft.VisualC namespace,i found Microsoft.VisualC.dll,and imported to my project.When i tried to use CppCodeProvider,its not found.There is no CppCodeProvider in Microsoft.VisualC. Help me please.Where i need to find CppCodeProvider?
Asked
Active
Viewed 1,747 times
0
-
1From the documentation you linked to, it's in cppcodeprovider.dll - did you add a reference to *that* assembly? – Jon Skeet Jan 25 '19 at 07:10
-
nope,i not added it – Byte Jan 25 '19 at 07:16
-
@JonSkeet post your answer as answer.Thanks for help! – Byte Jan 25 '19 at 07:17
1 Answers
3
It's in the cppcodeprovider.dll assembly - that's the one you need to add a reference to.
In general, the way to work out what reference you need is to look at the documentation and check the "assembly" part under the namespace. Often you can guess (e.g. if it's in an assembly with the same name as the namespace) but if you ever get stuck, the documentation is the way to go.
I note, however, that this API isn't listed in the more modern .NET documentation. I don't know whether that means it's gone away or been deprecated, but it's at least work being aware of. I can't see a NuGet package providing the functionality either.

Jon Skeet
- 1,421,763
- 867
- 9,128
- 9,194