Compiler erro CS0006 during a dynamic compilation

  • Thread starter Thread starter Giulio Petrucci
  • Start date Start date
G

Giulio Petrucci

Good morning everybody,

I have been dealing with this strange issue for almost two days: I got
stuck and I can't get out of it. I built up for the first time in my life
(I'm quite new in stuff like .NET, C#, Visual Studio, windows programming
and so on...) a Windows Service. Debugging it in Visual Studio (Express
Edition) everything worked fine, but debugging it "live" I found a strange
behaviour. My application must dynamically compile some C# code generated
at run-tim. In order to perform this compilation I use an object called
"compiler" implementing an ICodeCompiler interface. Compiling the code, I
have a CS0006 compiler error, with this error message:

Metadata file 'dll_name' could not be found

I imported the missinng library in the VisualStudio project, I added it in
the CompilerParameters.ReferencedAssemblies collection and I set the
statement "using MyLibrary;" in the source code to be compiled. What am I
missing more?

Another question (something like a "best practice") about using
VisualStudio: which's the better way to add assembly references? Importing
the other projects in the solution and then add them from the "Projects"
tab, or adding them via the "Browse" one?

Thanks in advance.

--

Kind regards,
Giulio - Italia

p.s. sorry for my "bovine" english...
 
Hi

We see the CS0006 problem quite a bit but are using .Net 1.1. We are able to
resolve this problem by removing the <identity impersonate="true" />
line from Web.config (note that the problem doesn't seem to occur if the
<identity> line includes username and password attributes). Not sure if this
will help you in the Express edition though.


Hope this helps
Andy
 
Back
Top