tag:blogger.com,1999:blog-6860976869880440072024-03-05T02:01:01.264-05:00quinn johnsQuinn Johnshttp://www.blogger.com/profile/05845326588167426006noreply@blogger.comBlogger48125tag:blogger.com,1999:blog-686097686988044007.post-59739926862347056722017-10-09T13:04:00.000-04:002017-10-09T13:09:36.639-04:00Dynatrace - .NET Trending / Leak Analysis Memory Snapshot<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
If you use Dynatrace, please be aware that if you are using option of ".NET Trending/Leak-Analysis Memory Snapshot" option to "Always On". (System Profile > Agent Group > Agent Mapping > Advanced), to analyze memory leaks in .NET, this may result in higher response times, elevated CPU usage on your web servers and/or higher times spent in garbage collection.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhH1Lb3_i2nkrVcPHXETvUA0-QQ16gX6-rF-FzaTxByud_UW05RKRhzlnJ_WWT3sHhP2z0Ocqns7TmrmSj0niQc-5h3S0dSsL7NjwCsM37sMTuQCvi2N558SQkY0sEBYWsJ1XaCqTFfSbaM/s1600/NETLeakAnalysis.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="77" data-original-width="420" height="58" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhH1Lb3_i2nkrVcPHXETvUA0-QQ16gX6-rF-FzaTxByud_UW05RKRhzlnJ_WWT3sHhP2z0Ocqns7TmrmSj0niQc-5h3S0dSsL7NjwCsM37sMTuQCvi2N558SQkY0sEBYWsJ1XaCqTFfSbaM/s320/NETLeakAnalysis.png" width="320" /></a></div>
<br />
These changes to time spent in garbage collection can be observed from the PurePath breakdown(s).</div>
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeHV1eEmpxThv9Txqb6Sq2Xu4WlgAEgV7a_r6dcM2a8UZ9Mpw8ut5z9NMs-JMfZvxQn8hfZ43oCYWohwWygvPqu2dhqkxtp2feYOnXZ7OlPAMoxcZOq_nqK7PtcJ3XS5fx9-_fH6FEnpH6/s1600/suspension_breakdown.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="395" data-original-width="432" height="292" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeHV1eEmpxThv9Txqb6Sq2Xu4WlgAEgV7a_r6dcM2a8UZ9Mpw8ut5z9NMs-JMfZvxQn8hfZ43oCYWohwWygvPqu2dhqkxtp2feYOnXZ7OlPAMoxcZOq_nqK7PtcJ3XS5fx9-_fH6FEnpH6/s320/suspension_breakdown.png" width="320" /></a></div>
<br />
<br />
When not in use, please set to "Automatic" (Preferred) or "Always Off" to limit the performance impact to your web servers.
</div>
Quinn Johnshttp://www.blogger.com/profile/05845326588167426006noreply@blogger.com0tag:blogger.com,1999:blog-686097686988044007.post-19679645852449385332017-04-20T11:38:00.000-04:002017-04-20T23:04:50.466-04:00ASP.NET MVC - Disabling Browser Link<div dir="ltr" style="text-align: left;" trbidi="on">
You may be experiencing unexpected errors and performance impacts as a result of a capability added within Visual Studio 2013, titled Browser Link. The intent of Browser Link, was to allow the IDE to (bi-directional) communicate with the
browsers (using SignalR), and allow for refreshing multiple browsers at once ("via Refreshing Linked Browsers").
<br />
<br />
In the circumstance that you are experiencing the following issues,
<br />
<ul>
<li>The web application / scripts being loaded, are taking extensive periods of time to load, as a result of javascript / jQuery errors being returned to the client.
</li>
<li>The CPU usage between IIS Worker Process (W3WP) is increasing outside normal bounds.
</li>
<li>HTML markup contains garbage tags, as a result of the HttpModule associated with Browser Link.
</li>
</ul>
You can <b>disable</b> the Browser Link capability, by either using Visual Studio settings, or by disabling in the web configuration.
<br />
<br />
<b>Visual Studio [<a href="https://docs.microsoft.com/en-us/aspnet/visual-studio/overview/2013/using-browser-link">source</a>]</b>
<br />
In the Browser Link dropdown menu, <b>uncheck</b> Enable Browser Link.<br />
<br />
<div class="separator" style="clear: both; text-align: left;">
<a href="https://docs.microsoft.com/en-us/aspnet/visual-studio/overview/2013/using-browser-link/_static/image1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://docs.microsoft.com/en-us/aspnet/visual-studio/overview/2013/using-browser-link/_static/image1.png" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<b>Web Configuration</b>
<br />
In the Web.config file, add a key named "vs:EnableBrowserLink" with the value "false" in the appSettings section (<b>preferred</b>),
<br />
<pre class="brush:xml"><appsettings>
<add key="vs:EnableBrowserLink" value="false">
</add></appsettings>
</pre>
or you can set "debug" to "false", in the compilation tag.
<br />
<pre class="brush:xml">
<system .web="">
<compilation debug="false" targetframework="4.5">
</compilation></system>
</pre>
</div>
Quinn Johnshttp://www.blogger.com/profile/05845326588167426006noreply@blogger.com0tag:blogger.com,1999:blog-686097686988044007.post-11567543111187701482015-09-01T21:37:00.001-04:002015-09-01T21:37:30.109-04:00C# / SQL - Performing Distributed Transactions<div dir="ltr" style="text-align: left;" trbidi="on">
Distributed Transactions span across multiple processes, which when encapsulated by the distributed transaction manager, will either commit a successful transaction or rollback changes. Distributed Transactions have been available within .NET, since .NET Framework 2.0. The Default Isolation level is set to <b>Serializable</b>, which in usage, creates unnecessary blocking and deadlocks. Therefore, it is suggested you override the default isolation level to ReadCommitted, which reflects the default within SQL Server.
<br/>
<pre class="brush:csharp">
/// <summary>
/// This class is responsible for performing Distributed Transactions.
/// </summary>
public class DistributedTransactionUtility
{
/// <summary>
/// The Distributed Transaction method which creates a Transaction Scope object
/// and commits if there is no error and rollbacks, incase of exception.
/// </summary>
/// <param name="method" />
/// The method which performs multiple DB Transactions.
///
public void DoDistributedTransaction(Action method)
{
// Initializes Transaction Scope
using (var transactionScope =
new TransactionScope(TransactionScopeOption.Required,
new TransactionOptions {
// Default (Isolation Level) : Serializable - Introduces Severe Blocking and Deadlocks
// instead use ReadCommitted - Default Transaction Scope for SQL Server.
IsolationLevel = IsolationLevel.ReadCommitted,
Timeout = TransactionManager.DefaultTimeout
}))
{
try
{
// Invokes the Method
method();
// Commits the Transaction
transactionScope.Complete()
}
finally
{
// Irrespective of success or exception scenario, Transaction Scope must
// be disposed explicitly. Dispose method ends the transaction and clears
// any data related to it and also clears the scope object.
transactionScope.Dispose();
}
}
}
}
</pre>
Invoked using:
<br />
<pre class="brush:csharp">
new DistributedTransactionUtility().DoDistributedTransaction(() =>
{
// Multiple - SQL Helper - Methods (ExecuteNonQuery/ExecuteDataset Transactions)
}
</pre>
<br />
Configuration:<br />
<br />
<ol>
<li>Click Start, click Run, type DCOMCNFG and then click OK to open Component Services.</li>
<li>In the console tree, click to expand Component Services, click to expand Computers, click to expand My Computer, click to expand Distributed Transaction Coordinator and then click Local DTC.</li>
<li>Right click Local DTC and click Properties to display the Local DTC Properties dialog box.</li>
<li>Click the Security tab.</li>
<li>Select Security tab of the Local DTC Properties dialog box.</li>
<li>Select Network DTC access checkbox.</li>
<li>In Transaction Manager Communication section check Allow Inbound, Allow Outbound and Mutual Authentication Required options.</li>
<li>Click OK and restart your application.</li>
</ol>
</div>Quinn Johnshttp://www.blogger.com/profile/05845326588167426006noreply@blogger.com0tag:blogger.com,1999:blog-686097686988044007.post-11900145033296460832015-08-08T22:42:00.003-04:002015-09-01T21:05:26.086-04:00ASP.NET MVC / IIS - Optimizing Web Application Performance<div dir="ltr" style="text-align: left;" trbidi="on">
Optimizing your web sites in ASP.NET MVC for performance includes cache busting, enabling caching for static resources, enabling gzip compression.
To enable caching on static resources, you will need to add the following XML in your web configuration file in the system .webserver element. The control max age parameter determines the length of time to cache the static resources.
<br />
<pre class="brush:xml">
<system.webServer>
...
<staticcontent>
...
<!— Cache Static Resources (CSS, IMG, JS) for 365 Days —>
<clientCache cacheControlMode="UseMaxAge”
cacheControlMaxAge="365.00:00:00" />
</staticcontent>
</system.webServer>
</pre>
In an effort to compress dynamically generated content (ASP, PHP, ASP.NET) and static files (PDF, JPEG, etc.), you can enable the following settings within your application web configuration. As you use <<a href="http://msdn.microsoft.com/en-us/library/aa347437%28v=vs.90%29.aspx" target="_blank">urlCompression</a>> to define what is compressed, you can use <<a href="http://msdn.microsoft.com/en-us/library/ms690689%28v=vs.90%29.aspx" target="_blank">httpCompression</a>> to define how it is compressed.
<pre class="brush:xml">
<system.webServer>
<!— Utilize GZIP HTTP Compression —>
<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" staticCompressionLevel="9" />
<dynamicTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/x-javascript" enabled="true" />
<add mimeType="application/json" enabled="true" />
<add mimeType="*/*" enabled="false" />
</dynamicTypes>
<staticTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/x-javascript" enabled="true" />
<add mimeType="application/atom+xml" enabled="true" />
<add mimeType="application/xaml+xml" enabled="true" />
<add mimeType="*/*" enabled="false" />
</staticTypes>
</httpCompression>
…
<!— Utilize GZIP Url Compression —>
<urlCompression doStaticCompression="true" doDynamicCompression="true" />
</system.webServer>
</pre>
Utilizing Cache Busting can be done to ensure users do not need to clear their browser cache (temporary internet files, etc.) to see changes. Enabling this within the BundleConfig, script and style bundles, when bundles are rendered, will include version numbers.
You will want to ensure the following module is added within the web configuration.
<pre class="brush:xml"><modules>
<remove name="BundleModule">
<add name="BundleModule" type="System.Web.Optimization.BundleModule">
</add></remove></modules>
</pre>
Within your BundleConfig.cs file, you will need to utilize:
<pre class="brush:csharp">BundleTable.EnableOptimizations = true;
</pre>
</div>Quinn Johnshttp://www.blogger.com/profile/05845326588167426006noreply@blogger.com0tag:blogger.com,1999:blog-686097686988044007.post-32172281830363379492015-04-22T21:38:00.001-04:002015-04-22T21:40:02.934-04:00ASP.NET MVC - Using CDNs (Content Delivery Network)<div dir="ltr" style="text-align: left;" trbidi="on">
By utilizing content delivery networks (CDN)s, you will potentially receive several benefits including improved performance, gains from using different domains, pre-cached files, high-capacity infrastructure and distributed data centers. A CDN can distribute the load, save bandwidth, and boost performance. As individual users request static resources such as javascript and stylesheets, browsers limit the number of concurrent connections (or file downloads) to a single domain at a given time, thus allowing users to download additional requests. Additionally, many CDNs provide localized data centers which are closer to the user, and faster to download. For example, if you are browsing your application's site in San Francisco and need to download the javascript or stylesheets, assuming the CDN has a datacenter in California, it would utilize that location to download the file opposed to making the round trip to your local servers (e.g. could be hosted across the country). In terms of pre-caching, if the CDN has been used on a previous site, it is likely the browser used by the individual won't need to re-download the files again.<br />
<br />
<b>Approach</b><br />
<br />
In the Bundle Registration (BundleConfig), you will need to enable the use of CDNs. This can be performed by adding the following property on the BundleCollection, at the beginning of the RegisterBundles method. For simplicity, you can set this value to true, but could potentially drive this from the web configuration files.<br />
<br />
<pre class="brush:csharp">// Location: BundleConfig.cs
public static void RegisterBundles(BundleCollection bundles)
{
// Enable CDN Support
bundles.UseCdn = true;
...
}
</pre>
Once completed, you will need to add the respective CDNs and their local environment fallbacks, within the RegisterBundles method. You should add CDNs for all of the frameworks that have sustainable CDNs, such as jQuery, Bootstrap, Foundation, Kendo, etc. You could host your local files on an internal CDN to your organization, but it would depend on if there is available and hosted infrastructure.<br />
<br />
<pre class="brush:csharp">// Location: BundleConfig.cs
public static void RegisterBundles(BundleCollection bundles)
{
// Enable CDN Support
bundles.UseCdn = true;
...
// jQuery Bundles
const string JqueryCdnPath = "http://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.1.0.min.js";
bundles.Add(new ScriptBundle("~/bundles/jquery", JqueryCdnPath)
.Include("~/Scripts/jquery/jquery-{version}.js"));
...
// Cache Busting / Optimizations Enabled
BundleTable.EnableOptimizations = true;
}
</pre>
With the respective additions of the CDNs, you may need to separate some current bundles, and add to the main layout appropriately.
</div>
Quinn Johnshttp://www.blogger.com/profile/05845326588167426006noreply@blogger.com0tag:blogger.com,1999:blog-686097686988044007.post-18085203601322980662015-04-22T21:12:00.000-04:002015-04-22T21:12:50.553-04:00SharePoint - Moving Sites and Subsites into another Site<div dir="ltr" style="text-align: left;" trbidi="on">
If there is a need to move sites and subsites into another site within the same web application, this can be easily performed using the "Site Manager". Often times, this option is over-looked, in favor of site templates, or other backup and restore operations. However, this is the simplest option available.<br />
<br />
<span style="color: #999999;">Note: This site is available on "SharePoint Online or Office 365 Dedicated" as well as any stand-alone SharePoint installation, on the basis that you activate the Publishing Features within SharePoint.</span><br />
<br />
If you visit "http://enter_your_site_url/_layouts/sitemanager.aspx", you'll see the Site Manager, where you can do a <b>move</b> operation of all pages and sub-sites.<br />
<br />
<ol>
<li>Select the parent site of the sub-site you want to move in the left navigation pane.
</li>
<li>Check the box next to the sub-site you want to move in the right pane.
</li>
<li>Click the <b>Actions</b> drop-down and click <b>Move</b>.
</li>
<li>Select <b>Destination</b> of the sub-site selected in the next dialog.
</li>
</ol>
<a href="http://sharepoint.stackexchange.com/a/54547/9345"><span style="font-size: x-small;">SharePoint Stack Exchange</span></a></div>
Quinn Johnshttp://www.blogger.com/profile/05845326588167426006noreply@blogger.com0tag:blogger.com,1999:blog-686097686988044007.post-34410569782323656922015-04-22T20:57:00.000-04:002015-04-22T20:59:46.073-04:00SharePoint - Feature with ID already exists - Force Option<div dir="ltr" style="text-align: left;" trbidi="on">
Occasionally, when deploying SharePoint Solutions (WSP) directly from Visual Studio, you will receive the following error.<br />
<br />
<span style="color: red; font-family: Courier New, Courier, monospace; font-size: x-small;">Error occurred in deployment step 'Add Solution': A feature with ID {Guid} has already been installed in this farm. Use the force attribute to explicitly re-install the feature.</span><br />
<br />
This error occurs when you have a previously defined feature installed, as part of the same solution, which will trigger the error. To overcome this issue, you can open the feature (double-click) which is part of your actual project, and you will see the properties window come into focus. In this window, you will see details, such as title, description, scope, items in the feature. In the property window, you'll see an option titled 'Always Force Install'. By default, this item is set to "false". If you set this option to "true", it will over-write the feature each time the project is installed.<br />
<br />
<a href="http://sharepoint.stackexchange.com/a/61289/9345" target="_blank"><span style="font-size: x-small;">SharePoint Stack Exchange</span></a></div>
Quinn Johnshttp://www.blogger.com/profile/05845326588167426006noreply@blogger.com0tag:blogger.com,1999:blog-686097686988044007.post-27185471918660101742015-03-31T23:44:00.002-04:002015-03-31T23:52:36.811-04:00C# - Performance Counters<div dir="ltr" style="text-align: left;" trbidi="on">
Reading performance counters (in C#) require the use of the <a href="https://msdn.microsoft.com/en-us/library/system.diagnostics.performancecounter.aspx" target="_blank">PerformanceCounter</a> class to read existing predefined or custom counters. The PerformanceCounter class is included in the System.Diagnostic namespace, and provides accessibility to several counters.<br />
<br />
The most common counters include Processor, Memory, and Network Utilization.<br />
<br />
<pre class="brush:csharp">// CPU Processor Time (in %)
PerformanceCounter cpuCounter =
new PerformanceCounter("Processor", "% Processor Time", "_Total");
Console.WriteLine("Current CPU: {0}", cpuCounter.NextValue() +"%");
// Memory Available (in MB)
PerformanceCounter ramCounter =
new PerformanceCounter("Memory", "Available MBytes", string.Empty);
Console.WriteLine("RAM Available: {0}", ramCounter.NextValue()+"MB");
// Network Utilization (in Bytes/Sec)
PerformanceCounterCategory category =
new PerformanceCounterCategory("Network Interface");
String[] instanceName = category.GetInstanceNames();
foreach (string ns in instanceName)
{
PerformanceCounter netSentCounter =
new PerformanceCounter("Network Interface", "Bytes Received/sec", ns);
PerformanceCounter netRecCounter =
new PerformanceCounter("Network Interface", "Bytes Sent/sec", ns);
Console.WriteLine("Network Interface: {0}", ns);
Console.WriteLine("Network Usage (Sent): {0}",
netSentCounter.NextValue()+" Bytes/s");
Console.WriteLine("Network Usage (Received): {0}",
netRecCounter.NextValue()+" Bytes/s");
}
</pre>
</div>
Quinn Johnshttp://www.blogger.com/profile/05845326588167426006noreply@blogger.com0tag:blogger.com,1999:blog-686097686988044007.post-60129673268945485672015-03-08T15:40:00.000-04:002015-03-08T20:38:53.289-04:00SharePoint - An unexpected error has occurred. (Web Part Page Maintenance)<div dir="ltr" style="text-align: left;" trbidi="on">
On occasion, a web part may be causing your SharePoint pages to throw an unexpected error.<br />
<br />
<span style="color: red; font-family: Courier New, Courier, monospace; font-size: x-small;">An unexpected error has occurred. Web Parts Maintenance Page: If you have permission, you can use this page to temporarily close Web Parts or remove personal settings. For more information, contact your site administrator. Troubleshoot issues with Microsoft SharePoint Foundation.</span><br />
<br />
In addition to leveraging the <a href="https://sharepointlogviewer.codeplex.com/" target="_blank">ULS Logs</a>, to investigate the Correlation ID, you can append "<i>?contents=1</i>" to your page URL. This will allow you to close web parts, restore defaults to web parts, or delete web parts from your page.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFiL3d52DGywNNbIRidRlo_hBZ6AJbboKEj7X5a2viqU3kZSiEU74tG0Xi51Q_l26Mr2B7lon1HKgBGwG8zuggptBu9KHsGuCdTAqnpvP9CPGBjJ3lPPlGA0wHByDJb66EhWv-7uJTiN_7/s1600/bMSQl.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFiL3d52DGywNNbIRidRlo_hBZ6AJbboKEj7X5a2viqU3kZSiEU74tG0Xi51Q_l26Mr2B7lon1HKgBGwG8zuggptBu9KHsGuCdTAqnpvP9CPGBjJ3lPPlGA0wHByDJb66EhWv-7uJTiN_7/s1600/bMSQl.png" height="162" width="320" /></a></div>
<br /></div>
Quinn Johnshttp://www.blogger.com/profile/05845326588167426006noreply@blogger.com0tag:blogger.com,1999:blog-686097686988044007.post-11889120953811604512015-02-22T22:43:00.001-05:002015-02-22T22:57:06.151-05:00IIS / ASP.NET - Disabling Compatibility Mode/View (Internet Explorer)In ASP.NET, if you need to disable compatibility view of the end users using your application, you can override the respective browser (Internet Explorer) compatibility mode, by setting the compatibility mode to Edge. By using this setting, the users of the web application, will render using the latest rendering engine available. If in the scenario you don't want to use the latest, you can also define other standards, such as IE8, IE9, etc.<br/>
<br/>
This can be defined in the master page/view using the following meta tag within the <head> section:
<pre class="brush:xml">
<!DOCTYPE html>
<head>
...
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
</head>
</pre>
Note: The <i>X-UA-Compatible</i> meta tag will need to be the first meta tag, in the circumstance that setting the IE rendering engine to Edge, is not working as intended.<br/>
<br/>
and web.config, by adding a custom header using <i>X-UA-Compatible</i> to the response headers,<br/>
<pre class="brush:xml">
<system.webServer>
<httpProtocol>
<customHeaders>
...
<add name="X-UA-Compatible" value="IE=Edge" />
</customHeaders>
</httpProtocol>
</system.webServer>
</pre>Quinn Johnshttp://www.blogger.com/profile/05845326588167426006noreply@blogger.com0tag:blogger.com,1999:blog-686097686988044007.post-47482129664447984792015-02-22T14:16:00.001-05:002015-02-22T14:41:18.944-05:00IIS / ASP.NET - Run all Managed Modules for All Requests (RAMMFAR)When initially creating an ASP.NET web application, RunAllManagedModulesForAllRequest is enabled by default. If enabled, every request that passes through the ASP.NET pipeline, is treated as a managed modules (or handlers). When all modules are managed, including static content, there are possible performance implications. If you are utilizing a distributed cache provider, such as App Fabric, an implication includes that all managed resources, including static content are passed to the distributed cache (as managed resources), which adds a level of overhead, even if not required. The solution to optimizing your web application, is to disable runAllManagedModulesForAllRequests (RAMMFAR), and add defined locations for your static resources within your web configuration file. The static resources can include but are not limited to CSS, Images, and Scripts.<br/><br/>
Firstly, you will want to add location segments for each file/folder location, within the configuration element.<br/>
<pre class="brush:xml">
<configuration>
...
<!-- START - STATIC RESOURCE LOCATIONS -->
<!-- Content : CSS and Images -->
<location path="Content">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<!-- Scripts : JavaScript -->
<location path="Scripts">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
...
<!-- END - STATIC RESOURCE LOCATIONS -->
</pre>
Once completed, you will see the following section, under system.webServer.<br/>
<pre class="brush:xml">
<system.webServer>
<validation validateIntegratedModeConfiguration="false"></validation>
<modules runAllManagedModulesForAllRequests="true"></modules>
</system.webServer>
</pre>
You will need to change the value of runAllManagedModulesForAllRequests to <i>false</i>. Also, if you were to stop here, you would potentially get errors from utilizing Bundles within your project, failing upon a Script Render. You will need to ensure you properly add the BundleModule to remediate the errors.
<pre class="brush:xml">
<system.webServer>
<validation validateIntegratedModeConfiguration="false"></validation>
<modules runAllManagedModulesForAllRequests="false">
<!-- START - MANAGED MODULES - BUNDLES -->
<remove name="BundleModule">
</remove>
<add name="BundleModule"
type="System.Web.Optimization.BundleModule">
</add>
<!-- END - MANAGED MODULES - BUNDLES -->
...
</modules>
</system.webServer>
</pre>
Note: In some scenarios, there may be other bundles, that reference static resources that aren't directly accessible in your project. In this scenario, the respective bundle/handler may need to be added to the system.webServer section, similar to the BundleModule. One example, is MiniProfiler, which has resources located at /mini-profiler-resources.
<pre class="brush:xml">
<system.webServer>
...
<handlers>
<add name="MiniProfiler" path="mini-profiler-resources/*" verb="*"
type="System.Web.Routing.UrlRoutingModule"
resourceType="Unspecified"
preCondition="integratedMode">
</add>
</handlers>
</system.webServer>
</pre>Quinn Johnshttp://www.blogger.com/profile/05845326588167426006noreply@blogger.com0tag:blogger.com,1999:blog-686097686988044007.post-88065446086332791432013-03-01T17:40:00.000-05:002015-02-21T15:33:50.711-05:00SharePoint – The current operation could not be completed. Try again, or contact your system administrator.
If attempting to utilize Site Manager, to COPY an entire site or any particular pages, and receive the following error.<br />
<blockquote>
The current operation could not be completed. Try again, or contact your system administrator.
You may re-try the operation, and you may need to clean up the half-created data first before re-trying. If the problem persists, please contact your system administrator.</blockquote>
If you review the logs, and the following is displayed,<br />
<br />
<span style="color: red; font-family: Courier New, Courier, monospace; font-size: x-small;">System.ArgumentException (0×80070057)</span><br />
<span style="color: red; font-family: Courier New, Courier, monospace; font-size: x-small;">Microsoft.SharePoint.Library.SPRequestInternalClass.GetMetadataForUrl(String bstrUrl, Int32 METADATAFLAGS, Guid& pgListId, Int32& plItemId, Int32& plType, Object& pvarFileOrFolder) at
Microsoft.SharePoint.Library.SPRequest.GetMetadataForUrl(String bstrUrl, Int32 METADATAFLAGS, Guid& pgListId, Int32& plItemId, Int32& plType, Object& pvarFileOrFolder) at
Microsoft.SharePoint.SPWeb.GetFileOrFolderObject(String strUrl) at
Microsoft.SharePoint.Publishing.CommonUtilities.GetFileFromUrl(String url, SPWeb web) at
Microsoft.SharePoint.Publishing.PublishingPage.get_Layout() at
Microsoft.SharePoint.Publishing.Internal.DeploymentWrapper.cachePageInfoForXmlFiltering(PublishingPage publishingPage) at
Microsoft.Office.Server.Utilities.ContentIterator.ProcessItem(SPListItem item, Boolean fIncludeFolderItems, MonitoredScopeWrapper monitoredScopeWrapper, ItemProcessor itemProcessor, ItemProcessorErrorCallout errorCallout) at
Microsoft.Office.Server.Utilities.ContentIterator.ProcessItems(SPListItemCollection items, Boolean fIncludeFolderItems, Boolean fIterateInReverseOrder, MonitoredScopeWrapper monitoredScopeWrapper, ItemProcessor itemProcessor, ItemProcessorErrorCallout errorCallout) at
Microsoft.Office.Server.Utilities.ContentIterator.<>c__DisplayClassc.<ProcessListItems>b__9(SPListItemCollection items) at Microsoft.Office.Server.Utilities.ContentIterator.ProcessListItems(SPList list, SPQuery query, ItemsProcessor itemsProcessor, ItemsProcessorErrorCallout errorCallout) at
Microsoft.Office.Server.Utilities.ContentIterator.ProcessListItems(SPList list, String strQuery, UInt32 rowLimit, Boolean fRecursive, SPFolder folder, ItemsProcessor itemsProcessor, ItemsProcessorErrorCallout errorCallout) at
Microsoft.Office.Server.Utilities.ContentIterator.ProcessListItems(SPList list, Boolean fIterateInReverseOrder, ItemProcessor itemProcessor, ItemProcessorErrorCallout errorCallout) at
Microsoft.Office.Server.Utilities.ContentIterator.ProcessListItems(SPList list, ItemProcessor itemProcessor, ItemProcessorErrorCallout errorCallout) at
Microsoft.SharePoint.Publishing.PublishingWeb.IterateOverAllPages(ProcessPublishingPage callToProcessPublishingPage) at
Microsoft.SharePoint.Publishing.Internal.DeploymentWrapper.configureExportCopyOrMove(String[] sourceSmtObjectIds, SPExportSettings& exportSettings, SPIncludeVersions versionsToInclude) at
Microsoft.SharePoint.Publishing.Internal.DeploymentWrapper.Copy(String[] sourceSmtObjectIds, String destSmtObjectId) at
Microsoft.SharePoint.Publishing.Internal.WebControls.CopyObjects.Copy() at
Microsoft.SharePoint.Publishing.Internal.WebControls.CopyObjects.DoWork() at
Microsoft.Office.Server.Diagnostics.FirstChanceHandler.ExceptionFilter(Boolean fRethrowException, TryBlock tryBlock, FilterBlock filter, CatchBlock catchBlock, FinallyBlock finallyBlock</span><br />
<br />
You’ll want to check the pages contained in the page library, and download and view them in a text editor. Once completed, you will want to make sure the PublishingPageLayout is correctly matching your source web application, and when it’s corrected, re-upload the pages and you’ll be able to perform the copy operation.<br />
<pre class="brush:xml"><mso:publishingpagelayout msdt:dt="string">
</mso:publishingpagelayout>
</pre>Quinn Johnshttp://www.blogger.com/profile/05845326588167426006noreply@blogger.com0tag:blogger.com,1999:blog-686097686988044007.post-38967151476833771382013-03-01T17:36:00.000-05:002015-02-21T15:35:12.181-05:00SharePoint – Web Service Requests in InfoPath Forms (Classic to Claims)<div dir="ltr" style="text-align: left;" trbidi="on">
Without writing code, you can populate User Profile Service (UPS) information into your fields in InfoPath forms. This process is clearly defined in the following <a href="http://blogs.microsoft.co.il/blogs/itaysk/archive/2007/04/05/InfoPath-_2D00_-Get-the-current-user-without-writing-code.aspx" target="_blank" title="blog">blog</a>. However, as this works perfectly, in the classic-based authentication there are several modifications that will need to be made, to fully utilize the forms, as a result of product limitations caused by Claims-based authentication.
<br />
<br />
Firstly, a Secure Store ID will need to be created in Central Administration (Manage Service Applications), you’ll need to assign the Target Application ID, and add the Target Application Administrators which would ideally need to be a generic ID that never expires, and the members that are mapped to the credentials defined. You’d need to then set the credentials on that domain account for the secure store target application. Lastly, under Central Administration (General Application Settings), and InfoPath Forms Services, the option to ‘Allow user form templates to use authentication information contained in data connection files’ is selected.<br />
<br />
To re-mediate any issues with the data connections previously created while in classic (that utilize web services), you will need to download the previously created data connections from their respective data connection libraries, and open them using any text editor. You’ll notice that the UDCX files, are purely XML. Modify the XML, such that the following information is included. What this allows, is for impersonation to allow the user accounts accessing this form, to be able to get the correct data from the web services.<br />
<pre class="brush:xml"><udc:authentication>
<udc:sso appid="TheApplicationID" credentialtype="NTLM">
</udc:sso></udc:authentication>
</pre>
Once this change is made, simply re-upload and publish your data connection file, into the data connection library associated with your InfoPath Form Library. Once you complete this action then re-open your InfoPath Form template. If you were providing information on a button press, form load, or form submit operation, you’d simply modify your existing actions to include the following details. You would need to add another action to set a field’s value, and when the dialog appears, select the drill-down beside the field textbox.<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgwfufjq2BcNt3ztIzQ3Pap4HOFhne3Iar-KNDeygD3UdE5rRPDxym89r4bNNxM_XQADmC48ir1pNQbGgZiMnPJMG9nsp2prsfVFhi8Nd4V0ceGxSqjPvX5zA7TXb_aWVJJTuFCUfzk0U7/s1600/RuleDetail.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgwfufjq2BcNt3ztIzQ3Pap4HOFhne3Iar-KNDeygD3UdE5rRPDxym89r4bNNxM_XQADmC48ir1pNQbGgZiMnPJMG9nsp2prsfVFhi8Nd4V0ceGxSqjPvX5zA7TXb_aWVJJTuFCUfzk0U7/s1600/RuleDetail.jpg" height="195" width="320" /></a></div>
<br />
Within the next dialog, click the drop-down and select your respective web service. In the image below, the data connection was named GetUserProfileByName, and you will need to select the field <strong>AccountName</strong> and press <strong>OK</strong>.
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjz-iTZftLM3eQhIlLsRMIY5WCIIUBoUl1UYP-FFJXyi2ri6DB91ocw9DfioHJzTiJrOrgUsZrknmTIGZrMO3ECNWRGkd-hiSY8aqpjszSq4fQzNxPtS8Fg9ykRSQQ-G_niEiL0eqaZl_d_/s1600/AccountName.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjz-iTZftLM3eQhIlLsRMIY5WCIIUBoUl1UYP-FFJXyi2ri6DB91ocw9DfioHJzTiJrOrgUsZrknmTIGZrMO3ECNWRGkd-hiSY8aqpjszSq4fQzNxPtS8Fg9ykRSQQ-G_niEiL0eqaZl_d_/s1600/AccountName.jpg" height="320" width="278" /></a></div>
<br />
and in the value field, simply enter <strong>userName()</strong>, or add it by the function entry under Users.<br />
<br />
Lastly, you’ll need to perform a <strong>query using a data connection</strong> action, utilizing the data connection associated with the web service request. These two major items need to be before your other field-based actions as it’ll then associate the requests with your ID, and populate your information correctly.<br />
<br />
Below is a sample image, which illustrates what the actions should look like, in the correct order, to acquire the First Name of the user. These field values for the individual user profile service attributes, is listed in the blog article talked about above.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgm1GeJeEhUIbqadzwVmXBa-vCXQ0YAHLw57YbXkBR9vF2ixKIvKNHkWsDGhu2HRpNyTTmD4z7CK33myswNefsERchWbGKCRFjI5a6kDbhV9eU1FWkc0xXx-_xyr4K_8VTLnHeRIveRhx0z/s1600/UpdateForm.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgm1GeJeEhUIbqadzwVmXBa-vCXQ0YAHLw57YbXkBR9vF2ixKIvKNHkWsDGhu2HRpNyTTmD4z7CK33myswNefsERchWbGKCRFjI5a6kDbhV9eU1FWkc0xXx-_xyr4K_8VTLnHeRIveRhx0z/s1600/UpdateForm.png" height="83" width="320" /></a></div>
<br /></div>
Quinn Johnshttp://www.blogger.com/profile/05845326588167426006noreply@blogger.com0tag:blogger.com,1999:blog-686097686988044007.post-11321968050134989412013-02-26T17:30:00.000-05:002015-02-21T15:36:08.335-05:00SQL – Locked in Single-User Mode<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="background-color: white; color: #222222; font-family: Arial, Helvetica, Tahoma; font-size: 14px; line-height: 21.59375px;">If you ever want to see what sessions are active in SQL, or if you ever perform a SharePoint Backup through Central Administration, and SQL Server goes into single-user mode and does not remove that state – the following SQL query will return all active user sessions, by ID.</span><br /><br />
<pre class="brush: sql; title: ; notranslate" style="background-color: #eeeeee; border: 0px; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 0.9em; line-height: 21.59375px; margin-left: 1px; margin-right: 1px; outline: 0px; overflow: auto; padding: 3px 8px; vertical-align: baseline;" title="">select d.name, d.dbid, spid, login_time, nt_domain, nt_username, loginame
from sysprocesses p inner join sysdatabases d on p.dbid = d.dbid
where d.name = 'db_name'
GO
</pre>
<div style="background-color: white; border: 0px; color: #222222; font-family: Arial, Helvetica, Tahoma; font-size: 14px; line-height: 21.59375px; margin-bottom: 15px; margin-top: 5px; outline: 0px; padding: 0px; vertical-align: baseline;">
Once you get this ID, you can just manually kill the session, to the ID, and then disable single-user mode in the respective tables, etc.</div>
</div>
Quinn Johnshttp://www.blogger.com/profile/05845326588167426006noreply@blogger.com0tag:blogger.com,1999:blog-686097686988044007.post-30977522942365690822012-11-09T09:29:00.000-05:002015-02-22T11:13:33.067-05:00SharePoint 2010 - Remove / Disable ThemesIf you've ever encountered the need the disable themes on a site collection, there are a few options you may have available.<br/><br/>
Firstly, there are policies in Central Administration to remove the ability to change the themes across the entire web application, which can be done by the following:
<ol>
<li>Visit Central Administration > Application Management > Web Applications > Manage Web Applications.</li>
<li>Select the Web Application that you want to restrict the themes on.</li>
<li>Click on "Permission Policy Level" on the Ribbon.</li>
<li>Name the policy, and find the permission "Apply Themes and Borders" and toggle the "Deny" check box.</li>
<li>Click save.</li>
<li>Click on "User Policy" on the Ribbon.</li>
<li>Add the users and groups you want to restrict, and then apply the policy you just created.</li>
</ol>
<br/>
Alternatively, if you want to manually remove the themes, you can update the theme entries, in a file called:
<br/>
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Template\Layouts\1033\SPTHEME.XML<br/><br/>There, you can remove all themes with the exception of default - the sections you would want to delete are the <templates> nodes. Noted, I take no responsibility for any issues caused by this method. I would expect you to make a backup of this file.<br/><br/>
If you can't do either of the above options, and utilizing a managed environment. You could take a third approach, which involves removing the available themes, resetting your themes to default, and disabling the 'Enhanced Theming' hidden feature. You can remove all the managed themes, via the following code in a site-scoped feature receiver, on feature activation.</div>
<!-- code formatted by http://manoli.net/csharpformat/ -->
<br />
<pre class="brush:csharp">if (properties != null)
{
using (SPSite _SPSite = properties.Feature.Parent as SPSite)
{
using (SPWeb web = _SPSite.RootWeb)
{
ReadOnlyCollection ManagedThemes = null;
ManagedThemes = ThmxTheme.GetManagedThemes(web.Site);
SPFile file = null;
foreach (ThmxTheme themes in ManagedThemes)
{
file = web.GetFile(themes.ServerRelativeUrl);
file.Delete();
}
}
}
}
</pre>
and then also disabled the following feature through feature stapling,<br/>
<!-- code formatted by http://manoli.net/csharpformat/ -->
<br />
<pre class="brush:csharp">'Enhanced Theming' - GUID: 068bc832-4951-11dc-8314-0800200c9a66
</pre>
Also, to reset your theme, in some site scoped feature stapler, you could also reset the theme to default.</div>
<!-- code formatted by http://manoli.net/csharpformat/ -->
<pre class="brush:csharp">ThmxTheme.RemoveThemeFromWeb(_SPWeb, false);
</pre>
Quinn Johnshttp://www.blogger.com/profile/05845326588167426006noreply@blogger.com0tag:blogger.com,1999:blog-686097686988044007.post-38475260359380112042012-09-27T17:32:00.001-04:002015-02-21T15:47:12.750-05:00SharePoint 2010 - Cannot access the local farm.<div dir="ltr" style="text-align: left;" trbidi="on">
<strong>Issue:</strong><br />
<br />
If you're encountering the following error, when trying to run a powershell script, you may not have sufficient permissions on the database.<br />
<br />
<span style="color: red; font-family: Courier New, Courier, monospace; font-size: x-small;">Get-SPWeb : Cannot access the local farm. Verify that the local farm is properly configured, currently available, and that you have the appropriate permission to access the database before trying again.</span><br />
<br />
The issue can be remedied with a few quick powershell commands.<br />
<br />
<strong>Workaround:</strong><br />
<br />
Perform the following script in the SharePoint Management Shell, as a farm administrator and it will remove the error.<br />
<pre class="brush:powershell">Get-SPDatabase | Add-SPShellAdmin SomeDomain\SomeUserName
</pre>
This will grant the user both access to the configuration database as well as the content database. Alternatively, you can revoke that granted access with the opposite command.
<br />
<pre class="brush:powershell">Get-SPDatabase | Remove-SPShellAdmin SomeDomain\SomeUserName
</pre>
</div>
Quinn Johnshttp://www.blogger.com/profile/05845326588167426006noreply@blogger.com1tag:blogger.com,1999:blog-686097686988044007.post-60312250820209321212012-09-27T17:18:00.002-04:002015-02-21T17:03:41.916-05:00SharePoint 2010 - The site is not valid. The 'Pages' document library is missing<div dir="ltr" style="text-align: left;" trbidi="on">
<strong>Issue:</strong><br />
<br />
If you're encountering the following error, via ULS, or the event log, due to a page library,<br />
<br />
<span style="color: red; font-family: Courier New, Courier, monospace; font-size: x-small;">This site is not valid. The 'Pages' document library is missing.</span><br />
<br />
The issue can be remedied with a quick powershell script.
<br />
<br />
<strong>Workaround:</strong>
<br />
<br />
Perform the following script on the page library causing the issue, and it will remove the error.
<!-- code formatted by http://manoli.net/csharpformat/ -->
<br />
<pre class="brush:powershell">$web = get-spweb http://somesite/somesubsite
$pageId = $web.Lists["Pages"].ID
$web.AllProperties["__PagesListId"] = $pageId.ToString()
$web.Update()
</pre>
</div>
Quinn Johnshttp://www.blogger.com/profile/05845326588167426006noreply@blogger.com0tag:blogger.com,1999:blog-686097686988044007.post-79416779601876360942012-08-16T17:13:00.000-04:002015-02-21T17:00:05.519-05:00SharePoint 2010 - Improving Chrome SupportCertainly, if you've utilized Google Chrome to browse SharePoint 2010 pages you've noticed the inflexible behavior caused by the on-demand javascript. You almost always have to refresh to ensure that the javascript functionality works - Modal Dialogs, Ribbon, etc.<br /><br />With some minor updates to the master page, you should be able to utilize Google Chrome without any problems.<br /><br />Firstly, you'll want to add some additional items in the <head> tag.<br /><br />
<pre class="brush:javascript"><sharepoint:scriptlink id="ScriptLink1" loadafterui="true" localizable="false" name="SP.js" ondemand="false" runat="server">
<sharepoint:scriptlink id="ScriptLink2" loadafterui="true" localizable="false" name="SP.UI.Dialog.js" ondemand="false" runat="server">
</sharepoint:scriptlink></sharepoint:scriptlink></pre><br />Afterwards, at the bottom of your page just above the closing </body>, add the following javascript.<br /><br />
<pre class="brush:javascript">
// Attempt to detect if this is iframe content
if (location.href == top.location.href) {
if(navigator && navigator.userAgent &&
/chrome/.test(navigator.userAgent.toLowerCase()) && $){
$(document).ready(function(){
if(_spBodyOnLoadWrapper){_spBodyOnLoadWrapper();}
if($("#s4-workspace") && $("#s4-ribbonrow")) {
$("#s4-workspace").height($(window).height() -
$("#s4-ribbonrow").height());
}
});
}
}
</pre><br />That's all it should take and your ribbon and modal dialogs should be responsive.<br />
<br />Javascript, taken from <a href="http://social.msdn.microsoft.com/Forums/br/sharepoint2010general/thread/94b89c35-5136-4fc5-86d6-9f8524325e55">http://social.msdn.microsoft.com/Forums/br/sharepoint2010general/thread/94b89c35-5136-4fc5-86d6-9f8524325e55</a>Quinn Johnshttp://www.blogger.com/profile/05845326588167426006noreply@blogger.com0tag:blogger.com,1999:blog-686097686988044007.post-31137251565973969332012-07-07T12:18:00.000-04:002015-02-21T16:59:17.837-05:00SharePoint 2010 - MySite RedirectionWhen user's click a user's name in a document library, etc, a file userdisp.aspx controls where the user is directed. Assuming you want to have all user links bring users to My Sites, you can start off creating the user control, by the following code on <a href="http://blogs.sharepointguys.com/brendon/sharepoint-2007/programming/redirect-to-your-own-mysite-landing-page/">http://blogs.sharepointguys.com/brendon/sharepoint-2007/programming/redirect-to-your-own-mysite-landing-page/</a> and then in the RedirectIfNecessary(SPListItem user) you can utilize the following code.<br />
<br />
<pre class="brush:csharp">if (Request.QueryString["id"] != null)
{
SPSite _site = SPContext.Current.Site;
SPServiceContext _serviceContext = SPServiceContext.GetContext(_site);
UserProfileManager _userProfileManager =
new UserProfileManager(_serviceContext);
string _mySiteUrl = _userProfileManager.MySiteHostUrl;
string _profileUrl = string.Empty;
int userID = 0;
if (int.TryParse(Request.QueryString["id"].ToString(), out userID))
{
SPUser profileUser = SPContext.Current.Web.SiteUsers.GetByID(userID);
if (_userProfileManager.UserExists(profileUser.LoginName))
{
UserProfile _userProfile =
_userProfileManager.GetUserProfile(profileUser.LoginName);
_profileUrl = _userProfile.PublicUrl.AbsoluteUri;
}
else
{
_profileUrl = String.Format("{0}Person.aspx?accountname={1}",
_mySiteUrl, profileUser.LoginName);
}
SPUtility.Redirect(_profileUrl, SPRedirectFlags.Static, this.Context);
}
}
</pre>Quinn Johnshttp://www.blogger.com/profile/05845326588167426006noreply@blogger.com0tag:blogger.com,1999:blog-686097686988044007.post-691122786389376812012-06-22T13:30:00.003-04:002015-02-21T16:58:37.823-05:00SharePoint 2010 - Current Variation / Variation LabelsIf you're trying to develop a web part, which utilizes the variation title and doing so by accessing the variation labels lists in SharePoint 2010 and experiencing problems, give this function a try. I've written it to compare the accessible locales against that of the current web LCID.<br />
<pre class="brush:csharp">
public static string GetCurrentWebRegionLabel()
{
string strLabel = "USEN";
SPSecurity.RunWithElevatedPrivileges(
delegate()
{
ReadOnlyCollection<VariationLabel> _variations =
Variations.Current.UserAccessibleLabels;
strLabel = _variations.FirstOrDefault(m =>
m.Locale.Equals(SPContext.Current.Web.Locale.LCID.ToString()))
.Title.ToString();
});
return strLabel;
}
</pre>
Quinn Johnshttp://www.blogger.com/profile/05845326588167426006noreply@blogger.com0tag:blogger.com,1999:blog-686097686988044007.post-39270385604434530882012-05-23T09:54:00.000-04:002015-02-21T16:57:19.681-05:00SharePoint 2010 - Document Library (checked out documents not visible to anyone)<b>Issue </b><br /><br />
When trying to remove folders in a document library, it appears that no files exist in the folder, yet you receive an error saying the files have not been checked in.<br /><br />
<b>Workaround</b><br /><br />
Go to the Document Library Settings, select Manage files which have no checked in version, then select Take Ownership of Selection. This will allow you to check in the files that were missing, and remove that folder.Quinn Johnshttp://www.blogger.com/profile/05845326588167426006noreply@blogger.com0tag:blogger.com,1999:blog-686097686988044007.post-63050693288051874952012-05-22T15:30:00.000-04:002015-02-21T16:56:02.150-05:00SharePoint 2010 / jQuery - Swapping Images<div dir="ltr" style="text-align: left;" trbidi="on">
Web part uploaded and forgot to include the image in the feature? This could be a potential issue on a managed SharePoint 2010 environment (Office 365 - Dedicated, etc.). The reference points to a path in the _layouts folder. How can I temporarily resolve this issue until I update the project?<br />
<br />
Simple. Modify the master page or add a content editor web part with the following jQuery, and store the image into a location that is easily accessible.<br />
<pre class="brush:js">
jQuery(function()
{
jQuery('img[src="/_layouts/images/old-image.png"]')
.attr("src", "/subsite/PublishingImages/new-image.gif");
});
</pre>
</div>
Quinn Johnshttp://www.blogger.com/profile/05845326588167426006noreply@blogger.com0tag:blogger.com,1999:blog-686097686988044007.post-35893450780866972422012-05-15T14:50:00.001-04:002015-02-21T12:05:09.478-05:00SharePoint 2010 - Changing User SessionsEver get into a situation where you need to use a test user account to log in and test something? Generally, you will use the "Log in as different user" option and can not change back without terminating the entire user session and close out your entire browser.<br/><br/>
At any time, you can log in with whatever user account by manually entering the following, enter your domain and subsites and then "/_layouts/accessdenied.aspx?loginasanotheruser=true".<br/><br/>
For example, "http://www.yourdomain.com/subsite/_layouts/accessdenied.aspx?loginasanotheruser=true".Quinn Johnshttp://www.blogger.com/profile/05845326588167426006noreply@blogger.com0tag:blogger.com,1999:blog-686097686988044007.post-62192092104989150492012-05-15T14:43:00.000-04:002015-02-21T12:08:52.087-05:00SharePoint 2010 / Debug - Locating Active SharePoint Process (W3WP.exe)Often times you may be looking at debugging SharePoint custom code and need to attach the debugger to a process. The process list may list several instances of W3WP.exe. To locate which instance you are particularly using, you can go to the command prompt and run "%systemroot%\system32\inetsrv\appcmd list wps".<br/><br/>
The following cmdlet loops to allow me to quickly refresh the net services list, which is useful after an IIS reset.
<pre class="brush:shell">
:loop
cls
%systemroot%\system32\inetsrv\appcmd list wps
pause
goto loop
</pre>Quinn Johnshttp://www.blogger.com/profile/05845326588167426006noreply@blogger.com0tag:blogger.com,1999:blog-686097686988044007.post-69642845536092849772012-04-23T16:06:00.000-04:002015-02-21T13:00:35.854-05:00SharePoint 2010 - This item is no longer available.<div dir="ltr" style="text-align: left;" trbidi="on">
<strong>Issue:</strong><br />
<br />
On some library views when you drop down the edit control block (ECB) you will see the following error.<br />
<br />
<span style="color: red; font-family: 'Courier New', Courier, monospace; font-size: x-small;">This item is no longer available. It may have been deleted by another user. Click 'OK' to refresh the page.</span><br />
<br />
To resolve this issue it is necessary to re-create the library view.<br />
<br />
<strong>Workaround:</strong><br />
<br />
On the library with the view issue, go to "Library Settings" and scroll to the bottom of the page. Click on "Create View," choose to start the view from an existing view, be sure to select "Make this the default view." Choose to create the new view from the view that is having the issue. (e.g. Versions).<br />
<br />
When creating your new library view, choose any name you please. If you are replacing the default view, be sure to select "Make this the default view." Be sure to make it a public view and keep all other settings to duplicate the other view, and click "OK".</div>
Quinn Johnshttp://www.blogger.com/profile/05845326588167426006noreply@blogger.com0