Skip to content

Commit 34cbfed

Browse files
authored
Create README.md
1 parent c42f9c6 commit 34cbfed

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Diff for: README.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# NetEncryptorWithRoslyn
2+
Example to demonstrate the problem of hosting class not visible
3+
4+
When using C# scripting with a host class together with NetEncryptor,
5+
the program will terminate with an error pointing out that the methods and members
6+
in the host class are not existing in the current context.
7+
8+
In the case of this example, the host class has a public function Square(), the calling of which in a script produces the following error:
9+
10+
error CS7012: The name 'Square' does not exist in the current context (are you missing a reference to assembly 'TestScriptingApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=94fdfcf678734431'?)"
11+
12+
The use of a host class with Scripting is explained here:
13+
14+
https://blogs.msdn.microsoft.com/cdndevs/2015/12/01/adding-c-scripting-to-your-development-arsenal-part-1/
15+
16+
The example is this repository is based on the Bootstrap sample project from Infralution and the scripting test app is based on the code from the blog above.
17+
18+
Set the TestScriptingApp project as startup project and build and run, this should produce the answer 16 in the console if Scripting is working.
19+
20+
Then set the Bootstrap project as startup project and the error message will appear.

0 commit comments

Comments
 (0)