Visual Studio etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
Visual Studio etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster

8 Haziran 2011 Çarşamba

Visual Studio Output Panel mesaj yazma

System.Diagnostics.Trace.WriteLine("Second's destructor is called.");

 

using System.Diagnostics;

 

System.Diagnostics.Trace.WriteLine("Second's destructor is called.");

 

TraceSource ts = new TraceSource("HelloWorld", SourceLevels.All);

 

ts.TraceInformation("# of records processed: {0}", n);

ts.TraceEvent(TraceEventType.Information, 10, "# of records processed: {0}", n);

ts = new TraceSource("HelloWorld", SourceLevels.Critical | SourceLevels.ActivityTracing);

 

<system.diagnostics>

  <sources>

    <source name="HelloWorld">

      <listeners>

        <remove name="Default"/>

 

        <add name="consoleListener"

            type="System.Diagnostics.ConsoleTraceListener"/>

 

        <add name="eventlogListener"

            type="System.Diagnostics.EventLogTraceListener"

            initializeData="Application"/>

 

        <add name="textfileListener"

            type="System.Diagnostics.TextWriterTraceListener"

            initializeData="helloworld.log" />

 

        <add name="xmlfileListener"

            type="System.Diagnostics.XmlWriterTraceListener"

            initializeData="helloworld.xml" />

 

        <add name="defaultListener"

            type="System.Diagnostics.DefaultTraceListener"/>

      </listeners>

    </source>

  </sources>

</system.diagnostics>

 

<system.diagnostics>

    <sharedListeners>

        <add name="myListener"

             type="MyTestTraceListener, MyAssembly">

            <filter type="System.Diagnostics.EventTypeFilter"

                    initializeData="Information"/>

        </add>

    </sharedListeners>

    <sources>

        <source name="mySource" switchValue="All">

            <listeners>

                <add name="myListener" />

            </listeners>

        </source>

    </sources>

</system.diagnostics>

 

log.Info( m=>m("some logger info {0}", (object)myObj) )

log.Info( ()=>String.Format("some logger info {0}", (object)myObj) )

 

image

    Critical Error Warning Information Verbose Start Stop Suspend Resume Transfer

27 Mayıs 2011 Cuma

Visual Studio 2010 Exceptions- Hataları düzenlemek

shortcut Ctrl + Alt + E

image

Visual Studio prebuild- postbuild Command

mkdir %SystemDrive%\inetpub\wwwroot\servicemodelsamples
mkdir %SystemDrive%\inetpub\wwwroot\servicemodelsamples\bin
copy "$(TargetDir)service.dll" %SystemDrive%\inetpub\wwwroot\servicemodelsamples\bin
copy "$(ProjectDir)service.svc" %SystemDrive%\inetpub\wwwroot\servicemodelsamples
copy "$(ProjectDir)web.config" %SystemDrive%\inetpub\wwwroot\servicemodelsamples

Macro

Description

$(ConfigurationName)

The name of the current project configuration, for example, "Debug|Any CPU".

$(OutDir)

Path to the output file directory, relative to the project directory. This resolves to the value for the Output Directory property. It includes the trailing backslash '\'.

$(DevEnvDir)

The installation directory of Visual Studio 2010 (defined with drive and path); includes the trailing backslash '\'.

$(PlatformName)

The name of the currently targeted platform. For example, "AnyCPU".

$(ProjectDir)

The directory of the project (defined with drive and path); includes the trailing backslash '\'.

$(ProjectPath)

The absolute path name of the project (defined with drive, path, base name, and file extension).

$(ProjectName)

The base name of the project.

$(ProjectFileName)

The file name of the project (defined with base name and file extension).

$(ProjectExt)

The file extension of the project. It includes the '.' before the file extension.

$(SolutionDir)

The directory of the solution (defined with drive and path); includes the trailing backslash '\'.

$(SolutionPath)

The absolute path name of the solution (defined with drive, path, base name, and file extension).

$(SolutionName)

The base name of the solution.

$(SolutionFileName)

The file name of the solution (defined with base name and file extension).

$(SolutionExt)

The file extension of the solution. It includes the '.' before the file extension.

$(TargetDir)

The directory of the primary output file for the build (defined with drive and path). It includes the trailing backslash '\'.

$(TargetPath)

The absolute path name of the primary output file for the build (defined with drive, path, base name, and file extension).

$(TargetName)

The base name of the primary output file for the build.

$(TargetFileName)

The file name of the primary output file for the build (defined as base name and file extension).

$(TargetExt)

The file extension of the primary output file for the build. It includes the '.' before the file extension.

 

referrer : http://msdn.microsoft.com/en-us/library/42x5kfw4.aspx