cannot find the specified file

228 views
Skip to first unread message

Mike

unread,
May 15, 2012, 7:23:49 PM5/15/12
to CS-Script
Hello,

I'm running ubuntu, and I followed the protocol suggested here:
http://www.csscript.net/help/CS-Script_on_Mono.html

Here's what I get:

$: mono -V
Mono JIT compiler version 2.10.5 (Debian 2.10.5-1)
Copyright (C) 2002-2011 Novell, Inc, Xamarin, Inc and Contributors.
www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: Included Boehm (with typed GC and Parallel Mark)

$: mono ./cscs.exe -v
C# Script execution engine. Version 3.3.0.0.
Copyright (C) 2004-2012 Oleg Shilo. www.csscript.net

CLR: 4.0.30319.1
System: Unix 3.0.0.19
Architecture: x64
Home dir: <not integrated>

$: ./cscs.exe -s > hello.cs
$: cat hello.cs
#!<cscs.exe path> -nl
//css_reference System.Windows.Forms;
using System;
using System.Windows.Forms;

class Script
{
static public void Main(string[] args)
{
for (int i = 0; i < args.Length; i++)
Console.WriteLine(args[i]);

MessageBox.Show("Just a test!");

}
}

$: ./cscs.exe -verbose hello.cs
C# Script execution engine. Version 3.3.0.0.
Copyright (C) 2004-2012 Oleg Shilo.

> ----------------
TragetFramework: v4.0
CurrentDirectory: /home/mike/Documents/python/labs/cscs/cs-script
Executing: /home/mike/Documents/python/labs/cscs/cs-script/hello.cs
Script arguments:
SearchDirectories:
0 - /home/mike/Documents/python/labs/cscs/cs-script
1 - /home/mike/Documents/python/labs/cscs/cs-script/%CSSCRIPT_DIR%/
Lib
2 - /home/mike/Documents/python/labs/cscs/cs-script
3 - /tmp/CSSCRIPT/Cache/385343070
> ----------------

Compiling script...

Precompilers:
0 - csscript.DefaultPrecompiler
/home/mike/Documents/python/labs/cscs/cs-script/cscs.exe

Output file:
/tmp/CSSCRIPT/Cache/385343070/hello.cs.compiled

Files to compile:
0 - /tmp/CSSCRIPT/Cache/385343070/hello.g.cs
1 - /tmp/CSSCRIPT/Cache/385343070/hello.attr.g.cs

References:
0 - System.Windows.Forms
> ----------------
Error: Specified file could not be compiled.

System.SystemException: Error running dmcs: Cannot find the specified
file
at Mono.CSharp.CSharpCodeCompiler.CompileFromFileBatch
(System.CodeDom.Compiler.CompilerParameters options, System.String[]
fileNames) [0x00000] in <filename unknown>:0
at Mono.CSharp.CSharpCodeCompiler.CompileAssemblyFromFileBatch
(System.CodeDom.Compiler.CompilerParameters options, System.String[]
fileNames) [0x00000] in <filename unknown>:0
at csscript.CSExecutor.CompileAssembly (ICodeCompiler compiler,
System.CodeDom.Compiler.CompilerParameters compilerParams,
System.String[] filesToCompile) [0x00000] in <filename unknown>:0
at csscript.CSExecutor.Compile (System.String scriptFileName)
[0x00000] in <filename unknown>:0
at csscript.CSExecutor.ExecuteImpl () [0x00000] in <filename
unknown>:0

Any idea what's going wrong?

Do I have an environment variable set wrong?

I've also made sure that I've updated:
libmono-system-runtime2.0-cil
libmono-winforms2.0-cil

Oleg Shilo

unread,
May 15, 2012, 8:19:40 PM5/15/12
to cs-s...@googlegroups.com
What I found (the hard way) that System.Windows.Forms.dll assembly may not be installed with the minimalistic "CLR-only" package and may need to be deployed with the special package (do not remember the name).

You can diagnose the problem very easy. Change your script to have no reference to  System.Windows.Forms.dll but Console.WriteLine only. If the problem is gone then you will need to install CLR winforms or use Gtk# for your  messageBox.

Cheers,
Oleg Shilo

Mike

unread,
May 15, 2012, 8:43:53 PM5/15/12
to CS-Script
Many thanks for the help!

I think I may of found the problem. Running:

apt-get install mono-complete

seems to get it working.
Reply all
Reply to author
Forward
0 new messages