diff --git a/docs/framework/app-domains/how-to-remove-an-assembly-from-the-gac.md b/docs/framework/app-domains/how-to-remove-an-assembly-from-the-gac.md index 0acec88cc70c3..80a24325bb0ec 100644 --- a/docs/framework/app-domains/how-to-remove-an-assembly-from-the-gac.md +++ b/docs/framework/app-domains/how-to-remove-an-assembly-from-the-gac.md @@ -27,7 +27,7 @@ There are two ways to remove an assembly from the global assembly cache (GAC): At the command prompt, type the following command: -**gacutil –u** \<*assembly name*> +**gacutil -u** \<*assembly name*> In this command, *assembly name* is the name of the assembly to remove from the global assembly cache. diff --git a/docs/framework/configure-apps/index.md b/docs/framework/configure-apps/index.md index 319aef51062af..635d54ed5cb6a 100644 --- a/docs/framework/configure-apps/index.md +++ b/docs/framework/configure-apps/index.md @@ -67,7 +67,7 @@ This article describes the syntax of configuration files and provides informatio The name and location of the application configuration file depend on the app's host, which can be one of the following: -- Executable–hosted app. +- Executable-hosted app. These apps have two configuration files: a source configuration file, which is modified by the developer during development, and an output file that's distributed with the app. diff --git a/docs/framework/data/adonet/ef/language-reference/literals-entity-sql.md b/docs/framework/data/adonet/ef/language-reference/literals-entity-sql.md index 5b71bdad17250..65942ebdb5a4e 100644 --- a/docs/framework/data/adonet/ef/language-reference/literals-entity-sql.md +++ b/docs/framework/data/adonet/ef/language-reference/literals-entity-sql.md @@ -94,7 +94,7 @@ DATETIMEOFFSET'2006-12-25 01:01:00.0000000 -08:30' Binary'00ffaabb' X'ABCabc' BINARY '0f0f0f0F0F0F0F0F0F0F' -X'' –- empty binary string +X'' -- empty binary string ``` ## Guid diff --git a/docs/framework/data/adonet/sql/linq/system-datetime-methods.md b/docs/framework/data/adonet/sql/linq/system-datetime-methods.md index 8455d7718642b..cc82e190ec5d2 100644 --- a/docs/framework/data/adonet/sql/linq/system-datetime-methods.md +++ b/docs/framework/data/adonet/sql/linq/system-datetime-methods.md @@ -6,29 +6,29 @@ ms.assetid: 4f80700c-e83f-4ab6-af0f-1c9a606e1133 --- # System.DateTime Methods -The following LINQ to SQL-supported methods, operators, and properties are available to use in LINQ to SQL queries. When a method, operator or property is unsupported, LINQ to SQL cannot translate the member for execution on the SQL Server. You may use these members in your code, however, they must be evaluated before the query is translated to Transact-SQL or after the results have been retrieved from the database. - -## Supported System.DateTime Members - - Once mapped in the object model or external mapping file, LINQ to SQL allows you to call the following members inside LINQ to SQL queries. - -|Supported Methods|Supported Operators|Supported Properties| -|-|-|-| -|||| -|||| -|||| -|||| -|||| -|||| -|||| -|||| -|||| -|||| -|||| -|||| -|||| - -## Members Not Supported by LINQ to SQL +The following LINQ to SQL-supported methods, operators, and properties are available to use in LINQ to SQL queries. When a method, operator or property is unsupported, LINQ to SQL cannot translate the member for execution on the SQL Server. You may use these members in your code, however, they must be evaluated before the query is translated to Transact-SQL or after the results have been retrieved from the database. + +## Supported System.DateTime Members + + Once mapped in the object model or external mapping file, LINQ to SQL allows you to call the following members inside LINQ to SQL queries. + +|Supported Methods|Supported Operators|Supported Properties| +|-|-|-| +|||| +|||| +|||| +|||| +|||| +|||| +|||| +|||| +|||| +|||| +|||| +|||| +|||| + +## Members Not Supported by LINQ to SQL The following members are not supported inside LINQ to SQL queries: @@ -50,18 +50,18 @@ The following LINQ to SQL-supported methods, operators, and properties are avail - - - - -## Method Translation Example - - All methods supported by LINQ to SQL are translated to Transact-SQL before they are sent to SQL Server. For example, consider the following pattern. - - `(dateTime1 – dateTime2).{Days, Hours, Milliseconds, Minutes, Months, Seconds, Years}` - - When it is recognized, it is translated into a direct call to the SQL Server `DATEDIFF` function, as follows: - - `DATEDIFF({DatePart}, @dateTime1, @dateTime2)` - -## SQLMethods Date and Time Methods + +## Method Translation Example + + All methods supported by LINQ to SQL are translated to Transact-SQL before they are sent to SQL Server. For example, consider the following pattern. + + `(dateTime1 - dateTime2).{Days, Hours, Milliseconds, Minutes, Months, Seconds, Years}` + + When it is recognized, it is translated into a direct call to the SQL Server `DATEDIFF` function, as follows: + + `DATEDIFF({DatePart}, @dateTime1, @dateTime2)` + +## SQLMethods Date and Time Methods In addition to the methods offered by the structure, LINQ to SQL offers the following methods from the class for working with date and time: @@ -74,7 +74,7 @@ The following LINQ to SQL-supported methods, operators, and properties are avail - - - - + ## See also - [Query Concepts](query-concepts.md) diff --git a/docs/framework/interop/com-interop-sample-com-client-and-net-server.md b/docs/framework/interop/com-interop-sample-com-client-and-net-server.md index 9f95163695e7d..f1a497f7fd3f9 100644 --- a/docs/framework/interop/com-interop-sample-com-client-and-net-server.md +++ b/docs/framework/interop/com-interop-sample-com-client-and-net-server.md @@ -2,389 +2,389 @@ title: "COM Interop Sample: COM Client and .NET Server" description: Read a code sample that shows the interoperation of a COM client and a .NET server that performs mortgage calculations. ms.date: "03/30/2017" -dev_langs: +dev_langs: - "csharp" - "vb" -helpviewer_keywords: +helpviewer_keywords: - "interoperation with unmanaged code, samples" - "COM interop, samples" ms.assetid: a219cb2c-9fa2-4c90-9b26-939e0788f178 --- # COM Interop Sample: COM Client and .NET Server -This sample demonstrates the interoperation of a [COM Client](#cpconcominteropsamplecomclientnetserveranchor1) and a [.NET Server](#cpconcominteropsamplecomclientnetserveranchor2) that performs mortgage calculations. In this example, the client creates and calls an instance of the managed `Loan` class, passes four arguments (one of those four being equal to zero) to the instance, and displays the computations. Code examples from this sample appear throughout this section. - +This sample demonstrates the interoperation of a [COM Client](#cpconcominteropsamplecomclientnetserveranchor1) and a [.NET Server](#cpconcominteropsamplecomclientnetserveranchor2) that performs mortgage calculations. In this example, the client creates and calls an instance of the managed `Loan` class, passes four arguments (one of those four being equal to zero) to the instance, and displays the computations. Code examples from this sample appear throughout this section. + -## COM Client - -```cpp -// ConLoan.cpp : Defines the entry point for the console application. -#include "stdafx.h" -#import "..\LoanLib\LoanLib.tlb" raw_interfaces_only -using namespace LoanLib; - -int main(int argc, char* argv[]) -{ - HRESULT hr = CoInitialize(NULL); - - ILoanPtr pILoan(__uuidof(Loan)); - +## COM Client + +```cpp +// ConLoan.cpp : Defines the entry point for the console application. +#include "stdafx.h" +#import "..\LoanLib\LoanLib.tlb" raw_interfaces_only +using namespace LoanLib; + +int main(int argc, char* argv[]) +{ + HRESULT hr = CoInitialize(NULL); + + ILoanPtr pILoan(__uuidof(Loan)); + if (argc < 5) - { - printf("Usage: ConLoan Balance Rate Term Payment\n"); - printf(" Either Balance, Rate, Term, or Payment must be 0\n"); - return -1; - } - - double openingBalance = atof(argv[1]); - double rate = atof(argv[2])/100.0; - short term = atoi(argv[3]); - double payment = atof(argv[4]); - - pILoan->put_OpeningBalance(openingBalance); - pILoan->put_Rate(rate); - pILoan->put_Term(term); - pILoan->put_Payment(payment); - + { + printf("Usage: ConLoan Balance Rate Term Payment\n"); + printf(" Either Balance, Rate, Term, or Payment must be 0\n"); + return -1; + } + + double openingBalance = atof(argv[1]); + double rate = atof(argv[2])/100.0; + short term = atoi(argv[3]); + double payment = atof(argv[4]); + + pILoan->put_OpeningBalance(openingBalance); + pILoan->put_Rate(rate); + pILoan->put_Term(term); + pILoan->put_Payment(payment); + if (openingBalance == 0.00) - pILoan->ComputeOpeningBalance(&openingBalance); - if (rate == 0.00) pILoan->ComputeRate(&rate); - if (term == 0) pILoan->ComputeTerm(&term); - if (payment == 0.00) pILoan->ComputePayment(&payment); - - printf("Balance = %.2f\n", openingBalance); - printf("Rate = %.1f%%\n", rate*100); - printf("Term = %.2i\n", term); - printf("Payment = %.2f\n", payment); - - VARIANT_BOOL MorePmts; - double Balance = 0.0; - double Principal = 0.0; - double Interest = 0.0; - - printf("%4s%10s%12s%10s%12s\n", "Nbr", "Payment", "Principal", "Interest", "Balance"); + pILoan->ComputeOpeningBalance(&openingBalance); + if (rate == 0.00) pILoan->ComputeRate(&rate); + if (term == 0) pILoan->ComputeTerm(&term); + if (payment == 0.00) pILoan->ComputePayment(&payment); + + printf("Balance = %.2f\n", openingBalance); + printf("Rate = %.1f%%\n", rate*100); + printf("Term = %.2i\n", term); + printf("Payment = %.2f\n", payment); + + VARIANT_BOOL MorePmts; + double Balance = 0.0; + double Principal = 0.0; + double Interest = 0.0; + + printf("%4s%10s%12s%10s%12s\n", "Nbr", "Payment", "Principal", "Interest", "Balance"); printf("%4s%10s%12s%10s%12s\n", "---", "-------", "---------", -"--------", "-------"); - - pILoan->GetFirstPmtDistribution(payment, &Balance, &Principal, &Interest, &MorePmts); - +"--------", "-------"); + + pILoan->GetFirstPmtDistribution(payment, &Balance, &Principal, &Interest, &MorePmts); + for (short PmtNbr = 1; MorePmts; PmtNbr++) - { - printf("%4i%10.2f%12.2f%10.2f%12.2f\n", - PmtNbr, payment, Principal, Interest, Balance); - + { + printf("%4i%10.2f%12.2f%10.2f%12.2f\n", + PmtNbr, payment, Principal, Interest, Balance); + pILoan->GetNextPmtDistribution(payment, &Balance, &Principal, &Interest, &MorePmts); - } - - CoUninitialize(); - return 0; -} -``` - + } + + CoUninitialize(); + return 0; +} +``` + -## .NET Server - -```vb -Imports System -Imports System.Reflection - - +## .NET Server + +```vb +Imports System +Imports System.Reflection + + Namespace LoanLib - + Public Interface ILoan - Property OpeningBalance() As Double + Property OpeningBalance() As Double Property Rate() As Double Property Payment() As Double Property Term() As Short - Property RiskRating() As String - Function ComputePayment() As Double - Function ComputeOpeningBalance() As Double - Function ComputeRate() As Double - Function ComputeTerm() As Short - Function GetFirstPmtDistribution(PmtAmt As Double, _ - ByRef Balance As Double, ByRef PrinPortion As Double, _ - ByRef IntPortion As Double) As Boolean - Function GetNextPmtDistribution(PmtAmt As Double, _ - ByRef Balance As Double, ByRef PrinPortion As Double, _ - ByRef IntPortion As Double) As Boolean + Property RiskRating() As String + Function ComputePayment() As Double + Function ComputeOpeningBalance() As Double + Function ComputeRate() As Double + Function ComputeTerm() As Short + Function GetFirstPmtDistribution(PmtAmt As Double, _ + ByRef Balance As Double, ByRef PrinPortion As Double, _ + ByRef IntPortion As Double) As Boolean + Function GetNextPmtDistribution(PmtAmt As Double, _ + ByRef Balance As Double, ByRef PrinPortion As Double, _ + ByRef IntPortion As Double) As Boolean End Interface - - Public Class Loan - Implements ILoan - Private m_openingBalance As Double - Private m_rate As Double - Private m_payment As Double - Private m_term As Short + + Public Class Loan + Implements ILoan + Private m_openingBalance As Double + Private m_rate As Double + Private m_payment As Double + Private m_term As Short Private m_riskRating As String - - Public Property OpeningBalance() As Double _ - Implements ILoan.OpeningBalance - - Get - Return m_openingBalance - End Get - Set - m_openingBalance = value - End Set + + Public Property OpeningBalance() As Double _ + Implements ILoan.OpeningBalance + + Get + Return m_openingBalance + End Get + Set + m_openingBalance = value + End Set + End Property + + Public Property Rate() As Double _ + Implements ILoan.Rate + + Get + Return m_rate + End Get + Set + m_rate = value + End Set End Property - - Public Property Rate() As Double _ - Implements ILoan.Rate - - Get - Return m_rate - End Get - Set - m_rate = value - End Set + + Public Property Payment() As Double _ + Implements ILoan.Payment + + Get + Return m_payment + End Get + Set + m_payment = value + End Set End Property - - Public Property Payment() As Double _ - Implements ILoan.Payment - - Get - Return m_payment - End Get - Set - m_payment = value - End Set + + Public Property Term() As Short _ + Implements ILoan.Term + + Get + Return m_term + End Get + Set + m_term = value + End Set End Property - - Public Property Term() As Short _ - Implements ILoan.Term - - Get - Return m_term - End Get - Set - m_term = value - End Set + + Public Property RiskRating() As String _ + Implements ILoan.RiskRating + + Get + Return m_riskRating + End Get + Set + m_riskRating = value + End Set End Property - - Public Property RiskRating() As String _ - Implements ILoan.RiskRating - - Get - Return m_riskRating - End Get - Set - m_riskRating = value - End Set - End Property - - Public Function ComputePayment() As Double _ - Implements ILoan.ComputePayment - - Payment = Util.Round(OpeningBalance *(Rate / _ - (1 - Math.Pow(1 + Rate, - Term))), 2) - Return Payment + + Public Function ComputePayment() As Double _ + Implements ILoan.ComputePayment + + Payment = Util.Round(OpeningBalance *(Rate / _ + (1 - Math.Pow(1 + Rate, - Term))), 2) + Return Payment End Function - - Public Function ComputeOpeningBalance() As Double _ - Implements ILoan.ComputeOpeningBalance - - OpeningBalance = Util.Round(Payment /(Rate / _ - (1 - Math.Pow(1 + Rate, - Term))), 2) - Return OpeningBalance + + Public Function ComputeOpeningBalance() As Double _ + Implements ILoan.ComputeOpeningBalance + + OpeningBalance = Util.Round(Payment /(Rate / _ + (1 - Math.Pow(1 + Rate, - Term))), 2) + Return OpeningBalance End Function - - Public Function ComputeRate() As Double _ - Implements ILoan.ComputeRate - - Dim DesiredPayment As Double = Payment - - For m_rate = 0.001 To 28.0 - 0.001 Step 0.001 - Payment = Util.Round(OpeningBalance *(Rate / _ - (1 - Math.Pow(1 + Rate, - Term))), 2) - - If Payment >= DesiredPayment Then - Exit For - End If - Next - Return Rate + + Public Function ComputeRate() As Double _ + Implements ILoan.ComputeRate + + Dim DesiredPayment As Double = Payment + + For m_rate = 0.001 To 28.0 - 0.001 Step 0.001 + Payment = Util.Round(OpeningBalance *(Rate / _ + (1 - Math.Pow(1 + Rate, - Term))), 2) + + If Payment >= DesiredPayment Then + Exit For + End If + Next + Return Rate End Function - - Public Function ComputeTerm() As Short _ - Implements ILoan.ComputeTerm - - Dim DesiredPayment As Double = Payment - - For m_term = 1 To 479 - Payment = Util.Round(OpeningBalance *(Rate / _ - (1 - Math.Pow(1 + Rate, - Term))), 2) - - If Payment <= DesiredPayment Then - Exit For - End If - Next - Return Term + + Public Function ComputeTerm() As Short _ + Implements ILoan.ComputeTerm + + Dim DesiredPayment As Double = Payment + + For m_term = 1 To 479 + Payment = Util.Round(OpeningBalance *(Rate / _ + (1 - Math.Pow(1 + Rate, - Term))), 2) + + If Payment <= DesiredPayment Then + Exit For + End If + Next + Return Term End Function - - Public Function GetFirstPmtDistribution(PmtAmt As Double, _ - ByRef Balance As Double, ByRef PrinPortion As Double, _ - ByRef IntPortion As Double) As Boolean _ - Implements ILoan.GetFirstPmtDistribution - - Balance = OpeningBalance - Return GetNextPmtDistribution(PmtAmt, Balance, PrinPortion, _ - IntPortion) + + Public Function GetFirstPmtDistribution(PmtAmt As Double, _ + ByRef Balance As Double, ByRef PrinPortion As Double, _ + ByRef IntPortion As Double) As Boolean _ + Implements ILoan.GetFirstPmtDistribution + + Balance = OpeningBalance + Return GetNextPmtDistribution(PmtAmt, Balance, PrinPortion, _ + IntPortion) End Function - - Public Function GetNextPmtDistribution(PmtAmt As Double, _ - ByRef Balance As Double, ByRef PrinPortion As Double, _ - ByRef IntPortion As Double) As Boolean _ - Implements ILoan.GetNextPmtDistribution - - IntPortion = Util.Round(Balance * Rate, 2) - PrinPortion = Util.Round(PmtAmt - IntPortion, 2) - Balance = Util.Round(Balance - PrinPortion, 2) - - If Balance <= 0.0 Then - Return False + + Public Function GetNextPmtDistribution(PmtAmt As Double, _ + ByRef Balance As Double, ByRef PrinPortion As Double, _ + ByRef IntPortion As Double) As Boolean _ + Implements ILoan.GetNextPmtDistribution + + IntPortion = Util.Round(Balance * Rate, 2) + PrinPortion = Util.Round(PmtAmt - IntPortion, 2) + Balance = Util.Round(Balance - PrinPortion, 2) + + If Balance <= 0.0 Then + Return False End If - Return True - End Function + Return True + End Function + End Class + + Friend Class Util + + Public Shared Function Round(value As Double, digits As Short) _ + As Double + Dim factor As Double = Math.Pow(10, digits) + Return Math.Round((value * factor)) / factor + End Function + End Class - - Friend Class Util - - Public Shared Function Round(value As Double, digits As Short) _ - As Double - Dim factor As Double = Math.Pow(10, digits) - Return Math.Round((value * factor)) / factor - End Function - - End Class - -End Namespace -``` - -```csharp -using System; -using System.Reflection; - -[assembly:AssemblyKeyFile("sample.snk")] -namespace LoanLib { - - public interface ILoan { - double OpeningBalance{get; set;} - double Rate{get; set;} + +End Namespace +``` + +```csharp +using System; +using System.Reflection; + +[assembly:AssemblyKeyFile("sample.snk")] +namespace LoanLib { + + public interface ILoan { + double OpeningBalance{get; set;} + double Rate{get; set;} double Payment{get; set;} - short Term{get; set;} - String RiskRating{get; set;} - - double ComputePayment(); - double ComputeOpeningBalance(); - double ComputeRate(); - short ComputeTerm(); - bool GetFirstPmtDistribution(double PmtAmt, ref double Balance, - out double PrinPortion, out double IntPortion); - bool GetNextPmtDistribution(double PmtAmt, ref double Balance, - out double PrinPortion, out double IntPortion); - } - - public class Loan : ILoan { - private double openingBalance; - private double rate; - private double payment; - private short term; + short Term{get; set;} + String RiskRating{get; set;} + + double ComputePayment(); + double ComputeOpeningBalance(); + double ComputeRate(); + short ComputeTerm(); + bool GetFirstPmtDistribution(double PmtAmt, ref double Balance, + out double PrinPortion, out double IntPortion); + bool GetNextPmtDistribution(double PmtAmt, ref double Balance, + out double PrinPortion, out double IntPortion); + } + + public class Loan : ILoan { + private double openingBalance; + private double rate; + private double payment; + private short term; private String riskRating; - - public double OpeningBalance { - get { return openingBalance; } - set { openingBalance = value; } - } - - public double Rate { - get { return rate; } - set { rate = value; } - } - - public double Payment { - get { return payment; } - set { payment = value; } - } - - public short Term { - get { return term; } - set { term = value; } - } - - public String RiskRating { - get { return riskRating; } - set { riskRating = value; } - } - - public double ComputePayment() { - Payment = Util.Round(OpeningBalance * (Rate / (1 – - Math.Pow((1 + Rate), -Term))), 2); - return Payment; - } - - public double ComputeOpeningBalance() { + + public double OpeningBalance { + get { return openingBalance; } + set { openingBalance = value; } + } + + public double Rate { + get { return rate; } + set { rate = value; } + } + + public double Payment { + get { return payment; } + set { payment = value; } + } + + public short Term { + get { return term; } + set { term = value; } + } + + public String RiskRating { + get { return riskRating; } + set { riskRating = value; } + } + + public double ComputePayment() { + Payment = Util.Round(OpeningBalance * (Rate / (1 - + Math.Pow((1 + Rate), -Term))), 2); + return Payment; + } + + public double ComputeOpeningBalance() { OpeningBalance = Util.Round(Payment / (Rate / (1 - Math.Pow((1 - + Rate), -Term))), 2); - return OpeningBalance; - } - - public double ComputeRate() { - double DesiredPayment = Payment; - - for (Rate = 0.001; Rate < 28.0; Rate += 0.001) { - Payment = Util.Round(OpeningBalance * (Rate / (1 – - Math.Pow((1 + Rate), -Term))), 2); - - if (Payment >= DesiredPayment) - break; - } + + Rate), -Term))), 2); + return OpeningBalance; + } + + public double ComputeRate() { + double DesiredPayment = Payment; + + for (Rate = 0.001; Rate < 28.0; Rate += 0.001) { + Payment = Util.Round(OpeningBalance * (Rate / (1 - + Math.Pow((1 + Rate), -Term))), 2); + + if (Payment >= DesiredPayment) + break; + } return Rate; - } - - public short ComputeTerm() { - double DesiredPayment = Payment; - - for (Term = 1; Term < 480 ; Term ++) { - Payment = Util.Round(OpeningBalance * (Rate / (1 – - Math.Pow((1 + Rate), -Term))),2); - - if (Payment <= DesiredPayment) - break; - } - + } + + public short ComputeTerm() { + double DesiredPayment = Payment; + + for (Term = 1; Term < 480 ; Term ++) { + Payment = Util.Round(OpeningBalance * (Rate / (1 - + Math.Pow((1 + Rate), -Term))),2); + + if (Payment <= DesiredPayment) + break; + } + return Term; - } - + } + public bool GetFirstPmtDistribution(double PmtAmt, ref double - Balance, out double PrinPortion, out double IntPortion) { - Balance = OpeningBalance; + Balance, out double PrinPortion, out double IntPortion) { + Balance = OpeningBalance; return GetNextPmtDistribution(PmtAmt, ref Balance, out PrinPortion, out IntPortion); - } - + } + public bool GetNextPmtDistribution(double PmtAmt, ref double - Balance, out double PrinPortion, out double IntPortion) { - IntPortion = Util.Round(Balance * Rate, 2); - PrinPortion = Util.Round(PmtAmt - IntPortion,2); - Balance = Util.Round(Balance - PrinPortion,2); - + Balance, out double PrinPortion, out double IntPortion) { + IntPortion = Util.Round(Balance * Rate, 2); + PrinPortion = Util.Round(PmtAmt - IntPortion,2); + Balance = Util.Round(Balance - PrinPortion,2); + if (Balance <= 0.0) - return false; - - return true; - } - } - - internal class Util { - public static double Round(double value, short digits) { - double factor = Math.Pow(10, digits); - return Math.Round(value * factor) / factor; - } - } -} -``` - + return false; + + return true; + } + } + + internal class Util { + public static double Round(double value, short digits) { + double factor = Math.Pow(10, digits); + return Math.Round(value * factor) / factor; + } + } +} +``` + ## See also - [Exposing .NET Framework Components to COM](exposing-dotnet-components-to-com.md) diff --git a/docs/framework/tools/al-exe-assembly-linker.md b/docs/framework/tools/al-exe-assembly-linker.md index e22289e17d474..7737af7307d77 100644 --- a/docs/framework/tools/al-exe-assembly-linker.md +++ b/docs/framework/tools/al-exe-assembly-linker.md @@ -47,7 +47,7 @@ You can specify the following `options`; you must specify **/out**. |**/config[uration]:** `text`|Specifies a string for the Configuration field in the assembly. Place the string in double quotation marks (" ") if `text` contains a space. This string is a custom attribute on the assembly and is available for viewing with reflection.

If text is an empty string, the Win32 Configuration resource appears as a single space.

You can also specify this option as a custom attribute () in the source code for any CIL module.| |**/copy[right]:** `text`|Specifies a string for the Copyright field in the assembly. Place the string in double quotation marks (" ") if `text` contains a space. This string is a custom attribute on the assembly and is available for viewing with reflection.

If you do not specify **/win32res**, **/copyright** appears in File Explorer as the Win32 Copyright resource.

If text is an empty string, the Win32 Copyright resource appears as a single space.

If you specify **/win32res**, **/copyright** will not affect the Win32 resource information.

You can also specify this option as a custom attribute () in the source code for any CIL module.| |**/c[ulture]:** `text`|Specifies the culture string to associate with the assembly. Valid values for cultures are those defined by the Internet Requests for Comments (RFC) document 1766 titled "Tags for the Identification of Languages."

Place the string in double quotation marks (" ") if `text` contains a space. There is no default culture string. This string is available for viewing with reflection.

For information about valid `text` strings, see the .

You can also specify this option as a custom attribute () in the source code for any CIL module.| -|`/delay[sign][+ or -]`|Specifies whether the assembly will be fully or partially signed. Use **/delaysign-** if you want a fully signed assembly. Use **/delaysign+** if you only want to include the public key in the assembly.

When you request a fully signed assembly, *Al.exe* hashes the file that contains the manifest (assembly metadata) and signs that hash with the private key. The resulting digital signature is stored in the file that contains the manifest. When an assembly is delay signed, *Al.exe* does not compute and store the signature, but just reserves space in the file so the signature can be added later.

The default is **/delaysign-**.

The **/delaysign** option has no effect unless used with **/keyfile** or **/keyname**.

For example, using **/delaysign+** enables a tester to put the assembly in the global cache. After testing, you can fully sign the assembly by including the private key in the assembly.

Note: Before using the [*Gacutil.exe* (Global Assembly Cache Tool)](gacutil-exe-gac-tool.md) to put a delay-signed assembly into the global cache, use the [*Sn.exe* (Strong Name Tool)](sn-exe-strong-name-tool.md) to register the assembly for verification skipping. For example, `Sn.exe –Vr delaySignedAssembly`. Use this only for development.

You can also specify this option as a custom attribute () in the source code for any CIL module.| +|`/delay[sign][+ or -]`|Specifies whether the assembly will be fully or partially signed. Use **/delaysign-** if you want a fully signed assembly. Use **/delaysign+** if you only want to include the public key in the assembly.

When you request a fully signed assembly, *Al.exe* hashes the file that contains the manifest (assembly metadata) and signs that hash with the private key. The resulting digital signature is stored in the file that contains the manifest. When an assembly is delay signed, *Al.exe* does not compute and store the signature, but just reserves space in the file so the signature can be added later.

The default is **/delaysign-**.

The **/delaysign** option has no effect unless used with **/keyfile** or **/keyname**.

For example, using **/delaysign+** enables a tester to put the assembly in the global cache. After testing, you can fully sign the assembly by including the private key in the assembly.

Note: Before using the [*Gacutil.exe* (Global Assembly Cache Tool)](gacutil-exe-gac-tool.md) to put a delay-signed assembly into the global cache, use the [*Sn.exe* (Strong Name Tool)](sn-exe-strong-name-tool.md) to register the assembly for verification skipping. For example, `Sn.exe -Vr delaySignedAssembly`. Use this only for development.

You can also specify this option as a custom attribute () in the source code for any CIL module.| |**/descr[iption]:** `text`|Specifies a string for the field in the assembly. Place the string in double quotation marks (" ") if `text` contains a space. This string is a custom attribute on the assembly and is available for viewing with reflection.

If you do not specify **/win32res**, **/description** appears in File Explorer as the Win32 **Comments** resource.

If text is an empty string, the Win32 **Comments** resource appears as a single space.

If you specify **/win32res**, **/description** will not affect the Win32 resource information.

You can also specify this option as a custom attribute () in the source code for any CIL module.| |**/e[vidence]:** `file`|Embeds `file` in the assembly with the resource name of Security.Evidence.

You cannot use Security.Evidence for regular resources.| |**/fileversion:** `version`|Specifies a string for the **File Version** field in the assembly. This string is a custom attribute on the assembly and is available for viewing with reflection.

If you do not specify **/win32res**, **/fileversion** will be used as the Win32 **File Version** resource. If you do not specify **/fileversion**, the Win32 **File Version** resource will be populated by the Win32 **Assembly Version** resource.

If **/win32res** is specified, **/fileversion** does not affect the Win32 resource.

You can also specify this option as a custom attribute (AssemblyFileVersionAttribute) in the source code for any CIL module.| diff --git a/docs/framework/tools/caspol-exe-code-access-security-policy-tool.md b/docs/framework/tools/caspol-exe-code-access-security-policy-tool.md index c754535085c9e..b5c9b0b194d89 100644 --- a/docs/framework/tools/caspol-exe-code-access-security-policy-tool.md +++ b/docs/framework/tools/caspol-exe-code-access-security-policy-tool.md @@ -53,7 +53,7 @@ caspol [options] |**-cu**[**stomuser**] *path*|Allows the administration of a custom user policy that doesn't belong to the user on whose behalf Caspol.exe is currently running. You must specify the location of the custom user's security configuration file with the *path* argument.| |**-enterprise**

or

**-en**|Indicates that all options following this one apply to the enterprise level policy. Users who aren't enterprise administrators don't have sufficient rights to modify the enterprise policy, although they can view it. In non-enterprise scenarios, this policy, by default, doesn't interfere with machine and user policy.| |**-e**[**xecution**] {**on** | **off**}|Turns on or off the mechanism that checks for the permission to run before code starts to execute. **Note:** This switch is removed in .NET Framework 4 and later versions. | -|**-f**[**orce**]|Suppresses the tool's self-destruct test and changes the policy as specified by the user. Normally, Caspol.exe checks whether any policy changes would prevent Caspol.exe itself from running properly; if so, Caspol.exe doesn't save the policy change and prints an error message. To force Caspol.exe to change policy even if this prevents Caspol.exe itself from running, use the **–force** option.| +|**-f**[**orce**]|Suppresses the tool's self-destruct test and changes the policy as specified by the user. Normally, Caspol.exe checks whether any policy changes would prevent Caspol.exe itself from running properly; if so, Caspol.exe doesn't save the policy change and prints an error message. To force Caspol.exe to change policy even if this prevents Caspol.exe itself from running, use the **-force** option.| |**-h**[**elp**]|Displays command syntax and options for Caspol.exe.| |**-l**[**ist**]|Lists the code group hierarchy and the permission sets for the specified machine, user, enterprise, or all policy levels. Caspol.exe displays the code group's label first, followed by the name, if it isn't null.| |**-listdescription**

or

**-ld**|Lists all code group descriptions for the specified policy level.| @@ -80,7 +80,7 @@ caspol [options] |Argument|Description| |--------------|-----------------| |**-allcode**|Specifies all code. For more information about this membership condition, see .| -|**-appdir**|Specifies the application directory. If you specify **–appdir** as the membership condition, the URL evidence of code is compared with the application directory evidence of that code. If both evidence values are the same, this membership condition is satisfied. For more information about this membership condition, see .| +|**-appdir**|Specifies the application directory. If you specify **-appdir** as the membership condition, the URL evidence of code is compared with the application directory evidence of that code. If both evidence values are the same, this membership condition is satisfied. For more information about this membership condition, see .| |**-custom** *xmlfile*|Adds a custom membership condition. The mandatory *xmlfile* argument specifies the .xml file that contains XML serialization of the custom membership condition.| |**-hash** *hashAlg* {**-hex** *hashValue* | **-file** *assembly_file* }|Specifies code that has the given assembly hash. To use a hash as a code group membership condition, you must specify either the hash value or the assembly file. For more information about this membership condition, see .| |**-pub** { **-cert** *cert_file_name* |

**-file** *signed_file_name* | **-hex** *hex_string* }|Specifies code that has the given software publisher, as denoted by a certificate file, a signature on a file, or the hexadecimal representation of an X509 certificate. For more information about this membership condition, see .| @@ -89,18 +89,18 @@ caspol [options] |**-url** *URL*|Specifies code that originates from the given URL. The URL must include a protocol, such as `http://` or `ftp://`. Additionally, a wildcard character (\*) can be used to specify multiple assemblies from a particular URL. **Note:** Because a URL can be identified using multiple names, using a URL as a membership condition isn't a safe way to ascertain the identity of code. Where possible, use a strong name membership condition, a publisher membership condition, or the hash membership condition.

For more information about this membership condition, see .| |**-zone** *zonename*|Specifies code with the given zone of origin. The *zonename* argument can be one of the following values: **MyComputer**, **Intranet**, **Trusted**, **Internet**, or **Untrusted**. For more information about this membership condition, see the Class.| - The *flags* argument, which can be used with the **–addgroup** and **–chggroup** options, is specified using one of the following. + The *flags* argument, which can be used with the **-addgroup** and **-chggroup** options, is specified using one of the following. |Argument|Description| |--------------|-----------------| -|**-description** "*description*"|If used with the **–addgroup** option, specifies the description for a code group to add. If used with the **–chggroup** option, specifies the description for a code group to edit. The *description* argument must be enclosed in double quotes.| +|**-description** "*description*"|If used with the **-addgroup** option, specifies the description for a code group to add. If used with the **-chggroup** option, specifies the description for a code group to edit. The *description* argument must be enclosed in double quotes.| |**-exclusive** {**on**|**off**}|When set to **on**, indicates that only the permission set associated with the code group you're adding or modifying is considered when some code fits the membership condition of the code group. When this option is set to **off**, Caspol.exe considers the permission sets of all matching code groups in the policy level.| |**-levelfinal** {**on**|**off**}|When set to **on**, indicates that no policy level below the level in which the added or modified code group occurs is considered. This option is typically used at the machine policy level. For example, if you set this flag for a code group at the machine level and some code matches this code group's membership condition, Caspol.exe does not calculate or apply the user level policy for this code.| -|**-name** "*name*"|If used with the **–addgroup** option, specifies the scripting name for a code group to add. If used with the **-chggroup** option, specifies the scripting name for a code group to edit. The *name* argument must be enclosed in double quotes. The *name* argument cannot begin with a number, and can only contain A-Z, 0-9, and the underscore character. Code groups can be referred to by this *name* instead of by their numeric label. The *name* is also highly useful for scripting purposes.| +|**-name** "*name*"|If used with the **-addgroup** option, specifies the scripting name for a code group to add. If used with the **-chggroup** option, specifies the scripting name for a code group to edit. The *name* argument must be enclosed in double quotes. The *name* argument cannot begin with a number, and can only contain A-Z, 0-9, and the underscore character. Code groups can be referred to by this *name* instead of by their numeric label. The *name* is also highly useful for scripting purposes.| ## Remarks - Security policy is expressed using three policy levels: machine policy, user policy, and enterprise policy. The set of permissions that an assembly receives is determined by the intersection of the permission sets allowed by these three policy levels. Each policy level is represented by a hierarchical structure of code groups. Every code group has a membership condition that determines which code is a member of that group. A named permission set is also associated with each code group. This permission set specifies the permissions the runtime allows code that satisfies the membership condition to have. A code group hierarchy, along with its associated named permission sets, defines and maintains each level of security policy. You can use the **–user**, **-customuser**, **–machine** and **-enterprise** options to set the level of security policy. + Security policy is expressed using three policy levels: machine policy, user policy, and enterprise policy. The set of permissions that an assembly receives is determined by the intersection of the permission sets allowed by these three policy levels. Each policy level is represented by a hierarchical structure of code groups. Every code group has a membership condition that determines which code is a member of that group. A named permission set is also associated with each code group. This permission set specifies the permissions the runtime allows code that satisfies the membership condition to have. A code group hierarchy, along with its associated named permission sets, defines and maintains each level of security policy. You can use the **-user**, **-customuser**, **-machine** and **-enterprise** options to set the level of security policy. For more information about security policy and how the runtime determines which permissions to grant to code, see [Security Policy Management](/previous-versions/dotnet/netframework-4.0/c1k0eed6(v=vs.100)). @@ -108,7 +108,7 @@ caspol [options] To facilitate references to code groups in a hierarchy, the **-list** option displays an indented list of code groups along with their numerical labels (1, 1.1, 1.1.1, and so on). The other command-line operations that target code groups also use the numerical labels to refer to specific code groups. - Named permission sets are referenced by their names. The **–list** option displays the list of code groups followed by a list of named permission sets available in that policy. + Named permission sets are referenced by their names. The **-list** option displays the list of code groups followed by a list of named permission sets available in that policy. ## Caspol.exe Behavior @@ -116,15 +116,15 @@ caspol [options] The **-s**[**ecurity**] {**on** | **off**} option is a computer-wide operation. Turning off code access security terminates security checks for all managed code and for all users on the computer. If side-by-side versions of the .NET Framework are installed, this command turns off security for every version installed on the computer. Although the **-list** option shows that security is turned off, nothing else clearly indicates for other users that security has been turned off. - When a user without administrative rights runs Caspol.exe, all options refer to the user level policy unless the **–machine** option is specified. When an administrator runs Caspol.exe, all options refer to the machine policy unless the **–user** option is specified. + When a user without administrative rights runs Caspol.exe, all options refer to the user level policy unless the **-machine** option is specified. When an administrator runs Caspol.exe, all options refer to the machine policy unless the **-user** option is specified. - Caspol.exe must be granted the equivalent of the **Everything** permission set to function. The tool has a protective mechanism that prevents policy from being modified in ways that would prevent Caspol.exe from being granted the permissions it needs to run. If you try to make such changes, Caspol.exe notifies you that the requested policy change will break the tool, and the policy change is rejected. You can turn off this protective mechanism for a given command by using the **–force** option. + Caspol.exe must be granted the equivalent of the **Everything** permission set to function. The tool has a protective mechanism that prevents policy from being modified in ways that would prevent Caspol.exe from being granted the permissions it needs to run. If you try to make such changes, Caspol.exe notifies you that the requested policy change will break the tool, and the policy change is rejected. You can turn off this protective mechanism for a given command by using the **-force** option. ## Manually Editing the Security Configuration Files - Three security configuration files correspond to the three policy levels supported by Caspol.exe: one for the machine policy, one for a given user's policy, and one for the enterprise policy. These files are created on disk only when machine, user, or enterprise policy is changed using Caspol.exe. You can use the **–reset** option in Caspol.exe to save the default security policy to disk, if needed. + Three security configuration files correspond to the three policy levels supported by Caspol.exe: one for the machine policy, one for a given user's policy, and one for the enterprise policy. These files are created on disk only when machine, user, or enterprise policy is changed using Caspol.exe. You can use the **-reset** option in Caspol.exe to save the default security policy to disk, if needed. In most cases, manually editing the security configuration files isn't recommended. But there might be scenarios in which modifying these files becomes necessary, such as when an administrator wants to edit the security configuration for a particular user. diff --git a/docs/framework/tools/mdbg-exe.md b/docs/framework/tools/mdbg-exe.md index 05bd997528bc5..4f547c574743b 100644 --- a/docs/framework/tools/mdbg-exe.md +++ b/docs/framework/tools/mdbg-exe.md @@ -62,7 +62,7 @@ MDbg [ProgramName[arguments]] [options] |**o**[**ut**]|Moves to the end of the current function.| |**pa**[**th**] [*pathName*]|Searches the specified path for the source files if the location in the binaries is not available.| |**p**[**rint**] [*var*] | [`-d`]|Prints all variables in scope (**print**), prints the specified variable (**print** *var*), or prints the debugger variables (**print**`-d`).| -|**printe**[**xception**] [*-r*]|Prints the last exception on the current thread. Use the `–r` (recursive) option to traverse the `InnerException` property on the exception object to get information about the entire chain of exceptions.| +|**printe**[**xception**] [*-r*]|Prints the last exception on the current thread. Use the `-r` (recursive) option to traverse the `InnerException` property on the exception object to get information about the entire chain of exceptions.| |**pro**[**cessenum**]|Displays the active processes.| |**q**[**uit**] [*exitcode*]|Quits the MDbg.exe shell, optionally specifying the process exit code.| |**re**[**sume**] [`*` | [`~`]*threadNumber*]|Resumes the current thread or the thread specified by the *threadNumber* parameter.

If the *threadNumber* parameter is specified as `*` or if the thread number starts with `~`, the command applies to all threads except the one specified by *threadNumber*.

Resuming a non-suspended thread has no effect.| diff --git a/docs/framework/tools/mpgo-exe-managed-profile-guided-optimization-tool.md b/docs/framework/tools/mpgo-exe-managed-profile-guided-optimization-tool.md index 8b483cd29b29b..7b6262f8491d9 100644 --- a/docs/framework/tools/mpgo-exe-managed-profile-guided-optimization-tool.md +++ b/docs/framework/tools/mpgo-exe-managed-profile-guided-optimization-tool.md @@ -1,14 +1,13 @@ --- title: "Mpgo.exe (Managed Profile Guided Optimization Tool)" description: Use Mpgo.exe, the Managed Profile Guided Optimization Tool. With this tool, optimize native image assemblies created by the Native Image Generator (Ngen.exe). -ms.date: "03/30/2017" +ms.date: 11/24/2025 helpviewer_keywords: - "Mpgo.exe" - "training scenarios, generating profiles with" - "Managed Profile Guided Optimization Tool" - "Ngen.exe" - "Ngen.exe, profilers and native images" -ms.assetid: f6976502-a000-4fbe-aaf5-a7aab9ce4ec2 --- # Mpgo.exe (Managed Profile Guided Optimization Tool) @@ -25,13 +24,13 @@ Enter the following command at the command prompt: For desktop apps: ```console -mpgo –Scenario [-Import ] –AssemblyList ... -OutDir [options] +mpgo -Scenario [-Import ] -AssemblyList ... -OutDir [options] ``` For Windows 8.x Store apps: ```console -mpgo –Scenario -AppID -Timeout +mpgo -Scenario -AppID -Timeout ``` ## Parameters @@ -39,11 +38,11 @@ mpgo –Scenario -AppID -Timeout All arguments to Mpgo.exe are case-insensitive. Commands are prefixed with a dash. > [!NOTE] -> You can use either `–Scenario` or `–Import` as a required command, but not both. None of the required parameters are used if you specify the `–Reset` option. +> You can use either `-Scenario` or `-Import` as a required command, but not both. None of the required parameters are used if you specify the `-Reset` option. |Required parameter|Description| |------------------------|-----------------| -|`-Scenario` \<*command*>

—or—

`-Scenario` \<*packageName*>

-or-

`-Import` \<*directory*>|For desktop apps, use `–Scenario` to specify the command to run the application you want to optimize, including any command-line arguments. Use three sets of double quotation marks around *command* if it specifies a path that includes spaces; for example: `mpgo.exe -scenario """C:\My App\myapp.exe""" -assemblylist """C:\My App\myapp.exe""" -outdir "C:\optimized files"`. Do not use double quotation marks; they will not work correctly if *command* includes spaces.

-or-

For Windows 8.x Store apps, use `–Scenario` to specify the package that you want to generate profile information for. If you specify the package display name or the package family name instead of the full package name, Mpgo.exe will select the package that matches the name you provided if there is only one match. If multiple packages match the specified name, Mpgo.exe will prompt you to choose a package.

—or—

Use `-Import` to specify that optimization data from previously optimized assemblies should be used to optimize the assemblies in `-AssemblyList`. *directory* specifies the directory that contains the previously optimized files. The assemblies specified in `–AssemblyList` or `–AssemblyListFile` are the new versions of the assemblies to be optimized using the data from the imported files. Using optimization data from older version of assemblies enables you to optimize newer versions of assemblies without re-running the scenario. However, if the imported and target assemblies include significantly different code, the optimization data will be ineffective. The assembly names specified in `–AssemblyList` or `–AssemblyListFile` must be present in the directory specified by `–Import`*directory*. Use three sets of double quotation marks around *directory* if it specifies a path that includes spaces.

You must specify either `–Scenario` or `–Import`, but not both parameters.| +|`-Scenario` \<*command*>

—or—

`-Scenario` \<*packageName*>

-or-

`-Import` \<*directory*>|For desktop apps, use `-Scenario` to specify the command to run the application you want to optimize, including any command-line arguments. Use three sets of double quotation marks around *command* if it specifies a path that includes spaces; for example: `mpgo.exe -scenario """C:\My App\myapp.exe""" -assemblylist """C:\My App\myapp.exe""" -outdir "C:\optimized files"`. Do not use double quotation marks; they will not work correctly if *command* includes spaces.

-or-

For Windows 8.x Store apps, use `-Scenario` to specify the package that you want to generate profile information for. If you specify the package display name or the package family name instead of the full package name, Mpgo.exe will select the package that matches the name you provided if there is only one match. If multiple packages match the specified name, Mpgo.exe will prompt you to choose a package.

—or—

Use `-Import` to specify that optimization data from previously optimized assemblies should be used to optimize the assemblies in `-AssemblyList`. *directory* specifies the directory that contains the previously optimized files. The assemblies specified in `-AssemblyList` or `-AssemblyListFile` are the new versions of the assemblies to be optimized using the data from the imported files. Using optimization data from older version of assemblies enables you to optimize newer versions of assemblies without re-running the scenario. However, if the imported and target assemblies include significantly different code, the optimization data will be ineffective. The assembly names specified in `-AssemblyList` or `-AssemblyListFile` must be present in the directory specified by `-Import`*directory*. Use three sets of double quotation marks around *directory* if it specifies a path that includes spaces.

You must specify either `-Scenario` or `-Import`, but not both parameters.| |`-OutDir` \<*directory*>|The directory in which to place the optimized assemblies. If an assembly already exists in the output directory folder, a new copy is created and an index number is appended to its name; for example: *assemblyname*-1.exe. Use double quotation marks around *directory* if it specifies a path that contains spaces.| |`-AssemblyList` \<*assembly1 assembly2 ...*>

—or—

`-AssemblyListFile` \<*file*>|A list of assemblies (including .exe and .dll files), separated by spaces, that you want collect profile information about. You can specify `C:\Dir\*.dll` or `*.dll` to select all the assemblies in the designated or current working directory. See the Remarks section for more information.

—or—

A text file that contains the list of assemblies you want to collect profile information about, listed one assembly per line. If an assembly name begins with a hyphen (-), use an assembly file list or rename the assembly.| |`-AppID` \<*appId*>|The ID of the application in the specified package. If you use the wildcard (\*), Mpgo.exe will try to enumerate the AppIDs in the package and will fall back to \<*package_family_name*>!App if it fails. If you specify a string that is prefixed by an exclamation point (!), Mpgo.exe will concatenate the package family name with the argument provided.| @@ -56,12 +55,12 @@ mpgo –Scenario -AppID -Timeout |`-f`|Forces the inclusion of the profile data in a binary assembly, even if it's signed. If the assembly is signed, it must be re-signed; otherwise, the assembly will fail to load and run.| |`-Reset`|Resets the environment to make certain that an aborted profiling session doesn't affect your assemblies, and then quits. The environment is reset by default before and after a profiling session.| |`-Timeout` \<*time in seconds*>|Specifies the profiling duration in seconds. Use a value that is slightly more than your observed startup times for GUI applications. At the end of the time-out period, the profile data is recorded although the application continues to run. If you don't set this option, profiling will continue until application shutdown, at which time the data will be recorded.| -|`-LeaveNativeImages`|Specifies that the instrumented native images shouldn't be removed after running the scenario. This option is primarily used when you're getting the application that you specified for the scenario running. It will prevent the recreation of native images for subsequent runs of Mpgo.exe. When you have finished running your application, there may be orphaned native images in the cache if you specify this option. In this case, run Mpgo.exe with the same scenario and assembly list and use the `–RemoveNativeImages` parameter to remove these native images.| -|`-RemoveNativeImages`|Cleans up from a run where `–LeaveNativeImages` was specified. If you specify `-RemoveNativeImages`, Mpgo.exe ignores any arguments except `-64bit` and `–AssemblyList`, and exits after removing all instrumented native images.| +|`-LeaveNativeImages`|Specifies that the instrumented native images shouldn't be removed after running the scenario. This option is primarily used when you're getting the application that you specified for the scenario running. It will prevent the recreation of native images for subsequent runs of Mpgo.exe. When you have finished running your application, there may be orphaned native images in the cache if you specify this option. In this case, run Mpgo.exe with the same scenario and assembly list and use the `-RemoveNativeImages` parameter to remove these native images.| +|`-RemoveNativeImages`|Cleans up from a run where `-LeaveNativeImages` was specified. If you specify `-RemoveNativeImages`, Mpgo.exe ignores any arguments except `-64bit` and `-AssemblyList`, and exits after removing all instrumented native images.| ## Remarks - You can use both `–AssemblyList` and `- AssemblyListFile` multiple times on the command line. + You can use both `-AssemblyList` and `- AssemblyListFile` multiple times on the command line. If you do not specify full path names when specifying assemblies, Mpgo.exe looks in the current directory. If you specify an incorrect path, Mpgo.exe displays an error message but continues to generate data for other assemblies. If you specify an assembly that is not loaded during the training scenario, no training data is generated for that assembly. @@ -78,19 +77,19 @@ mpgo –Scenario -AppID -Timeout 2. Run Mpgo.exe as an administrator with the necessary parameters. See the next section for sample commands. - The optimized intermediate language (IL) assemblies are created in the folder specified by the `–OutDir` parameter (in the examples, this is the `C:\Optimized` folder). + The optimized intermediate language (IL) assemblies are created in the folder specified by the `-OutDir` parameter (in the examples, this is the `C:\Optimized` folder). -3. Replace the IL assemblies you used for Ngen.exe with the new IL assemblies that contain the profile information from the directory specified by `–OutDir`. +3. Replace the IL assemblies you used for Ngen.exe with the new IL assemblies that contain the profile information from the directory specified by `-OutDir`. 4. The application setup (using the images provided by Mpgo.exe) will install optimized native images. ## Suggested Workflow -1. Create a set of optimized IL assemblies by using Mpgo.exe with the `–Scenario` parameter. +1. Create a set of optimized IL assemblies by using Mpgo.exe with the `-Scenario` parameter. 2. Check the optimized IL assemblies into source control. -3. In the build process, call Mpgo.exe with the `–Import` parameter as a post-build step to generate optimized IL images to pass to Ngen.exe. +3. In the build process, call Mpgo.exe with the `-Import` parameter as a post-build step to generate optimized IL images to pass to Ngen.exe. This process ensures that all assemblies have optimization data. If you check in updated optimized assemblies (steps 1 and 2) more frequently, the performance numbers will be more consistent throughout product development. @@ -98,9 +97,9 @@ mpgo –Scenario -AppID -Timeout You can run Mpgo.exe from Visual Studio (see the article [How to: Specify Build Events (C#)](/visualstudio/ide/how-to-specify-build-events-csharp)) with the following restrictions: -- You cannot use quoted paths with trailing slash marks, because Visual Studio macros also use trailing slash marks by default. (For example, `–OutDir "C:\Output Folder\"` is invalid.) To work around this restriction, you can escape the trailing slash. (For example, use `-OutDir "$(OutDir)\"` instead.) +- You cannot use quoted paths with trailing slash marks, because Visual Studio macros also use trailing slash marks by default. (For example, `-OutDir "C:\Output Folder\"` is invalid.) To work around this restriction, you can escape the trailing slash. (For example, use `-OutDir "$(OutDir)\"` instead.) -- By default, Mpgo.exe is not on the Visual Studio build path. You must either add the path to Visual Studio or specify the full path on the Mpgo command line. You can use either the `–Scenario` or the `–Import` parameter in the post-build event in Visual Studio. However, the typical process is to use `–Scenario` one time from a Developer Command Prompt for Visual Studio, and then use `–Import` to update the optimized assemblies after each build; for example: `"C:\Program Files\Microsoft Visual Studio 11.0\Team Tools\Performance Tools\mpgo.exe" -import "$(OutDir)tmp" -assemblylist "$(TargetPath)" -outdir "$(OutDir)\"`. +- By default, Mpgo.exe is not on the Visual Studio build path. You must either add the path to Visual Studio or specify the full path on the Mpgo command line. You can use either the `-Scenario` or the `-Import` parameter in the post-build event in Visual Studio. However, the typical process is to use `-Scenario` one time from a Developer Command Prompt for Visual Studio, and then use `-Import` to update the optimized assemblies after each build; for example: `"C:\Program Files\Microsoft Visual Studio 11.0\Team Tools\Performance Tools\mpgo.exe" -import "$(OutDir)tmp" -assemblylist "$(TargetPath)" -outdir "$(OutDir)\"`. @@ -109,13 +108,13 @@ mpgo –Scenario -AppID -Timeout The following Mpgo.exe command from a Developer Command Prompt for Visual Studio optimizes a tax application: ```console -mpgo –scenario "C:\MyApp\MyTax.exe /params par" –AssemblyList Mytax.dll MyTaxUtil2011.dll –OutDir C:\Optimized –TimeOut 15 +mpgo -scenario "C:\MyApp\MyTax.exe /params par" -AssemblyList Mytax.dll MyTaxUtil2011.dll -OutDir C:\Optimized -TimeOut 15 ``` The following Mpgo.exe command optimizes a sound application: ```console -mpgo –scenario "C:\MyApp\wav2wma.exe –input song1.wav –output song1.wma" –AssemblyList transcode.dll –OutDir C:\Optimized –TimeOut 15 +mpgo -scenario "C:\MyApp\wav2wma.exe -input song1.wav -output song1.wma" -AssemblyList transcode.dll -OutDir C:\Optimized -TimeOut 15 ``` The following Mpgo.exe command uses data from previously optimized assemblies to optimize newer versions of the assemblies: diff --git a/docs/framework/tools/resgen-exe-resource-file-generator.md b/docs/framework/tools/resgen-exe-resource-file-generator.md index f9b90b2e08682..49d9e8e1e2428 100644 --- a/docs/framework/tools/resgen-exe-resource-file-generator.md +++ b/docs/framework/tools/resgen-exe-resource-file-generator.md @@ -2,7 +2,7 @@ title: "Resgen.exe (Resource File Generator)" description: Use Resgen.exe, the Resource File Generator. Convert text (.txt, .restext) and XML resource format (.resx) files to embeddable CLR runtime binaries (.resources). ms.date: 10/23/2023 -helpviewer_keywords: +helpviewer_keywords: - "resource files, .resources files" - "resource files, .resx files" - "resx files (resource files)" @@ -34,7 +34,7 @@ Resgen.exe is a general-purpose resource conversion utility that performs the fo - Creates a strongly typed class that provides access to individual named resources and to the instance. - If Resgen.exe fails for any reason, the return value is –1. + If Resgen.exe fails for any reason, the return value is -1. To get help with Resgen.exe, you can use the following command, with no options specified, to display the command syntax and options for Resgen.exe: diff --git a/docs/framework/tools/sn-exe-strong-name-tool.md b/docs/framework/tools/sn-exe-strong-name-tool.md index 0c4d56e11dd41..798238317bfe3 100644 --- a/docs/framework/tools/sn-exe-strong-name-tool.md +++ b/docs/framework/tools/sn-exe-strong-name-tool.md @@ -62,7 +62,7 @@ sn [-quiet][option [parameter(s)]] |`-TSc assembly container`|Test-signs the signed or partially signed *assembly* with the key pair in the key container *container*.| |`-v assembly`|Verifies the strong name in *assembly*, where *assembly* is the name of a file that contains an assembly manifest.| |`-vf assembly`|Verifies the strong name in *assembly.* Unlike the **-v** option, **-vf** forces verification even if it is disabled using the **-Vr** option.| -|`-Vk regfile.reg assembly [userlist] [infile]`|Creates a registration entries (.reg) file you can use to register the specified assembly for verification skipping. The rules for assembly naming that apply to the **-Vr** option apply to **–Vk** as well. For information about the *userlist* and *infile* options, see the **–Vr** option.| +|`-Vk regfile.reg assembly [userlist] [infile]`|Creates a registration entries (.reg) file you can use to register the specified assembly for verification skipping. The rules for assembly naming that apply to the **-Vr** option apply to **-Vk** as well. For information about the *userlist* and *infile* options, see the **-Vr** option.| |`-Vl`|Lists current settings for strong-name verification on this computer.| |`-Vr assembly [userlist] [infile]`|Registers *assembly* for verification skipping. Optionally, you can specify a comma-separated list of user names the skip verification should apply to. If you specify *infile*, verification remains enabled, but the public key in *infile* is used in verification operations. You can specify *assembly* in the form *\*, strongname* to register all assemblies with the specified strong name. For *strongname*, specify the string of hexadecimal digits representing the tokenized form of the public key. See the **-t** and **-T** options to display the public key token. **Caution:** Use this option only during development. Adding an assembly to the skip verification list creates a security vulnerability. A malicious assembly could use the fully specified assembly name (assembly name, version, culture, and public key token) of the assembly added to the skip verification list to fake its identity. This would allow the malicious assembly to also skip verification.| |`-Vu assembly`|Unregisters *assembly* for verification skipping. The same rules for assembly naming that apply to **-Vr** apply to **-Vu**.| @@ -74,10 +74,10 @@ sn [-quiet][option [parameter(s)]] ## Remarks - The **-R** and **–Rc** options are useful with assemblies that have been delay-signed. In this scenario, only the public key has been set at compile time and signing is performed later, when the private key is known. + The **-R** and **-Rc** options are useful with assemblies that have been delay-signed. In this scenario, only the public key has been set at compile time and signing is performed later, when the private key is known. > [!NOTE] -> For parameters (for example, –**Vr)** that write to protected resources such as the registry, run SN.exe as an administrator. +> For parameters (for example, -**Vr)** that write to protected resources such as the registry, run SN.exe as an administrator. The Strong Name tool assumes that public/private key pairs are generated with the `AT_SIGNATURE` algorithm identifier. Public/private key pairs generated with the `AT_KEYEXCHANGE` algorithm generate an error. diff --git a/docs/framework/unmanaged-api/profiling/icorprofilercallback-movedreferences-method.md b/docs/framework/unmanaged-api/profiling/icorprofilercallback-movedreferences-method.md index 6a404fd9b7e20..3432d242eef18 100644 --- a/docs/framework/unmanaged-api/profiling/icorprofilercallback-movedreferences-method.md +++ b/docs/framework/unmanaged-api/profiling/icorprofilercallback-movedreferences-method.md @@ -2,88 +2,88 @@ description: "Learn more about: ICorProfilerCallback::MovedReferences Method" title: "ICorProfilerCallback::MovedReferences Method" ms.date: "03/30/2017" -api_name: +api_name: - "ICorProfilerCallback.MovedReferences" -api_location: +api_location: - "mscorwks.dll" -api_type: +api_type: - "COM" -f1_keywords: +f1_keywords: - "ICorProfilerCallback::MovedReferences" -helpviewer_keywords: +helpviewer_keywords: - "MovedReferences method [.NET Framework profiling]" - "ICorProfilerCallback::MovedReferences method [.NET Framework profiling]" ms.assetid: 996c71ae-0676-4616-a085-84ebf507649d -topic_type: +topic_type: - "apiref" --- # ICorProfilerCallback::MovedReferences Method -Called to report the new layout of objects in the heap as a result of a compacting garbage collection. - -## Syntax - -```cpp -HRESULT MovedReferences( - [in] ULONG cMovedObjectIDRanges, - [in, size_is(cMovedObjectIDRanges)] ObjectID oldObjectIDRangeStart[] , - [in, size_is(cMovedObjectIDRanges)] ObjectID newObjectIDRangeStart[] , - [in, size_is(cMovedObjectIDRanges)] ULONG cObjectIDRangeLength[] ); -``` - -## Parameters - - `cMovedObjectIDRanges` - [in] The number of blocks of contiguous objects that moved as the result of the compacting garbage collection. That is, the value of `cMovedObjectIDRanges` is the total size of the `oldObjectIDRangeStart`, `newObjectIDRangeStart`, and `cObjectIDRangeLength` arrays. - - The next three arguments of `MovedReferences` are parallel arrays. In other words, `oldObjectIDRangeStart[i]`, `newObjectIDRangeStart[i]`, and `cObjectIDRangeLength[i]` all concern a single block of contiguous objects. - - `oldObjectIDRangeStart` - [in] An array of `ObjectID` values, each of which is the old (pre-garbage collection) starting address of a block of contiguous, live objects in memory. - - `newObjectIDRangeStart` - [in] An array of `ObjectID` values, each of which is the new (post-garbage collection) starting address of a block of contiguous, live objects in memory. - - `cObjectIDRangeLength` - [in] An array of integers, each of which is the size of a block of contiguous objects in memory. - - A size is specified for each block that is referenced in the `oldObjectIDRangeStart` and `newObjectIDRangeStart` arrays. - -## Remarks - +Called to report the new layout of objects in the heap as a result of a compacting garbage collection. + +## Syntax + +```cpp +HRESULT MovedReferences( + [in] ULONG cMovedObjectIDRanges, + [in, size_is(cMovedObjectIDRanges)] ObjectID oldObjectIDRangeStart[] , + [in, size_is(cMovedObjectIDRanges)] ObjectID newObjectIDRangeStart[] , + [in, size_is(cMovedObjectIDRanges)] ULONG cObjectIDRangeLength[] ); +``` + +## Parameters + + `cMovedObjectIDRanges` + [in] The number of blocks of contiguous objects that moved as the result of the compacting garbage collection. That is, the value of `cMovedObjectIDRanges` is the total size of the `oldObjectIDRangeStart`, `newObjectIDRangeStart`, and `cObjectIDRangeLength` arrays. + + The next three arguments of `MovedReferences` are parallel arrays. In other words, `oldObjectIDRangeStart[i]`, `newObjectIDRangeStart[i]`, and `cObjectIDRangeLength[i]` all concern a single block of contiguous objects. + + `oldObjectIDRangeStart` + [in] An array of `ObjectID` values, each of which is the old (pre-garbage collection) starting address of a block of contiguous, live objects in memory. + + `newObjectIDRangeStart` + [in] An array of `ObjectID` values, each of which is the new (post-garbage collection) starting address of a block of contiguous, live objects in memory. + + `cObjectIDRangeLength` + [in] An array of integers, each of which is the size of a block of contiguous objects in memory. + + A size is specified for each block that is referenced in the `oldObjectIDRangeStart` and `newObjectIDRangeStart` arrays. + +## Remarks + > [!IMPORTANT] -> This method reports sizes as `MAX_ULONG` for objects that are greater than 4 GB on 64-bit platforms. To get the size of objects that are larger than 4 GB, use the [ICorProfilerCallback4::MovedReferences2](icorprofilercallback4-movedreferences2-method.md) method instead. - - A compacting garbage collector reclaims the memory occupied by dead objects and compacts that freed space. As a result, live objects might be moved within the heap, and `ObjectID` values distributed by previous notifications might change. - - Assume that an existing `ObjectID` value (`oldObjectID`) lies within the following range: - - `oldObjectIDRangeStart[i]` <= `oldObjectID` < `oldObjectIDRangeStart[i]` + `cObjectIDRangeLength[i]` - - In this case, the offset from the start of the range to the start of the object is as follows: - - `oldObjectID` - `oldObjectRangeStart[i]` - - For any value of `i` that is in the following range: - - 0 <= `i` < `cMovedObjectIDRanges` - - you can calculate the new `ObjectID` as follows: - - `newObjectID` = `newObjectIDRangeStart[i]` + (`oldObjectID` – `oldObjectIDRangeStart[i]`) - - None of the `ObjectID` values passed by `MovedReferences` are valid during the callback itself, because the garbage collection might be in the middle of moving objects from old locations to new locations. Therefore, profilers should not attempt to inspect objects during a `MovedReferences` call. A [ICorProfilerCallback2::GarbageCollectionFinished](icorprofilercallback2-garbagecollectionfinished-method.md) callback indicates that all objects have been moved to their new locations and inspection can be performed. - -## Requirements - - **Platforms:** See [System Requirements](../../get-started/system-requirements.md). - - **Header:** CorProf.idl, CorProf.h - - **Library:** CorGuids.lib - - **.NET Framework Versions:** [!INCLUDE[net_current_v20plus](../../../../includes/net-current-v20plus-md.md)] - +> This method reports sizes as `MAX_ULONG` for objects that are greater than 4 GB on 64-bit platforms. To get the size of objects that are larger than 4 GB, use the [ICorProfilerCallback4::MovedReferences2](icorprofilercallback4-movedreferences2-method.md) method instead. + + A compacting garbage collector reclaims the memory occupied by dead objects and compacts that freed space. As a result, live objects might be moved within the heap, and `ObjectID` values distributed by previous notifications might change. + + Assume that an existing `ObjectID` value (`oldObjectID`) lies within the following range: + + `oldObjectIDRangeStart[i]` <= `oldObjectID` < `oldObjectIDRangeStart[i]` + `cObjectIDRangeLength[i]` + + In this case, the offset from the start of the range to the start of the object is as follows: + + `oldObjectID` - `oldObjectRangeStart[i]` + + For any value of `i` that is in the following range: + + 0 <= `i` < `cMovedObjectIDRanges` + + you can calculate the new `ObjectID` as follows: + + `newObjectID` = `newObjectIDRangeStart[i]` + (`oldObjectID` - `oldObjectIDRangeStart[i]`) + + None of the `ObjectID` values passed by `MovedReferences` are valid during the callback itself, because the garbage collection might be in the middle of moving objects from old locations to new locations. Therefore, profilers should not attempt to inspect objects during a `MovedReferences` call. A [ICorProfilerCallback2::GarbageCollectionFinished](icorprofilercallback2-garbagecollectionfinished-method.md) callback indicates that all objects have been moved to their new locations and inspection can be performed. + +## Requirements + + **Platforms:** See [System Requirements](../../get-started/system-requirements.md). + + **Header:** CorProf.idl, CorProf.h + + **Library:** CorGuids.lib + + **.NET Framework Versions:** [!INCLUDE[net_current_v20plus](../../../../includes/net-current-v20plus-md.md)] + ## See also - [ICorProfilerCallback Interface](icorprofilercallback-interface.md) diff --git a/docs/framework/unmanaged-api/profiling/icorprofilercallback4-movedreferences2-method.md b/docs/framework/unmanaged-api/profiling/icorprofilercallback4-movedreferences2-method.md index 21a30b24c4703..3faee9c86cf6c 100644 --- a/docs/framework/unmanaged-api/profiling/icorprofilercallback4-movedreferences2-method.md +++ b/docs/framework/unmanaged-api/profiling/icorprofilercallback4-movedreferences2-method.md @@ -2,87 +2,87 @@ description: "Learn more about: ICorProfilerCallback4::MovedReferences2 Method" title: "ICorProfilerCallback4::MovedReferences2 Method" ms.date: "03/30/2017" -api_name: +api_name: - "ICorProfilerCallback4.MovedReferences2" -api_location: +api_location: - "mscorwks.dll" -api_type: +api_type: - "COM" -f1_keywords: +f1_keywords: - "ICorProfilerCallback4::MovedReferences2" -helpviewer_keywords: +helpviewer_keywords: - "MovedReferences2 method, ICorProfilerCallback4 interface [.NET Framework profiling]" - "ICorProfilerCallback4::MovedReferences2 method [.NET Framework profiling]" ms.assetid: d17a065b-5bc6-4817-b3e1-1e413fcb33a8 -topic_type: +topic_type: - "apiref" --- # ICorProfilerCallback4::MovedReferences2 Method -Called to report the new layout of objects in the heap as a result of a compacting garbage collection. This method is called if the profiler has implemented the [ICorProfilerCallback4](icorprofilercallback4-interface.md) interface. This callback replaces the [ICorProfilerCallback::MovedReferences](icorprofilercallback-movedreferences-method.md) method, because it can report larger ranges of objects whose lengths exceed what can be expressed in a ULONG. - -## Syntax - -```cpp -HRESULT MovedReferences2( - [in] ULONG cMovedObjectIDRanges, - [in, size_is(cMovedObjectIDRanges)] ObjectID oldObjectIDRangeStart[] , - [in, size_is(cMovedObjectIDRanges)] ObjectID newObjectIDRangeStart[] , - [in, size_is(cMovedObjectIDRanges)] SIZE_T cObjectIDRangeLength[] ); -``` - -## Parameters - - `cMovedObjectIDRanges` - [in] The number of blocks of contiguous objects that moved as the result of the compacting garbage collection. That is, the value of `cMovedObjectIDRanges` is the total size of the `oldObjectIDRangeStart`, `newObjectIDRangeStart`, and `cObjectIDRangeLength` arrays. - - The next three arguments of `MovedReferences2` are parallel arrays. In other words, `oldObjectIDRangeStart[i]`, `newObjectIDRangeStart[i]`, and `cObjectIDRangeLength[i]` all concern a single block of contiguous objects. - - `oldObjectIDRangeStart` - [in] An array of `ObjectID` values, each of which is the old (pre-garbage collection) starting address of a block of contiguous, live objects in memory. - - `newObjectIDRangeStart` - [in] An array of `ObjectID` values, each of which is the new (post-garbage collection) starting address of a block of contiguous, live objects in memory. - - `cObjectIDRangeLength` - [in] An array of integers, each of which is the size of a block of contiguous objects in memory. - - A size is specified for each block that is referenced in the `oldObjectIDRangeStart` and `newObjectIDRangeStart` arrays. - -## Remarks - - A compacting garbage collector reclaims the memory occupied by dead objects and compacts that freed space. As a result, live objects might be moved within the heap, and `ObjectID` values distributed by previous notifications might change. - - Assume that an existing `ObjectID` value (`oldObjectID`) lies within the following range: - - `oldObjectIDRangeStart[i]` <= `oldObjectID` < `oldObjectIDRangeStart[i]` + `cObjectIDRangeLength[i]` - - In this case, the offset from the start of the range to the start of the object is as follows: - - `oldObjectID` - `oldObjectRangeStart[i]` - - For any value of `i` that is in the following range: - - 0 <= `i` < `cMovedObjectIDRanges` - - you can calculate the new `ObjectID` as follows: - - `newObjectID` = `newObjectIDRangeStart[i]` + (`oldObjectID` – `oldObjectIDRangeStart[i]`) - - None of the `ObjectID` values passed by `MovedReferences2` are valid during the callback itself, because the garbage collector might be in the middle of moving objects from old locations to new locations. Therefore, profilers should not attempt to inspect objects during a `MovedReferences2` call. A [ICorProfilerCallback2::GarbageCollectionFinished](icorprofilercallback2-garbagecollectionfinished-method.md) callback indicates that all objects have been moved to their new locations and inspection can be performed. - - If the profiler implements both the [ICorProfilerCallback](icorprofilercallback-interface.md) and the [ICorProfilerCallback4](icorprofilercallback4-interface.md) interfaces, the `MovedReferences2` method is called before the [ICorProfilerCallback::MovedReferences](icorprofilercallback-movedreferences-method.md) method, but only if the `MovedReferences2` method returns successfully. Profilers can return an HRESULT that indicates failure from the `MovedReferences2` method, to avoid calling the second method. - -## Requirements - - **Platforms:** See [System Requirements](../../get-started/system-requirements.md). - - **Header:** CorProf.idl, CorProf.h - - **Library:** CorGuids.lib - - **.NET Framework Versions:** [!INCLUDE[net_current_v45plus](../../../../includes/net-current-v45plus-md.md)] - +Called to report the new layout of objects in the heap as a result of a compacting garbage collection. This method is called if the profiler has implemented the [ICorProfilerCallback4](icorprofilercallback4-interface.md) interface. This callback replaces the [ICorProfilerCallback::MovedReferences](icorprofilercallback-movedreferences-method.md) method, because it can report larger ranges of objects whose lengths exceed what can be expressed in a ULONG. + +## Syntax + +```cpp +HRESULT MovedReferences2( + [in] ULONG cMovedObjectIDRanges, + [in, size_is(cMovedObjectIDRanges)] ObjectID oldObjectIDRangeStart[] , + [in, size_is(cMovedObjectIDRanges)] ObjectID newObjectIDRangeStart[] , + [in, size_is(cMovedObjectIDRanges)] SIZE_T cObjectIDRangeLength[] ); +``` + +## Parameters + + `cMovedObjectIDRanges` + [in] The number of blocks of contiguous objects that moved as the result of the compacting garbage collection. That is, the value of `cMovedObjectIDRanges` is the total size of the `oldObjectIDRangeStart`, `newObjectIDRangeStart`, and `cObjectIDRangeLength` arrays. + + The next three arguments of `MovedReferences2` are parallel arrays. In other words, `oldObjectIDRangeStart[i]`, `newObjectIDRangeStart[i]`, and `cObjectIDRangeLength[i]` all concern a single block of contiguous objects. + + `oldObjectIDRangeStart` + [in] An array of `ObjectID` values, each of which is the old (pre-garbage collection) starting address of a block of contiguous, live objects in memory. + + `newObjectIDRangeStart` + [in] An array of `ObjectID` values, each of which is the new (post-garbage collection) starting address of a block of contiguous, live objects in memory. + + `cObjectIDRangeLength` + [in] An array of integers, each of which is the size of a block of contiguous objects in memory. + + A size is specified for each block that is referenced in the `oldObjectIDRangeStart` and `newObjectIDRangeStart` arrays. + +## Remarks + + A compacting garbage collector reclaims the memory occupied by dead objects and compacts that freed space. As a result, live objects might be moved within the heap, and `ObjectID` values distributed by previous notifications might change. + + Assume that an existing `ObjectID` value (`oldObjectID`) lies within the following range: + + `oldObjectIDRangeStart[i]` <= `oldObjectID` < `oldObjectIDRangeStart[i]` + `cObjectIDRangeLength[i]` + + In this case, the offset from the start of the range to the start of the object is as follows: + + `oldObjectID` - `oldObjectRangeStart[i]` + + For any value of `i` that is in the following range: + + 0 <= `i` < `cMovedObjectIDRanges` + + you can calculate the new `ObjectID` as follows: + + `newObjectID` = `newObjectIDRangeStart[i]` + (`oldObjectID` - `oldObjectIDRangeStart[i]`) + + None of the `ObjectID` values passed by `MovedReferences2` are valid during the callback itself, because the garbage collector might be in the middle of moving objects from old locations to new locations. Therefore, profilers should not attempt to inspect objects during a `MovedReferences2` call. A [ICorProfilerCallback2::GarbageCollectionFinished](icorprofilercallback2-garbagecollectionfinished-method.md) callback indicates that all objects have been moved to their new locations and inspection can be performed. + + If the profiler implements both the [ICorProfilerCallback](icorprofilercallback-interface.md) and the [ICorProfilerCallback4](icorprofilercallback4-interface.md) interfaces, the `MovedReferences2` method is called before the [ICorProfilerCallback::MovedReferences](icorprofilercallback-movedreferences-method.md) method, but only if the `MovedReferences2` method returns successfully. Profilers can return an HRESULT that indicates failure from the `MovedReferences2` method, to avoid calling the second method. + +## Requirements + + **Platforms:** See [System Requirements](../../get-started/system-requirements.md). + + **Header:** CorProf.idl, CorProf.h + + **Library:** CorGuids.lib + + **.NET Framework Versions:** [!INCLUDE[net_current_v45plus](../../../../includes/net-current-v45plus-md.md)] + ## See also - [ICorProfilerCallback Interface](icorprofilercallback-interface.md) diff --git a/docs/framework/wcf/diagnostics/tracing/recommended-settings-for-tracing-and-message-logging.md b/docs/framework/wcf/diagnostics/tracing/recommended-settings-for-tracing-and-message-logging.md index 7f16b26277d79..47c1073425847 100644 --- a/docs/framework/wcf/diagnostics/tracing/recommended-settings-for-tracing-and-message-logging.md +++ b/docs/framework/wcf/diagnostics/tracing/recommended-settings-for-tracing-and-message-logging.md @@ -6,112 +6,112 @@ ms.assetid: c6aca6e8-704e-4779-a9ef-50c46850249e --- # Recommended Settings for Tracing and Message Logging -This topic describes recommended tracing and message logging settings for different operating environments. - -## Recommended Settings for a Production Environment - - For a production environment, if you are using WCF trace sources, set the `switchValue` to Warning. If you are using the WCF `System.ServiceModel` trace source, set the `switchValue` attribute to `Warning` and the `propagateActivity` attribute to `true`. If you are using a user-defined trace source, set the `switchValue` attribute to `Warning, ActivityTracing`. This can be done manually using the [Configuration Editor Tool (SvcConfigEditor.exe)](../../configuration-editor-tool-svcconfigeditor-exe.md). If you do not anticipate a hit in performance, you can set the `switchValue` attribute to `Information` in all the previously mentioned cases, which generates a fairly large amount of trace data. The following example demonstrates these recommended settings. - -```xml - - - - - - - - - - - - - - - - - - - - - - - - -``` - -## Recommended Settings for Deployment or Debugging - - For deployment or debugging environment, choose `Information` or `Verbose`, along with `ActivityTracing` for either a user-defined or `System.ServiceModel` trace source. To enhance debugging, you should also add an additional trace source (`System.ServiceModel.MessageLogging`) to the configuration to enable message logging. Notice that the `switchValue` attribute has no impact on this trace source. - - The following example demonstrates the recommended settings, using a shared listener that utilizes the `XmlWriterTraceListener`. - -```xml - - - - - - - - - - - - - - - - - - - - - - - - - - +This topic describes recommended tracing and message logging settings for different operating environments. + +## Recommended Settings for a Production Environment + + For a production environment, if you are using WCF trace sources, set the `switchValue` to Warning. If you are using the WCF `System.ServiceModel` trace source, set the `switchValue` attribute to `Warning` and the `propagateActivity` attribute to `true`. If you are using a user-defined trace source, set the `switchValue` attribute to `Warning, ActivityTracing`. This can be done manually using the [Configuration Editor Tool (SvcConfigEditor.exe)](../../configuration-editor-tool-svcconfigeditor-exe.md). If you do not anticipate a hit in performance, you can set the `switchValue` attribute to `Information` in all the previously mentioned cases, which generates a fairly large amount of trace data. The following example demonstrates these recommended settings. + +```xml + + + + + + + + + + + + + + + + + + + + + + + + +``` + +## Recommended Settings for Deployment or Debugging + + For deployment or debugging environment, choose `Information` or `Verbose`, along with `ActivityTracing` for either a user-defined or `System.ServiceModel` trace source. To enhance debugging, you should also add an additional trace source (`System.ServiceModel.MessageLogging`) to the configuration to enable message logging. Notice that the `switchValue` attribute has no impact on this trace source. + + The following example demonstrates the recommended settings, using a shared listener that utilizes the `XmlWriterTraceListener`. + +```xml + + + + + + + + + + + + + + + + + + + + + + + + + + - - - -``` - -## Using WMI to Modify Settings - - You can use WMI to change configuration settings at run time (by enabling the `wmiProviderEnabled` attribute in the configuration, as demonstrated in the previously configuration example). For example, you can use WMI within the CIM Studio to change the trace source levels from Warning to Information at run time. You should be aware that the performance cost of live debugging in this way can be very high. For more information about using WMI, see the [Using Windows Management Instrumentation for Diagnostics](../wmi/index.md) topic. - -## Enable Correlated Events in ASP.NET Tracing - - ASP.NET events do not set the correlation ID (ActivityID) unless ASP.NET event tracing is turned on. To see correlated events properly, you have to turn on ASP.NET events tracing using the following command in the command console, which can be invoked by going to **Start**, **Run** and type **cmd**, - -```console -logman start mytrace -pf logman.providers -o test.etl –ets -``` - - To turn off tracing of ASP.NET events, use the following command, - + /> + + + +``` + +## Using WMI to Modify Settings + + You can use WMI to change configuration settings at run time (by enabling the `wmiProviderEnabled` attribute in the configuration, as demonstrated in the previously configuration example). For example, you can use WMI within the CIM Studio to change the trace source levels from Warning to Information at run time. You should be aware that the performance cost of live debugging in this way can be very high. For more information about using WMI, see the [Using Windows Management Instrumentation for Diagnostics](../wmi/index.md) topic. + +## Enable Correlated Events in ASP.NET Tracing + + ASP.NET events do not set the correlation ID (ActivityID) unless ASP.NET event tracing is turned on. To see correlated events properly, you have to turn on ASP.NET events tracing using the following command in the command console, which can be invoked by going to **Start**, **Run** and type **cmd**, + ```console -logman stop mytrace -ets -``` - +logman start mytrace -pf logman.providers -o test.etl -ets +``` + + To turn off tracing of ASP.NET events, use the following command, + +```console +logman stop mytrace -ets +``` + ## See also - [Using Windows Management Instrumentation for Diagnostics](../wmi/index.md) diff --git a/docs/framework/wcf/feature-details/configuring-ws-atomic-transaction-support.md b/docs/framework/wcf/feature-details/configuring-ws-atomic-transaction-support.md index d4ad997b97110..3e1f66ba31a28 100644 --- a/docs/framework/wcf/feature-details/configuring-ws-atomic-transaction-support.md +++ b/docs/framework/wcf/feature-details/configuring-ws-atomic-transaction-support.md @@ -36,13 +36,13 @@ To register the product, execute the following command from a Command Prompt win To enable the WS-AT protocol service inside MSDTC using port 443 and an X.509 certificate with a private key that has been installed in the local machine store, use the wsatConfig.exe tool with the following command. -`WsatConfig.exe –network:enable –port:8443 –endpointCert: -accountsCerts: -restart` +`WsatConfig.exe -network:enable -port:8443 -endpointCert: -accountsCerts: -restart` Substitute the respective parameters with values relevant to your environment. To disable the WS-AT protocol service inside MSDTC, use the wsatConfig.exe tool with the following command. -`WsatConfig.exe –network:disable -restart` +`WsatConfig.exe -network:disable -restart` ## Configure trust between two machines diff --git a/docs/framework/wcf/feature-details/deploying-an-internet-information-services-hosted-wcf-service.md b/docs/framework/wcf/feature-details/deploying-an-internet-information-services-hosted-wcf-service.md index 6e07ae7365e01..55235ede477fe 100644 --- a/docs/framework/wcf/feature-details/deploying-an-internet-information-services-hosted-wcf-service.md +++ b/docs/framework/wcf/feature-details/deploying-an-internet-information-services-hosted-wcf-service.md @@ -32,7 +32,7 @@ The installation process for .NET Framework automatically registers WCF with IIS - Windows 7 and Windows Server 2003: Use the [ServiceModel Registration Tool (ServiceModelReg.exe)](../servicemodelreg-exe.md) tool to register WCF with IIS. To use this tool, enter `ServiceModelReg.exe /i /x` in [Visual Studio Developer Command Prompt or Visual Studio Developer PowerShell](/visualstudio/ide/reference/command-prompt-powershell). -- Windows 7: Finally, you must verify that ASP.NET is configured to use .NET Framework version 4 or later. You do this by running the ASPNET_Regiis tool with the `–i` option. For more information, see [ASP.NET IIS Registration Tool](/previous-versions/dotnet/netframework-3.5/k6h9cz8h(v=vs.90)). +- Windows 7: Finally, you must verify that ASP.NET is configured to use .NET Framework version 4 or later. You do this by running the ASPNET_Regiis tool with the `-i` option. For more information, see [ASP.NET IIS Registration Tool](/previous-versions/dotnet/netframework-3.5/k6h9cz8h(v=vs.90)). ## Create a New IIS Application or Reuse an Existing ASP.NET Application diff --git a/docs/framework/wcf/find-private-key-tool-findprivatekey-exe.md b/docs/framework/wcf/find-private-key-tool-findprivatekey-exe.md index 942496bb0167e..3cf3b8e7865fc 100644 --- a/docs/framework/wcf/find-private-key-tool-findprivatekey-exe.md +++ b/docs/framework/wcf/find-private-key-tool-findprivatekey-exe.md @@ -45,5 +45,5 @@ FindPrivateKey My CurrentUser -n "CN=John Doe" The following command retrieves the private key for the local machine: ```console -FindPrivateKey My LocalMachine -t "03 33 98 63 d0 47 e7 48 71 33 62 64 76 5c 4c 9d 42 1d 6b 52" –a +FindPrivateKey My LocalMachine -t "03 33 98 63 d0 47 e7 48 71 33 62 64 76 5c 4c 9d 42 1d 6b 52" -a ``` diff --git a/docs/framework/wcf/samples/internet-information-service-hosting-instructions.md b/docs/framework/wcf/samples/internet-information-service-hosting-instructions.md index 08bf9ef6aae46..eaa00a8847e18 100644 --- a/docs/framework/wcf/samples/internet-information-service-hosting-instructions.md +++ b/docs/framework/wcf/samples/internet-information-service-hosting-instructions.md @@ -6,170 +6,170 @@ ms.assetid: 959a21c8-9d9d-4757-b255-4e57793ae9d6 --- # Internet Information Service Hosting Instructions -To run the samples that are hosted by Internet Information Services (IIS), you must make sure that IIS is properly installed and is running. - -### To install IIS version 7.5 on Windows Server 2008 R2 - -1. From **Server Manager**, select **Roles.** Under **Roles Summary**, click **Add Roles**. - -2. Click **Next** to display the **Select Server Roles** dialog. - -3. Select **Application Server** from the **Roles** list, and then click **Next** twice to display the **Select Role Services** dialog for the Application Server role. - -4. Select the **Web Server (IIS)** check box. If you are prompted to install additional role services and features, click **Add Required Features**. Click **Next** twice to display the **Select Role Services** dialog for the Web Server (IIS) role. - -5. Expand **Management Tools**, and then expand **IIS 6 Management Compatibility**. Select **IIS 6 Scripting Tools**. If you are prompted to install additional role services and features, click **Add Required Role Services**. Click **Next**. - -6. If the summary of selections is correct, click **Install**. - -7. When installation completes, click **Close**. - -### To install IIS version 7.5 on Windows 7 - -1. Click **Start**, and then click **Control Panel**. - -2. Open the **Programs** group. - -3. Under **Programs and Features**, click **Turn Windows Features on or off**. - -4. The **User Account Control** dialog is displayed. Click **Continue**. - -5. The **Windows Features** dialog is displayed. Expand the item labeled **Internet Information Services**. - -6. Expand the item labeled **World Wide Web Services**. - -7. Expand the item labeled **Application Development Features**. - -8. Make sure the following items are selected: - - 1. **.NET Extensibility** - - 2. **ASP.NET** - - 3. **ISAPI Extensions** - - 4. **ISAPI Filters** - -9. Under the item labeled **World Wide Web Services**, expand **Common Http Features**. - -10. Make sure **Static Content** is selected. - -11. Under the item labeled **World Wide Web Services**, expand **Security**. - -12. Make sure that **Windows Authentication** is selected. - -13. Under the **Internet Information Services** directory, expand the item labeled **Web Management Tools**, and then select **IIS Management Console**. - -14. Expand the item labeled **IIS 6 Management Compatibility**, and then select **IIS 6 Scripting Tools**. - -15. Under the **Internet Information Services** directory, expand the item labeled **Microsoft .NET Framework 3.5.1**, and then select **Windows Communication Foundation Http Activation**. - -16. Click **OK**. - -### To install IIS version 7.0 on Windows Server 2008 - -1. From **Server Manager**, select **Roles**. Under **Roles Summary**, click **Add Roles**. - -2. Click **Next** to display the **Select Server Roles** dialog. - -3. Select **Application Server** from the **Roles** list, and then click **Next** twice to display the **Select Role Services** dialog for the Application Server role. - -4. Select **Web Server (IIS)** check box. If you are prompted to install additional role services and features, click **Add Required Features**. Click **Next** twice to display the **Select Role Services** dialog for the Web Server (IIS) role. - -5. Expand **Management Tools**, and then expand **IIS 6 Management Compatibility**. Select **IIS 6 Scripting Tools**. If you are prompted to install additional role services and features, click **Add Required Role Services**. Click **Next**. - -6. If the summary of selections is correct, click **Install**. - -7. When installation completes, click **Close**. - -### To install IIS version 7.0 on Windows Vista - -1. Click Start, and then click Control Panel. - -2. Select the **Programs** group. - -3. Under **Programs and Features**, click **Turn Windows Features on or off**. - -4. The **User Account Control** dialog is displayed. Click **Continue**. - -5. The **Windows Features** dialog is displayed. Expand the item labeled **Internet Information Services**. - -6. Expand the item labeled **World Wide Web Services**. - -7. Expand the item labeled **Application Development Features**. - -8. Make sure the following items are selected: - - 1. **.NET Extensibility** - - 2. **ASP.NET** - - 3. **ISAPI Extensions** - - 4. **ISAPI Filters** - -9. Expand the item labeled **Web Management Tools**, and then select **IIS Management Console**. - -10. Under the item labeled **World Wide Web Services**, expand **Common Http Features**. - -11. Make sure **Static Content** is selected. - -12. Under the item labeled **World Wide Web Services**, expand **Security**. - -13. Make sure **Windows Authentication** is selected. - -14. Expand the item labeled **IIS 6 Management Compatibility**, and then select **IIS 6 Scripting Tools**. - -15. Expand the item labeled **Microsoft .NET Framework 3.0**, and then select **Windows Communication Foundation Http Activation**. - -16. Click **OK**. - -### To install IIS version 6.0 on Windows Server 2003 - -1. From **Manage Your Server**, click **Add or remove a role**, and then click **Next**. - -2. Select **Application server (IIS, ASP.NET)** from the **Server Role** list, and then click **Next**. - -3. Select **Enable ASP.NET** check box, and then click **Next**. - -4. If the summary of selections is correct, click Next. - -### To install IIS version 5.1 on Windows XP with Service Pack 2 and Service Pack 3 installed - -1. In Control Panel, click **Add or Remove Programs**. - -2. In the **Add or Remove Programs** dialog box, click **Add/Remove Windows Components**. - -3. In the **Windows Components Wizard**, select the **Internet Information Services (IIS)** check box, and then click **Next**. - -4. If the **Files Needed** dialog box is displayed, insert your operating system installation disc, browse to the i386 folder, and then click **OK**. - -5. When installation completes, click **Finish**. - -6. Close the **Add or Remove Programs** dialog box, and then close **Control Panel**. - -### To verify the installation of IIS and ASP.NET - -1. Save the HTML file found at the end of this topic in the root \InetPub\wwwroot directory and name it Default.aspx. - -2. Open a browser window. - -3. Type `http://localhost/Default.aspx` in the address box, and then press ENTER. - -4. A Web page with the text "Hello World" should appear. - +To run the samples that are hosted by Internet Information Services (IIS), you must make sure that IIS is properly installed and is running. + +### To install IIS version 7.5 on Windows Server 2008 R2 + +1. From **Server Manager**, select **Roles.** Under **Roles Summary**, click **Add Roles**. + +2. Click **Next** to display the **Select Server Roles** dialog. + +3. Select **Application Server** from the **Roles** list, and then click **Next** twice to display the **Select Role Services** dialog for the Application Server role. + +4. Select the **Web Server (IIS)** check box. If you are prompted to install additional role services and features, click **Add Required Features**. Click **Next** twice to display the **Select Role Services** dialog for the Web Server (IIS) role. + +5. Expand **Management Tools**, and then expand **IIS 6 Management Compatibility**. Select **IIS 6 Scripting Tools**. If you are prompted to install additional role services and features, click **Add Required Role Services**. Click **Next**. + +6. If the summary of selections is correct, click **Install**. + +7. When installation completes, click **Close**. + +### To install IIS version 7.5 on Windows 7 + +1. Click **Start**, and then click **Control Panel**. + +2. Open the **Programs** group. + +3. Under **Programs and Features**, click **Turn Windows Features on or off**. + +4. The **User Account Control** dialog is displayed. Click **Continue**. + +5. The **Windows Features** dialog is displayed. Expand the item labeled **Internet Information Services**. + +6. Expand the item labeled **World Wide Web Services**. + +7. Expand the item labeled **Application Development Features**. + +8. Make sure the following items are selected: + + 1. **.NET Extensibility** + + 2. **ASP.NET** + + 3. **ISAPI Extensions** + + 4. **ISAPI Filters** + +9. Under the item labeled **World Wide Web Services**, expand **Common Http Features**. + +10. Make sure **Static Content** is selected. + +11. Under the item labeled **World Wide Web Services**, expand **Security**. + +12. Make sure that **Windows Authentication** is selected. + +13. Under the **Internet Information Services** directory, expand the item labeled **Web Management Tools**, and then select **IIS Management Console**. + +14. Expand the item labeled **IIS 6 Management Compatibility**, and then select **IIS 6 Scripting Tools**. + +15. Under the **Internet Information Services** directory, expand the item labeled **Microsoft .NET Framework 3.5.1**, and then select **Windows Communication Foundation Http Activation**. + +16. Click **OK**. + +### To install IIS version 7.0 on Windows Server 2008 + +1. From **Server Manager**, select **Roles**. Under **Roles Summary**, click **Add Roles**. + +2. Click **Next** to display the **Select Server Roles** dialog. + +3. Select **Application Server** from the **Roles** list, and then click **Next** twice to display the **Select Role Services** dialog for the Application Server role. + +4. Select **Web Server (IIS)** check box. If you are prompted to install additional role services and features, click **Add Required Features**. Click **Next** twice to display the **Select Role Services** dialog for the Web Server (IIS) role. + +5. Expand **Management Tools**, and then expand **IIS 6 Management Compatibility**. Select **IIS 6 Scripting Tools**. If you are prompted to install additional role services and features, click **Add Required Role Services**. Click **Next**. + +6. If the summary of selections is correct, click **Install**. + +7. When installation completes, click **Close**. + +### To install IIS version 7.0 on Windows Vista + +1. Click Start, and then click Control Panel. + +2. Select the **Programs** group. + +3. Under **Programs and Features**, click **Turn Windows Features on or off**. + +4. The **User Account Control** dialog is displayed. Click **Continue**. + +5. The **Windows Features** dialog is displayed. Expand the item labeled **Internet Information Services**. + +6. Expand the item labeled **World Wide Web Services**. + +7. Expand the item labeled **Application Development Features**. + +8. Make sure the following items are selected: + + 1. **.NET Extensibility** + + 2. **ASP.NET** + + 3. **ISAPI Extensions** + + 4. **ISAPI Filters** + +9. Expand the item labeled **Web Management Tools**, and then select **IIS Management Console**. + +10. Under the item labeled **World Wide Web Services**, expand **Common Http Features**. + +11. Make sure **Static Content** is selected. + +12. Under the item labeled **World Wide Web Services**, expand **Security**. + +13. Make sure **Windows Authentication** is selected. + +14. Expand the item labeled **IIS 6 Management Compatibility**, and then select **IIS 6 Scripting Tools**. + +15. Expand the item labeled **Microsoft .NET Framework 3.0**, and then select **Windows Communication Foundation Http Activation**. + +16. Click **OK**. + +### To install IIS version 6.0 on Windows Server 2003 + +1. From **Manage Your Server**, click **Add or remove a role**, and then click **Next**. + +2. Select **Application server (IIS, ASP.NET)** from the **Server Role** list, and then click **Next**. + +3. Select **Enable ASP.NET** check box, and then click **Next**. + +4. If the summary of selections is correct, click Next. + +### To install IIS version 5.1 on Windows XP with Service Pack 2 and Service Pack 3 installed + +1. In Control Panel, click **Add or Remove Programs**. + +2. In the **Add or Remove Programs** dialog box, click **Add/Remove Windows Components**. + +3. In the **Windows Components Wizard**, select the **Internet Information Services (IIS)** check box, and then click **Next**. + +4. If the **Files Needed** dialog box is displayed, insert your operating system installation disc, browse to the i386 folder, and then click **OK**. + +5. When installation completes, click **Finish**. + +6. Close the **Add or Remove Programs** dialog box, and then close **Control Panel**. + +### To verify the installation of IIS and ASP.NET + +1. Save the HTML file found at the end of this topic in the root \InetPub\wwwroot directory and name it Default.aspx. + +2. Open a browser window. + +3. Type `http://localhost/Default.aspx` in the address box, and then press ENTER. + +4. A Web page with the text "Hello World" should appear. + > [!NOTE] -> Each time you install a new version of the .NET Framework, you must re-register aspnet_isapi as a Web service extension for IIS. To do so, issue the `aspnet_regiis –I –enable` command. - -## Sample Code - -```xml - - -
-

Hello World -

-
- - +> Each time you install a new version of the .NET Framework, you must re-register aspnet_isapi as a Web service extension for IIS. To do so, issue the `aspnet_regiis -I -enable` command. + +## Sample Code + +```xml + + +
+

Hello World +

+
+ + ``` diff --git a/docs/framework/wcf/samples/one-time-setup-procedure-for-the-wcf-samples.md b/docs/framework/wcf/samples/one-time-setup-procedure-for-the-wcf-samples.md index 1c37d2daeae42..dfb70c84576d7 100644 --- a/docs/framework/wcf/samples/one-time-setup-procedure-for-the-wcf-samples.md +++ b/docs/framework/wcf/samples/one-time-setup-procedure-for-the-wcf-samples.md @@ -29,12 +29,12 @@ The **ServiceModelSamples** virtual directory is used for building and running a > If IIS is reinstalled, the following commands will need to be run again. ```console - "%WINDIR%\Microsoft.Net\Framework\v4.0.30319\aspnet_regiis" –i –enable + "%WINDIR%\Microsoft.Net\Framework\v4.0.30319\aspnet_regiis" -i -enable "%WINDIR%\Microsoft.Net\Framework\v4.0.30319\ServiceModelReg.exe" -r ``` > [!WARNING] - > Running the command `aspnet_regiis –i –enable` will make the Default App Pool run using .NET Framework 4, which may produce incompatibility issues for other applications on the same computer. + > Running the command `aspnet_regiis -i -enable` will make the Default App Pool run using .NET Framework 4, which may produce incompatibility issues for other applications on the same computer. 5. Follow the [Firewall Instructions](firewall-instructions.md) for enabling the ports used by the samples. diff --git a/docs/framework/wcf/servicemodelreg-exe.md b/docs/framework/wcf/servicemodelreg-exe.md index dfe804a79bdbe..8e73e1f067852 100644 --- a/docs/framework/wcf/servicemodelreg-exe.md +++ b/docs/framework/wcf/servicemodelreg-exe.md @@ -6,76 +6,76 @@ ms.topic: reference --- # ServiceModel Registration Tool (ServiceModelReg.exe) -This command-line tool provides the ability to manage the registration of WCF and WF components on a single machine. Under normal circumstances you should not need to use this tool as WCF and WF components are configured when installed. But if you are experiencing problems with service activation, you can try to register the components using this tool. - -## Syntax - -```console -ServiceModelReg.exe[(-ia|-ua|-r)|((-i|-u) -c:)] [-v|-q] [-nologo] [-?] -``` - -## Remarks - - The tool can be found in the following location: - - %SystemRoot%\Microsoft.Net\Framework\v3.0\Windows Communication Foundation\ - +This command-line tool provides the ability to manage the registration of WCF and WF components on a single machine. Under normal circumstances you should not need to use this tool as WCF and WF components are configured when installed. But if you are experiencing problems with service activation, you can try to register the components using this tool. + +## Syntax + +```console +ServiceModelReg.exe[(-ia|-ua|-r)|((-i|-u) -c:)] [-v|-q] [-nologo] [-?] +``` + +## Remarks + + The tool can be found in the following location: + + %SystemRoot%\Microsoft.Net\Framework\v3.0\Windows Communication Foundation\ + > [!NOTE] -> When the ServiceModel Registration Tool is run on Windows Vista, the **Windows Features** dialog may not reflect that the **Windows Communication Foundation HTTP Activation** option under **Microsoft .NET Framework 3.0** is turned on. The **Windows Features** dialog can be accessed by clicking **Start**, then click **Run** and then typing **OptionalFeatures**. - - The following tables describe the options that can be used with ServiceModelReg.exe. - -|Option|Description| -|------------|-----------------| -|`-ia`|Installs all WCF and WF components.| -|`-ua`|Uninstalls all WCF and WF components.| -|`-r`|Repairs all WCF and WF components.| -|`-i`|Installs WCF and WF components specified with –c.| -|`-u`|Uninstalls WCF and WF components specified with –c.| -|`-c`|Installs or uninstalls a component:

- httpnamespace – HTTP Namespace Reservation
- tcpportsharing – TCP port sharing service
- tcpactivation – TCP activation service (unsupported on .NET 4 Client Profile)
- namedpipeactivation – Named pipe activation service (unsupported on .NET 4 Client Profile
- msmqactivation – MSMQ activation service (unsupported on .NET 4 Client Profile
- etw – ETW event tracing manifests (Windows Vista or later)| -|`-q`|Quiet mode (only display error logging)| -|`-v`|Verbose mode.| -|`-nologo`|Suppresses the copyright and banner message.| -|`-?`|Displays help text| - -## Fixing the FileLoadException Error - - If you installed previous versions of WCF on your machine, you may get a `FileLoadFoundException` error when you run the ServiceModelReg tool to register a new installation. This can happen even if you have manually removed files from the previous install, but left the machine.config settings intact. - - The error message is similar to the following. - -```console -Error: System.IO.FileLoadException: Could not load file or assembly 'System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) -File name: 'System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' -``` - - You should note from the error message that the System.ServiceModel Version 2.0.0.0 assembly was installed by an early Customer Technology Preview (CTP) release. The current version of the System.ServiceModel assembly released is 3.0.0.0 instead. Therefore, this issue is encountered when you want to install the official WCF release on a machine where an early CTP release of WCF was installed, but not completely uninstalled. - - ServiceModelReg.exe cannot clean up prior version entries, nor can it register the new version's entries. The only workaround is to manually edit machine.config. You can locate this file at the following location. - -```console +> When the ServiceModel Registration Tool is run on Windows Vista, the **Windows Features** dialog may not reflect that the **Windows Communication Foundation HTTP Activation** option under **Microsoft .NET Framework 3.0** is turned on. The **Windows Features** dialog can be accessed by clicking **Start**, then click **Run** and then typing **OptionalFeatures**. + + The following tables describe the options that can be used with ServiceModelReg.exe. + +|Option|Description| +|------------|-----------------| +|`-ia`|Installs all WCF and WF components.| +|`-ua`|Uninstalls all WCF and WF components.| +|`-r`|Repairs all WCF and WF components.| +|`-i`|Installs WCF and WF components specified with -c.| +|`-u`|Uninstalls WCF and WF components specified with -c.| +|`-c`|Installs or uninstalls a component:

- httpnamespace – HTTP Namespace Reservation
- tcpportsharing – TCP port sharing service
- tcpactivation – TCP activation service (unsupported on .NET 4 Client Profile)
- namedpipeactivation – Named pipe activation service (unsupported on .NET 4 Client Profile
- msmqactivation – MSMQ activation service (unsupported on .NET 4 Client Profile
- etw – ETW event tracing manifests (Windows Vista or later)| +|`-q`|Quiet mode (only display error logging)| +|`-v`|Verbose mode.| +|`-nologo`|Suppresses the copyright and banner message.| +|`-?`|Displays help text| + +## Fixing the FileLoadException Error + + If you installed previous versions of WCF on your machine, you may get a `FileLoadFoundException` error when you run the ServiceModelReg tool to register a new installation. This can happen even if you have manually removed files from the previous install, but left the machine.config settings intact. + + The error message is similar to the following. + +```console +Error: System.IO.FileLoadException: Could not load file or assembly 'System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) +File name: 'System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' +``` + + You should note from the error message that the System.ServiceModel Version 2.0.0.0 assembly was installed by an early Customer Technology Preview (CTP) release. The current version of the System.ServiceModel assembly released is 3.0.0.0 instead. Therefore, this issue is encountered when you want to install the official WCF release on a machine where an early CTP release of WCF was installed, but not completely uninstalled. + + ServiceModelReg.exe cannot clean up prior version entries, nor can it register the new version's entries. The only workaround is to manually edit machine.config. You can locate this file at the following location. + +```console %windir%\Microsoft.NET\Framework\v2.0.50727\config\machine.config -``` - - If you are running WCF on a 64-bit machine, you should also edit the same file at this location. - -```console +``` + + If you are running WCF on a 64-bit machine, you should also edit the same file at this location. + +```console %windir%\Microsoft.NET\Framework64\v2.0.50727\config\machine.config -``` - - Locate any XML nodes in this file that refer to "System.ServiceModel, Version=2.0.0.0", delete them and any child nodes. Save the file and re-run ServiceModelReg.exe resolves this problem. - -## Examples - - The following examples show how to use the most common options of the ServiceModelReg.exe tool. - -```console -ServiceModelReg.exe -ia - Installs all components -ServiceModelReg.exe -i -c:httpnamespace -c:etw - Installs HTTP namespace reservation and ETW manifests -ServiceModelReg.exe -u -c:etw - Uninstalls ETW manifests -ServiceModelReg.exe -r - Repairs an extended install +``` + + Locate any XML nodes in this file that refer to "System.ServiceModel, Version=2.0.0.0", delete them and any child nodes. Save the file and re-run ServiceModelReg.exe resolves this problem. + +## Examples + + The following examples show how to use the most common options of the ServiceModelReg.exe tool. + +```console +ServiceModelReg.exe -ia + Installs all components +ServiceModelReg.exe -i -c:httpnamespace -c:etw + Installs HTTP namespace reservation and ETW manifests +ServiceModelReg.exe -u -c:etw + Uninstalls ETW manifests +ServiceModelReg.exe -r + Repairs an extended install ``` diff --git a/docs/framework/wcf/wcf-service-publishing.md b/docs/framework/wcf/wcf-service-publishing.md index 80fb5f4030bcb..ab75ce5ad06df 100644 --- a/docs/framework/wcf/wcf-service-publishing.md +++ b/docs/framework/wcf/wcf-service-publishing.md @@ -1,6 +1,6 @@ --- title: "WCF Service Publishing" -description: WCF Service Publishing helps you deploy your application to a production environment for testing purposes. +description: WCF Service Publishing helps you deploy your application to a production environment for testing purposes. ms.date: "03/30/2017" ms.assetid: c806b253-cd47-4b96-b831-e73cbf08808f --- @@ -42,7 +42,7 @@ Perform the following steps to deploy a service implementation: You can use **Publish** to specify if you want to copy the assembly, configuration, and .svc file for all services defined in the project to the target location, and overwrite existing files at the destination. -If you choose to deploy your application to local IIS, you may encounter errors related to IIS setup. Please ensure that IIS is installed properly. You can enter `http://localhost` in your browser's address bar and check whether the IIS default page displays. In some cases, the issues may also be caused by improper registration of ASP.NET or WCF in IIS. You can open the Developer Command Prompt for Visual Studio and run the command `aspnet_regiis.exe -ir` to fix ASP.NET registration issues, or run command `ServiceModelReg.exe –ia` to fix WCF registration issues. +If you choose to deploy your application to local IIS, you may encounter errors related to IIS setup. Please ensure that IIS is installed properly. You can enter `http://localhost` in your browser's address bar and check whether the IIS default page displays. In some cases, the issues may also be caused by improper registration of ASP.NET or WCF in IIS. You can open the Developer Command Prompt for Visual Studio and run the command `aspnet_regiis.exe -ir` to fix ASP.NET registration issues, or run command `ServiceModelReg.exe -ia` to fix WCF registration issues. ## Files Generated for Publishing diff --git a/docs/framework/windows-workflow-foundation/samples/fault-handling-in-a-flowchart-activity-using-trycatch.md b/docs/framework/windows-workflow-foundation/samples/fault-handling-in-a-flowchart-activity-using-trycatch.md index b841dac487803..222cb7292e582 100644 --- a/docs/framework/windows-workflow-foundation/samples/fault-handling-in-a-flowchart-activity-using-trycatch.md +++ b/docs/framework/windows-workflow-foundation/samples/fault-handling-in-a-flowchart-activity-using-trycatch.md @@ -23,7 +23,7 @@ The `CreateFlowchartWithFaults` activity uses a . So, the discount calculation is wrapped in a activity that catches the exception and sets the discount to zero.| +|MWK|15 + (1 - 1/`numberOfKids`)\*10 **Note:** Potentially, this calculation can throw a . So, the discount calculation is wrapped in a activity that catches the exception and sets the discount to zero.| ## To use this sample diff --git a/docs/framework/windows-workflow-foundation/workflow-tracing.md b/docs/framework/windows-workflow-foundation/workflow-tracing.md index cca49d9b6b358..0f43b045337b0 100644 --- a/docs/framework/windows-workflow-foundation/workflow-tracing.md +++ b/docs/framework/windows-workflow-foundation/workflow-tracing.md @@ -6,67 +6,67 @@ ms.assetid: 18737989-0502-4367-b5f6-617ebfb77c96 --- # Workflow Tracing -Workflow tracing offers a way to capture diagnostic information using .NET Framework trace listeners. Tracing can be enabled if a problem is detected with the application and then disabled again once the problem is resolved. There are two ways you could enable debug tracing for workflows. You can configure it using the Event Trace viewer or you can use to send trace events to a file. - -## Enabling Debug Tracing in ETW - - To enable tracing using ETW, enable the Debug channel in Event Viewer: - -1. Navigate to analytic and debug logs node in Event Viewer. - -2. In the tree view in Event Viewer, navigate to **Event Viewer->Applications and Services Logs->Microsoft->Windows->Application Server-Applications**. Right-click **Application Server-Applications** and select **View->Show Analytic and Debug Logs**. Right-click **Debug** and select **Enable Log**. - -3. When a workflow runs the debug and traces are emitted to ETW debug channel, they can be viewed in the Event Viewer. Navigate to **Event Viewer->Applications and Services Logs->Microsoft->Windows->Application Server-Applications**. Right-click **Debug** and select **Refresh**. - -4. The default analytic trace buffer size is only 4 kilobytes (KB); it is recommended to increase the size to 32 KB. To do this, perform the following steps. - - 1. Execute the following command in the current framework directory (for example, C:\Windows\Microsoft.NET\Framework\v4.0.21203): `wevtutil um Microsoft.Windows.ApplicationServer.Applications.man` - - 2. Change the \ value in the Windows.ApplicationServer.Applications.man file to 32. - - ```xml - - - 32 - - - ``` - - 3. Execute the following command in the current framework directory (for example, C:\Windows\Microsoft.NET\Framework\v4.0.21203): `wevtutil im Microsoft.Windows.ApplicationServer.Applications.man` - +Workflow tracing offers a way to capture diagnostic information using .NET Framework trace listeners. Tracing can be enabled if a problem is detected with the application and then disabled again once the problem is resolved. There are two ways you could enable debug tracing for workflows. You can configure it using the Event Trace viewer or you can use to send trace events to a file. + +## Enabling Debug Tracing in ETW + + To enable tracing using ETW, enable the Debug channel in Event Viewer: + +1. Navigate to analytic and debug logs node in Event Viewer. + +2. In the tree view in Event Viewer, navigate to **Event Viewer->Applications and Services Logs->Microsoft->Windows->Application Server-Applications**. Right-click **Application Server-Applications** and select **View->Show Analytic and Debug Logs**. Right-click **Debug** and select **Enable Log**. + +3. When a workflow runs the debug and traces are emitted to ETW debug channel, they can be viewed in the Event Viewer. Navigate to **Event Viewer->Applications and Services Logs->Microsoft->Windows->Application Server-Applications**. Right-click **Debug** and select **Refresh**. + +4. The default analytic trace buffer size is only 4 kilobytes (KB); it is recommended to increase the size to 32 KB. To do this, perform the following steps. + + 1. Execute the following command in the current framework directory (for example, C:\Windows\Microsoft.NET\Framework\v4.0.21203): `wevtutil um Microsoft.Windows.ApplicationServer.Applications.man` + + 2. Change the \ value in the Windows.ApplicationServer.Applications.man file to 32. + + ```xml + + + 32 + + + ``` + + 3. Execute the following command in the current framework directory (for example, C:\Windows\Microsoft.NET\Framework\v4.0.21203): `wevtutil im Microsoft.Windows.ApplicationServer.Applications.man` + > [!NOTE] -> If you are using the .NET Framework 4 Client Profile, you must first register the ETW manifest by running the following command from the .NET Framework 4 directory: `ServiceModelReg.exe –i –c:etw` - -## Enabling Debug Tracing using System.Diagnostics - - These listeners can be configured in the App.config file of the workflow application, or the Web.config for a workflow service. In this example, a is configured to save tracing information to the MyTraceLog.txt file in the current directory. - -```xml - - - - - - - - - - - - - - - - - - - - -``` - +> If you are using the .NET Framework 4 Client Profile, you must first register the ETW manifest by running the following command from the .NET Framework 4 directory: `ServiceModelReg.exe -i -c:etw` + +## Enabling Debug Tracing using System.Diagnostics + + These listeners can be configured in the App.config file of the workflow application, or the Web.config for a workflow service. In this example, a is configured to save tracing information to the MyTraceLog.txt file in the current directory. + +```xml + + + + + + + + + + + + + + + + + + + + +``` + ## See also - [Windows Server App Fabric Monitoring](/previous-versions/appfabric/ee677251(v=azure.10))