I keep forgetting this… Open the MMC (Start > Run… > then type “mmc”).
Then add the Active Directory Users and Computers snap-in (File > Add/Remove Snap-in…) . Take it from there.
I keep forgetting this… Open the MMC (Start > Run… > then type “mmc”).
Then add the Active Directory Users and Computers snap-in (File > Add/Remove Snap-in…) . Take it from there.
A few notes on an issue I have been experiencing. I had the following C# code that constantly threw a timeout error on line 5:
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://api-verify.recaptcha.net/verify"); request.Method = "POST"; request.ContentType = "application/x-www-form-urlencoded"; using (Stream stream = request.GetRequestStream()) { using (StreamWriter streamWriter = new StreamWriter(stream, Encoding.ASCII)) { streamWriter.Write(postData); streamWriter.Close(); } stream.Close(); }
Running ipconfig gives you nice information like your default gateway.
Running tracert for api-verify.recaptcha.net showed a hop to the default gateway (the first entry in the list of results) and nothing but timeouts thereafter.
A gateway is a routing device that knows how to pass traffic between different subnets and networks. It will know some routes to given IP addresses but not the routes to every address on the Internet. A gateway will will know the addresses of other gateways it can hand the traffic off to if the required route is unknown to it. A default gateway will be on the same subnet and is the gateway to be relied on when it doesn't know how to route traffic.
In this case, wrong default gateway?
When setting up an existing .NET application on a fresh machine you may see the following error:
"Could not load file or assembly 'Some.Assembly.Name' or one of its dependencies. Access is denied."
A potential quick solution is to go to “C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files” and modify the security settings for the folder to grant "Full control" to the 'users' group.
Not ideal but it will get the development environment up-and-running.
When opening a source file in Visual Studio, if you want the solution explorer to reflect the location of the file ensure the appropriate option is set:
Tools > Options > Projects & Solutions > General
Set the Track Active Items in Solution Explorer option.
Alternatively if you’ve got ReSharper use Ctrl-Shift-T.
ViewState includes a Message Authentication Code (MAC). The MAC is generated using a validation key on the server. When the form is posted back the server compares the MAC in the ViewState with one regenerated on the server. If they differ the ViewState is regarded as invalid.
The value of the MAC can change when:
Note that the validation key may be different on different servers in a farm. You must take steps to ensure the validation keys match across machines. Validation keys can be different across application pools. Validation keys can change if the application pool restarts (e.g. if the key is set to AutoGenerate).
To avoid MAC mismatches:
See http://www.developmentnow.com/blog/InvalidViewstate+Or+Unable+To+Validate+Data+Error.aspx for a detailed overview.
Similar issues can affect web resources accessed via webresource.axd. Requests to web resources will include a ‘d’ parameter (decryption key?). As such it is subject to the same issues with the key changing as above. This key will be an encrypted version of the web resource identifier used to retrieve the resource from the appropriate assembly.
One way in which web resources can be used is in Ajax or other JavaScript enabled web controls by adding the [WebResource] attribute to reference JavaScript files stored as resources. When the control is rendered on the page a reference to the script file will be generated as a request to webresource.axd.
Also be aware of ScriptResource.axd (which contains all of the client-side JavaScript for Ajax) in web.config files.
Problems with web resources etc can give rise to the “Padding is invalid and cannot be removed” errors.
See http://msdn.microsoft.com/en-us/library/system.web.ui.webresourceattribute.aspx and http://msdn.microsoft.com/en-us/library/system.web.handlers.scriptresourcehandler.aspx.
Run the following command to export all scheduled tasks to CSV format:
schtasks /query /FO CSV /V > c:\output.csv
This can then be opened with Excel. Alternatively, to make a copy/backup of all the scheduled tasks on a machine right-click on the %systemroot%\Tasks folder and copy it. Paste it where you want.
To force SQL Server to rebuild its execution plans for a particular database run the following SQL:
DECLARE @intDBID INTEGER SET @intDBID =
(SELECT dbid FROM master.dbo.sysdatabases WHERE name = 'DatabaseNameHere') DBCC FLUSHPROCINDB (@intDBID)
To rebuild execution plans for all databases run the following SQL:
DBCC FREEPROCCACHE
You can see the execution plans for a procedure by using the SET command:
USE [DatabaseNameHere] GO SET SHOWPLAN_ALL OFF GO EXEC [WidgetQueries_RecentlyAddedContent] 0 GO
You can also force a recompilation for a specific procedure or trigger using sp_recompile stored procedure:
sp_recompile [ @objname = ] 'object'
There are many other options. Check the documentation for details.