Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Article https://msdn.microsoft.com/en-us/library/9dd8z24x(VS.80).aspx describes how to switch off optimization for a .NET assembly by creating an initialization (.ini) file.
For example, if you want to switch off optimization for MyApp.exe, you need to create a file called MyApp.exe in the same folder as the application, with the following content:
[.NET Framework Debugging Control]
GenerateTrackingInfo=1
AllowOptimize=0
If you need to switch off optimization for many files (if - for example - you're debugging Exchange) you can use the following Powershell script:
$path = get-location
$files = get-Childitem $path -recurse -include *.exe,*.dll
$content = "[.NET Framework Debugging Control]`r`nGenerateTrackingInfo=1`r`nAllowOptimize=0"
$countforeach ($file in $files)
{
$count++
write-host ("{0:000#}" -f $count) " Found " $file.fullnameif ($file.fullname.contains(".exe"))
{
$t = ($file.fullname -replace(".exe", "")) + ".ini"
}
if ($file.fullname.contains(".dll"))
{
$t = ($file.fullname -replace(".dll", "")) + ".ini"
}$fileExists = Test-Path $t
if ($fileExists -eq $false)
{
write-host " ==> created new ini"
out-file -filePath $t -inputobject $content
}
else
{
write-host " ==> ini does already exist"
# remove-item $t
}
}
It will create ini-files for all DLLs and EXEs in the folder from which the script is started and all of it's subfolders.
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in