相关疑难解决方法(0)

装载组件无法正常工作

我尝试在C#中将程序集加载到我的源代码中.所以我首先编译源文件:

 private bool testAssemblies(String sourceName)
        {
            FileInfo sourceFile = new FileInfo(sourceName);
            CodeDomProvider provider = null;
            bool compileOk = false;

            // Select the code provider based on the input file extension.
            if (sourceFile.Extension.ToUpper(CultureInfo.InvariantCulture) == ".CS")
            {
                provider = CodeDomProvider.CreateProvider("CSharp");
            }
            else if (sourceFile.Extension.ToUpper(CultureInfo.InvariantCulture) == ".VB")
            {
                provider = CodeDomProvider.CreateProvider("VisualBasic");
            }
            else
            {
                Console.WriteLine("Source file must have a .cs or .vb extension");
            }

            if (provider != null)
            {

                // Format the executable file name.
                // Build the output assembly path using the …
Run Code Online (Sandbox Code Playgroud)

.net c# assemblies

9
推荐指数
1
解决办法
9961
查看次数

标签 统计

.net ×1

assemblies ×1

c# ×1