Problem using UEStudio with VS2012/C#

Problem using UEStudio with VS2012/C#

7
NewbieNewbie
7

    Aug 22, 2012#1

    I'm using UEstudio Version 12.10.0.1005.
    I've installed Microsoft Visual Studio 2012 with C#.
    I'm using Windows 7 x64.
    I have Microsoft .NetFrameworks 2.0 sp2 3.5 SP1 and 4.5 full (I don't have v1.0 or 1.1).

    UEStudio template for .netframework console don't work as it cannot find the compiler csc.exe.
    It seems to only show .Netframework 1.1.4322|1.0.3705

    I want it to be version 4.5. The templates for Visual studio 2010/C# don't work. (I don't have this version installed.)
    How can I add a template for Visual studio 2012 and C# console Application?
    I can see under compilers a visual studio 2010/C# but only C++ templates in the templates folder.

    6,686585
    Grand MasterGrand Master
    6,686585

      Re: How to adapt UEStudio configs/wizards of VS2010 for VS2012?

      Aug 22, 2012#2

      I don't have VS2012 installed, but it should be no problem to adapt VS2010 configurations to VS2012.
      • Open in Windows Explorer or any other File Manager the directory UEStudio Program Files directory\configs\ with administrator privileges.
      • Create in this directory a new directory with name Visual Studio 2012.
      • Copy all subdirectories from directory Visual Studio 2010 to directory Visual Studio 2012.
      • In all the text files in all the subdirectories of directory Visual Studio 2012 you have to change some variables in section [Variables] and some settings in section [Settings]. You may want to do this first only on the C# configuration you next want to use before applying the changes to all other configurations of C# and perhaps other programming languages too.
      • You have to adapt to VS2012 the setting Framework = and setting MSSDK = and perhaps others too.
      • You have to adapt to VS2012 the variables RootDir =, VcDir =, CommonDir =, SDKDir = and MSSDKDir = and perhaps some more.
      I can't tell you the values for those settings and variables, but it should be no problem for you to find them out.

      The following steps are just for completeness.
      • Open in Windows Explorer or any other File Manager the directory UEStudio Program Files directory\projects\ with administrator privileges.
      • Create in this directory a new directory with name Visual Studio 2012.
      • Copy the 4 *.wiz files from directory Visual Studio 2010 to Visual Studio 2012.
      • Open the 4 *.wiz files in directory Visual Studio 2012 and replace the text Visual Studion 2010 by the text Visual Studion 2012 at top of every file.
      • Save all 4 *.wiz files and close them.

      7
      NewbieNewbie
      7

        Aug 22, 2012#3

        Thank you for your reply.
        I'm not entirely confident that I'll be capable of making these adaptions, but thanks anyway.
        I may have to just wait for the company to update to Visual Studio 2012.

          Aug 24, 2012#4

          Can any forum member please explain why C# appears as an option under Microsoft Visual Studio 20xx, under compiler, yet under templates Visual Studio it's absent and only has C++ templates? It's Under Microsoft Dotnet Framework, but so also is C++.

          1

            Oct 16, 2012#5

            The problem is the path in the compiler template. Also - there is an unrecognized switch in the compiler command line called incremental - I just removed that. I then hard-coded the path to CSC.exe and it worked fine.

            With your C# project loaded, go to
            Build >> Select Compiler >>

            It should open the correct project type for you (Class Library, Console Application, or Windows Application)

            This is from my config. I chaged the Framework setting as seen below. I believe the right side of the pipe delimiter is the "compatibility level" - so you can use your VS2012 compiler to create a binary that will work for a lower version of .NET. I just set both sides the same:

            [Settings]

            Target =
            Framework = 4.0.30319|4.0.30319
            Category&01 = DEFAULT RUN CONFIGURATION
            Working Directory =.
            Command Line Arguments =
            Category&02 = COMPILER OPTIONS
            Warning Level = 3|0|1|2|4
            Excluded Files = Excludes
            References = References
            Conditional (Debug) = DEBUG;TRACE
            Conditional (Release) = TRACE
            Unsafe Code = /unsafe-|/unsafe+
            Check Arithmetic = /checked-|/checked+
            Warn As Error = /warnaserror-|/warnaserror+
            Compiler Options =
            Debugger=$(SDKPATH)GuiDebug\DbgCLR.exe


            [Variables]

            CPATH = $(HKEY_LOCAL_MACHINE\SOFTWARE$6432\Microsoft\.NETFramework)v$(Framework)
            WL = /w:$(Warning Level)

            [Environment]

            PATH = C:\Windows\Microsoft.NET\Framework\v4.0.30319;%PATH%

            6,686585
            Grand MasterGrand Master
            6,686585

              How the Framework setting is set and evaluated?

              May 19, 2013#6

              Definition of setting Framework

              For example the file

              %ProgramFiles(x86)%\IDM Computer Solutions\UEStudio\configs\Visual Studio 2010\Visual C# compiler\Windows Application

              opened by clicking on
              • item Project Settings in menu Project, selecting tab Settings, clicking on button Set/Change Compiler, clicking on Visual Studio 2010 (or 2012 when already copied), Visual C# compiler, Windows Application and finally on button Edit Configuration,
                or
              • item Select Compiler in menu Build, clicking on Visual Studio 2010 (or 2012 when already copied), Visual C# compiler, Windows Application and finally on button Edit Configuration
              contains

              [Settings]
              Framework = 4.0.30319|3.5|3.0|1.0.3705|1.1.4322

              The character | is a separator for the possible values for compiler setting Framework.

              After opening Set Compiler Options in menu Build, there is at top by default Framework = 4.0.30319

              Double clicking on this line in the compiler options dialog opens another dialog showing the other values in a list from which one value can be selected.

              Visual Studio 2012 works usually with framework 4.5 and therefore in a configuration file for VS2012 the Framework settings line should be

              Framework = 4.5|4.0.30319|3.5|3.0|1.0.3705|1.1.4322

              So specifying twice the same value as forum member amicidavinci has done with 4.0.30319|4.0.30319 does not make much sense.


              Usage of setting Framework

              Next in the file there is

              [Variables]
              CPATH = $(HKEY_LOCAL_MACHINE\SOFTWARE$6432\Microsoft\.NETFramework\InstallRoot)v$(Framework)

              So a variable compiler path (short: CPATH) is defined taking the default string value from a Windows registry key. The name of the registry key contains here 2 variables:

              $6432 is replaced by either nothing (32-bit Windows) or by \Wow6432Node (64-bit Windows).

              $(Framework) is replaced by the value currently selected in the compiler settings for Framework.

              If you start RegEdit, browse to registry key which is for example

              HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\InstallRootv4.0.30319

              and look on right side, you should see at top the path to the root of the compiler which UEStudio reads on creation of the makefile for the project.

              The setting Framework is not used further and therefore we need to look where variable CPATH is used in the configuration file.


              Usage of variable CPATH

              As we know now, UEStudio reads from a registry key the root path of the compiler according to compiler setting Framework and assigns it to a variable CPATH.

              This variable is used in

              [Environment]
              PATH = $(CPATH);$(MSSDKDir)bin;%PATH%

              It is quite easy to see what is done here. An environment variable named PATH is defined for compile/build process which consists of
              • the root path of the compiler directory
              • the root path of the Microsoft SDK directory
                which is defined with same procedure as the compiler path and therefore not extra explained
              • the existing content of the environment variable PATH on compile/build as defined in the Windows environment settings.
              Of course if you know into which directory the Microsoft .NET Framework is installed and you never want to use another framework version, you can modify the PATH definition and use directly the right path.

              The method of reading the compiler path from Windows registry according to framework version selected by the user of UEStudio is a little bit more complicated, but is also more flexible and should result in a working configuration independent into which directory the .NET framework is installed, the default path as defined by Microsoft or a different path as selected by the user during installation of Visual Studio.