Page tree

Question

Just clicked the gmStudio button “.NET IDE” to open a project in Visual Studio and noticed this error in the log that mentions “log4net”. Is this a gmStudio error?

Selected Visual Studio Version: VS2013
------------------------------------------------------------------
log4net:WARN Unable to set property [securityContext] on object [log4net.Appender.FileAppender] using value [log4net.Util.NullSecurityContext.Instance] (with acceptable conversion types)

Answer

gmStudio has a batch file call SetEnv.cmd that sets the VS environment by finding and running a batch file called vsvars32.bat.  vsvars32.bat is part of the VS distributions and is version specific.  

I think the error is coming from vsvars32.bat. You may edit SetEnv.cmd, if you want.  We pass in the DevEnv string, e.g., VS2013.
See listing below

 

SetEnv.cmd
----------------------- 
@echo off

:: default to VS2010 if not specified.

if [%1]==[] set vssetup="%VS100COMNTOOLS%vsvars32.bat"

if [%1]==[VS2003] set vssetup="%VS71COMNTOOLS%vsvars32.bat"
if [%1]==[VS2005] set vssetup="%VS80COMNTOOLS%vsvars32.bat"
if [%1]==[VS2008] set vssetup="%VS90COMNTOOLS%vsvars32.bat"
if [%1]==[VS2010] set vssetup="%VS100COMNTOOLS%vsvars32.bat"
if [%1]==[VS2012] set vssetup="%VS110COMNTOOLS%vsvars32.bat"
if [%1]==[VS2013] set vssetup="%VS120COMNTOOLS%vsvars32.bat"
if [%1]==[VS2015] set vssetup="%VS140COMNTOOLS%vsvars32.bat"

:: If you do not have VisualStudio installed, and only the SDK, you will
:: need to use something like the following command depending on the target
:: framework SDK installation.
:: if [%1]==[VS2008] set vssetup="C:\Program Files\Microsoft.NET\SDK\v2.0\Bin\sdkvars.bat"


echo Selected Visual Studio Version: %1

if exist %vssetup% goto callvs

:: If Visual Studio was not detected we should scan for one that exists so we can build

echo WARNING: Selected Visual Studio Not Found, scanning for one installed

set vssetup="%VS140COMNTOOLS%vsvars32.bat"
set foundVS=VS2015
if exist %vssetup% goto callOtherVS

set vssetup="%VS120COMNTOOLS%vsvars32.bat"
set foundVS=VS2013
if exist %vssetup% goto callOtherVS

set vssetup="%VS110COMNTOOLS%vsvars32.bat"
set foundVS=VS2012
if exist %vssetup% goto callOtherVS

set vssetup="%VS100COMNTOOLS%vsvars32.bat"
set foundVS=VS2010
if exist %vssetup% goto callOtherVS

set vssetup="%VS90COMNTOOLS%vsvars32.bat"
set foundVS=VS2008
if exist %vssetup% goto callOtherVS

set vssetup="%VS80COMNTOOLS%vsvars32.bat"
set foundVS=VS2005
if exist %vssetup% goto callOtherVS

set vssetup="%VS71COMNTOOLS%vsvars32.bat"
set foundVS=VS2003

if not exist %vssetup% goto err
:callOtherVS

echo Found Version %foundVS%
:callvs
echo ------------------------------------------------------------------

CALL %vssetup%
goto end

:err
echo %vssetup% NOT FOUND
echo Unable to setup .NET Framework SDK command line tools.
echo See %0.
exit /b 1

:end

  • No labels