N
N. P.
I do not have Visual Basic .NET Standard or higher but I have downloaded the
..NET SDK and the 101 VB.NET samples from the MSDN website. I am sure that
there must be a way to compile and successfully run these 101 samples from
the command-line but even though I tried hard there are problems with the
resources .resx files.
Eg. I tried using the following command to compile one of the 101 samples:
vbc *.vb /res:frmMain.resx,frmMain.resources
/res:frmAbout.resx,frmAbout.resources /r:System.dll /r:System.Drawing.dll
/r:System.Windows.Forms /imports:System /imports:System.Windows.Forms
/imports:Microsoft.VisualBasic /main:frmMain /out:myapp.exe
When I run myapp.exe it throws an exception and says that:
Unhandled Exception: System.ArgumentException: Stream is not a valid
resource fi
le.
at System.Resources.ResourceReader.ReadResources()
at System.Resources.ResourceReader..ctor(Stream stream, Hashtable table)
at System.Resources.RuntimeResourceSet..ctor(Stream stream)
at System.Resources.ResourceManager.CreateResourceSet(Stream store)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo
cultur
e, Boolean createIfNotExists, Boolean tryParents)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo
cultur
e, Boolean createIfNotExists, Boolean tryParents)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo
cultur
e, Boolean createIfNotExists, Boolean tryParents)
at System.Resources.ResourceManager.GetObject(String name, CultureInfo
cultur
e)
at System.Resources.ResourceManager.GetObject(String name)
at frmMain.InitializeComponent()
at frmMain..ctor()
at frmMain.Main()
There must be a problem with the way that resources files .resx are
interpreted by the application. What am I doing wrong?
Thanks,
N. P.
..NET SDK and the 101 VB.NET samples from the MSDN website. I am sure that
there must be a way to compile and successfully run these 101 samples from
the command-line but even though I tried hard there are problems with the
resources .resx files.
Eg. I tried using the following command to compile one of the 101 samples:
vbc *.vb /res:frmMain.resx,frmMain.resources
/res:frmAbout.resx,frmAbout.resources /r:System.dll /r:System.Drawing.dll
/r:System.Windows.Forms /imports:System /imports:System.Windows.Forms
/imports:Microsoft.VisualBasic /main:frmMain /out:myapp.exe
When I run myapp.exe it throws an exception and says that:
Unhandled Exception: System.ArgumentException: Stream is not a valid
resource fi
le.
at System.Resources.ResourceReader.ReadResources()
at System.Resources.ResourceReader..ctor(Stream stream, Hashtable table)
at System.Resources.RuntimeResourceSet..ctor(Stream stream)
at System.Resources.ResourceManager.CreateResourceSet(Stream store)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo
cultur
e, Boolean createIfNotExists, Boolean tryParents)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo
cultur
e, Boolean createIfNotExists, Boolean tryParents)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo
cultur
e, Boolean createIfNotExists, Boolean tryParents)
at System.Resources.ResourceManager.GetObject(String name, CultureInfo
cultur
e)
at System.Resources.ResourceManager.GetObject(String name)
at frmMain.InitializeComponent()
at frmMain..ctor()
at frmMain.Main()
There must be a problem with the way that resources files .resx are
interpreted by the application. What am I doing wrong?
Thanks,
N. P.