After setting all the dependencies for a CF assembly, I can see in the
Lutz Roeder's Reflector that, my assembly depends on both the CF
mscorlib.dll and the non-CF mscorlib.dll.
I run a small test (source at the end of this post) with a single class
source and, once more, the resulting assembly depends on the non-CF
mscorlib.dll.
Is the CodeDom wrongly assuming that all assemblies will depend on the
non-CF mscorlib.dll? Am I doing something wrong?
Thanks,
Antao
____________________________
Antao Almada
http://www.ydreams.com/
CSharpCodeProvider compiler = new CSharpCodeProvider();
ICodeCompiler codeCompiler = compiler.CreateCompiler();
string code = @"
using System;
namespace Test
{
public class Class1
{
public Class1()
{
}
}
}
";
CompilerParameters compilerParams = new CompilerParameters();
compilerParams.CompilerOptions += " /filealign:4096"; // for better PE
file aligment
// find the location of System.dll for the Compact Framework
RegistryKey registryKey = Registry.LocalMachine;
registryKey =
registryKey.OpenSubKey(@"SOFTWARE\Microsoft\.NETCompactFramework\");
string systemLocation = (string)registryKey.GetValue("sdkInstallRoot");
systemLocation = Path.Combine(systemLocation, @"v1.0.5000\Windows
CE\System.dll");
compilerParams.ReferencedAssemblies.Add(systemLocation);
compilerParams.OutputAssembly = "Test.dll";
compilerParams.GenerateInMemory = false;
compilerParams.GenerateExecutable = false; // generate a DLL
compilerParams.IncludeDebugInformation = true;
CompilerResults results =
codeCompiler.CompileAssemblyFromSource(compilerParams, code);
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
--
Alex Feinman
---
Visit http://www.opennetcf.org
"Antao Almada" <anon...@devdex.com> wrote in message
news:eDe2gHoa...@TK2MSFTNGP10.phx.gbl...
Thanks a lot,
Antao
____________________________
Antao Almada
http://www.ydreams.com/
*** Sent via Developersdex http://www.developersdex.com ***