Posted 17 years ago
by John Corbett
-
Software Architect,
SonarData Pty. Ltd.
Hi,
I'm using your C# add-on and going very well. I am writing an "expression evaluator" (actually a code editing window, but with a very limited and tightly controlled API). I am only adding a couple of my own "API" assemblies to compile/link the code against, and also adding these to the DotNetProjectResolver. I am deliberately not adding mscorlib as a reference when I compile, and I'm not adding it to DotNetProjectResolver either. This is because I don't want my end user to be able to access much of the system API (due to confusion and security issues in my situation)
My code compiles fine, and mostly the intellisense works well too. I have one problem though; there are members on the built-in types such as "string" (for instance, "string.Clone()") that I want to appear in Intellisense, that don't. By rights I think they ought to, because even though I don't compile against mscorlib, these methods are available. But I don't see them in Intellisense.
I tried the following but couldn't make it work; maybe you can help me or suggest something else ...
1- I thought that I could add mscorlib as a reference and then use something like DotNetProjectResolver.GetNativeType("System.String") to obtain something along the lines of a CodeDomCompiledUnit ...
2- which I could add into the DotNetProjectResolver along the lines of http://www.actiprosoftware.com/Support/Forums/ViewForumTopic.aspx?ForumTopicID=1789.
3- then unload mscorlib as a reference.
If I get a CodeDomCompiledUnit from the SemanticParser, I can add it to the DotNetProjectResolver. But I can't get the CodeDomCompiledUnit out of the DotNetProjectResolver for System.String. I don't know if it is possible. Can you assist me?
My fallback position is to create some "dummy" source files containing definitions for "System.String" (such as produced by VS, by clicking on "Go to definition" of System.String - constructed by metadata), which is kind of ok but messy. I'd rather get the "already compiled" intellisense out of the DotNetProjectResolver.
Best regards
John
I'm using your C# add-on and going very well. I am writing an "expression evaluator" (actually a code editing window, but with a very limited and tightly controlled API). I am only adding a couple of my own "API" assemblies to compile/link the code against, and also adding these to the DotNetProjectResolver. I am deliberately not adding mscorlib as a reference when I compile, and I'm not adding it to DotNetProjectResolver either. This is because I don't want my end user to be able to access much of the system API (due to confusion and security issues in my situation)
My code compiles fine, and mostly the intellisense works well too. I have one problem though; there are members on the built-in types such as "string" (for instance, "string.Clone()") that I want to appear in Intellisense, that don't. By rights I think they ought to, because even though I don't compile against mscorlib, these methods are available. But I don't see them in Intellisense.
I tried the following but couldn't make it work; maybe you can help me or suggest something else ...
1- I thought that I could add mscorlib as a reference and then use something like DotNetProjectResolver.GetNativeType("System.String") to obtain something along the lines of a CodeDomCompiledUnit ...
2- which I could add into the DotNetProjectResolver along the lines of http://www.actiprosoftware.com/Support/Forums/ViewForumTopic.aspx?ForumTopicID=1789.
3- then unload mscorlib as a reference.
If I get a CodeDomCompiledUnit from the SemanticParser, I can add it to the DotNetProjectResolver. But I can't get the CodeDomCompiledUnit out of the DotNetProjectResolver for System.String. I don't know if it is possible. Can you assist me?
My fallback position is to create some "dummy" source files containing definitions for "System.String" (such as produced by VS, by clicking on "Go to definition" of System.String - constructed by metadata), which is kind of ok but messy. I'd rather get the "already compiled" intellisense out of the DotNetProjectResolver.
Best regards
John