Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

CodeDom compile error 'Forms' is not a member of 'Windows' in Windows 8.1

$
0
0

I am using CodeDom to create InMemory exe. This works great for Windows 8 and below. The compiled code works in Windows 8.1 if I remove the Forms Declaration, but i dont want to do that. Any ideas? Windows 7 - All works, Windows 8 - All works, Windows 8.1 - Works without declaring forms.

Also, if I invoke a function with a messagebox, it does work in the InMemory exe in Windows 8.1. So why does that work and declaring a Form does not work?

Referenced Framework:

provOptions.Add("CompilerVersion", "v4.0")

CodeDom referenced assemblies:

vbParams.ReferencedAssemblies.Add("mscorlib.dll") vbParams.ReferencedAssemblies.Add("System.dll") vbParams.ReferencedAssemblies.Add("System.Windows.Forms.dll") vbParams.ReferencedAssemblies.Add("Microsoft.VisualBasic.dll") vbParams.ReferencedAssemblies.Add("System.Data.dll") vbParams.ReferencedAssemblies.Add("System.Xml.dll") vbParams.ReferencedAssemblies.Add("System.Data.Linq.dll") vbParams.ReferencedAssemblies.Add("System.Core.dll") vbParams.ReferencedAssemblies.Add("System.Drawing.dll") vbParams.ReferencedAssemblies.Add("System.Data.DataSetExtensions.dll")

The complied code (partial):

        Imports System
        Imports System.Data
        Imports System.Windows.Forms
        Imports System.Math
        Imports Microsoft.VisualBasic
        Imports System.Collections.Generic
        Imports System.Data.DataRow
        Imports System.Linq
        Imports System.Drawing
        Imports System.Xml
        Imports System.Collections

        Namespace Evaluator

            Public Module GlobalVariables

                Public DialogBox As System.Windows.Forms.Form **(this crashes in windows 8.1)**

            End Module

            more code...

            Public Class Evaluator

                'Invoking this function will show the message
                'box which is part of the Forms namespace

                Public Function TestFunction() As Object
                    MessageBox.Show("Lorem ipsum dolor sit amet.")
                End Function

            End Class

        End Namespace





Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>