<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Code Retard &#187; C#</title>
	<atom:link href="http://www.coderetard.com/category/c-sharp/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.coderetard.com</link>
	<description>Anything Geeky Goes!</description>
	<lastBuildDate>Sun, 14 Mar 2010 16:17:22 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>SharePoint: Deep Diving with Cross Forest, Multi Forest Configuration and Additional Info</title>
		<link>http://www.coderetard.com/2009/01/22/sharepoint-deep-diving-with-cross-forest-multi-forest-configuration-and-additional-info/</link>
		<comments>http://www.coderetard.com/2009/01/22/sharepoint-deep-diving-with-cross-forest-multi-forest-configuration-and-additional-info/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 18:00:14 +0000</pubDate>
		<dc:creator>Son Riku</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[c# microsoft]]></category>
		<category><![CDATA[Cannot connect to SQL Server. pssql1.ext.jpl.net\PartnerSpace not found. Additional error information from SQL Server is included below.]]></category>
		<category><![CDATA[Command line error.]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[Multi Forest Configuration and Additional Info]]></category>
		<category><![CDATA[people picker]]></category>
		<category><![CDATA[peoplepicker]]></category>
		<category><![CDATA[SharePoint: Deep Diving with Cross Forest]]></category>
		<category><![CDATA[Verify]]></category>

		<guid isPermaLink="false">http://www.coderetard.com/?p=3519</guid>
		<description><![CDATA[
		
		
		
		Deep Diving with Cross Forest, Multi Forest Configuration and Additional Info
From Joel Oleson&#8217;s Blog URL: http://blogs.msdn.com/joelo/archive/2007/03/08/cross-forest-multi-forest-configuration-additional-info.aspx:

Background
The people picker works in cross domain or cross forest environment. It works in both-way trust and one-way trust environment.
Out of the box, if the admin does not do any configuration, the people picker will issue queries to all two-way [...]


Related Posts:<ol><li><a href='http://www.coderetard.com/2009/01/09/sharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation/' rel='bookmark' title='Permanent Link: SharePoint Search Web Service Error: Attempted to perform an unauthorized operation'>SharePoint Search Web Service Error: Attempted to perform an unauthorized operation</a></li>
<li><a href='http://www.coderetard.com/2008/12/24/sharepoint-error-and-resolution-sharepoint-failed-to-connect-to-the-configuration-database/' rel='bookmark' title='Permanent Link: SharePoint Error and Resolution: SharePoint, Failed to connect to the configuration database.'>SharePoint Error and Resolution: SharePoint, Failed to connect to the configuration database.</a></li>
<li><a href='http://www.coderetard.com/2008/03/20/sharepoint-search-failing-application-server-job-failed-for-service-instance/' rel='bookmark' title='Permanent Link: SharePoint Search Failing: Application Server job failed for service instance'>SharePoint Search Failing: Application Server job failed for service instance</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.coderetard.com/2009/01/22/sharepoint-deep-diving-with-cross-forest-multi-forest-configuration-and-additional-info/";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "";
		digg_title = "SharePoint%3A+Deep+Diving+with+Cross+Forest%2C+Multi+Forest+Configuration+and+Additional+Info";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "Deep Diving with Cross Forest, Multi Forest Configuration and Additional InfoFrom Joel Oleson&#8217;s Blog URL: http://blogs.msdn.com/joelo/archive/2007/03/08/cross-forest-multi-forest-configuration-additional-info.aspx:BackgroundThe people picker works...";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><p>Deep Diving with Cross Forest, Multi Forest Configuration and Additional Info</p>
<p>From Joel Oleson&#8217;s Blog URL: <a href="http://blogs.msdn.com/joelo/archive/2007/03/08/cross-forest-multi-forest-configuration-additional-info.aspx">http://blogs.msdn.com/joelo/archive/2007/03/08/cross-forest-multi-forest-configuration-additional-info.aspx</a>:<br />
<code><br />
Background<br />
The people picker works in cross domain or cross forest environment. It works in both-way trust and one-way trust environment.<br />
Out of the box, if the admin does not do any configuration, the people picker will issue queries to all two-way trusted domains and two-way trusted forests to search people &#038; groups.<br />
The people picker uses the application pool account to search the target domains and forests. If the application pool account does not have permission to the target domains or forests, or the admin want to use different account to search the target domains or forests, the admin could should use<br />
How to Configure<br />
Don’t forget to run stsadm.exe –o setapppassword –password <somekey> on all machines in the farm where SharePoint is installed</p>
<p>1.     Run on every WFE.<br />
stsadm.exe -o setapppassword -password </somekey><somekey></p>
<p>2.     Run on one WFE<br />
stsadm.exe -o setproperty -url ...</somekey></code></p>
<p><strong>What we have found:</strong></p>
<p><span id="more-3519"></span><br />
Example of command:</p>
<p>stsadm.exe -o setproperty -url &#8220;http://MYSHAREPOINTSITE:21212&#8243; -pn &#8220;peoplepicker-searchadforests&#8221; -pv &#8220;domain:mydomain.something.com,USERNAME,PASSWORD&#8221;</p>
<p>1.  http://MYSHAREPOINTSITE:21212 = Your sharepoint site URL</p>
<p>2.  mydomain.something.com = your domain, you can also use forest:BLAHBLAH</p>
<p>3.  USERNAME = your username you want to use to connect to the domain/forest</p>
<p>4.  PASSWORD = Password for the username you want to use to connect to the domain/forest</p>
<p>Errors you May Encounter:</p>
<p>Error 1:</p>
<p>Command line error.<br />
Usage:<br />
stsadm.exe -o <operation> [
<parameters>]</p>
<p>
Solution:<br />
Make sure you use quotes around peoplepicker-searchforests&#8230;. in the example text we use quotes around everything.</p>
<p>Example = -pn &#8220;peoplepicker-searchadforests&#8221; </p>
<p>Error 2:</p>
<p>The Web application at http://MYSHAREPOINTSITE:21212 could not be found. Verify<br />
 that you have typed the URL correctly. If the URL should be serving existing co<br />
ntent, the system administrator may need to add a new request URL mapping to the<br />
 intended application.</p>
<p>Solution:<br />
1.  Try to login as a master account then run the command again (recommended)</p>
<p>2.  If the above solution fails, you may need to extend the web app, then run the setproperty command on the new web app.</p>
<p>Error:</p>
<p>Cannot connect to SQL Server. SQLSERVERNAME not found. Additional error information from SQL Server is included below.<br />
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.</p>
<p>Solution:</p>
<p>Make sure you are RDP&#8217;ed in with an account that has windows access to SQL Server</parameters></operation></p>
<script type="text/javascript" class="owbutton" src="http://www.onlywire.com/btn/button_2" title="SharePoint: Deep Diving with Cross Forest, Multi Forest Configuration and Additional Info" url="http://www.coderetard.com/2009/01/22/sharepoint-deep-diving-with-cross-forest-multi-forest-configuration-and-additional-info/"></script>
<div class="sociable">

<ul>
	<li class="sociablefirst"><a rel="nofollow" id="twitter"  target="_blank" href="http://twitter.com/home?status=SharePoint%3A%20Deep%20Diving%20with%20Cross%20Forest%2C%20Multi%20Forest%20Configuration%20and%20Additional%20Info%20-%20http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F22%2Fsharepoint-deep-diving-with-cross-forest-multi-forest-configuration-and-additional-info%2F" title="Twitter"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="digg"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F22%2Fsharepoint-deep-diving-with-cross-forest-multi-forest-configuration-and-additional-info%2F&amp;title=SharePoint%3A%20Deep%20Diving%20with%20Cross%20Forest%2C%20Multi%20Forest%20Configuration%20and%20Additional%20Info&amp;bodytext=Deep%20Diving%20with%20Cross%20Forest%2C%20Multi%20Forest%20Configuration%20and%20Additional%20Info%0D%0A%0D%0AFrom%20Joel%20Oleson%27s%20Blog%20URL%3A%20http%3A%2F%2Fblogs.msdn.com%2Fjoelo%2Farchive%2F2007%2F03%2F08%2Fcross-forest-multi-forest-configuration-additional-info.aspx%3A%0D%0A%0D%0ABackground%0D%0AThe%20people%20picke" title="Digg"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="del.icio.us"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F22%2Fsharepoint-deep-diving-with-cross-forest-multi-forest-configuration-and-additional-info%2F&amp;title=SharePoint%3A%20Deep%20Diving%20with%20Cross%20Forest%2C%20Multi%20Forest%20Configuration%20and%20Additional%20Info&amp;notes=Deep%20Diving%20with%20Cross%20Forest%2C%20Multi%20Forest%20Configuration%20and%20Additional%20Info%0D%0A%0D%0AFrom%20Joel%20Oleson%27s%20Blog%20URL%3A%20http%3A%2F%2Fblogs.msdn.com%2Fjoelo%2Farchive%2F2007%2F03%2F08%2Fcross-forest-multi-forest-configuration-additional-info.aspx%3A%0D%0A%0D%0ABackground%0D%0AThe%20people%20picke" title="del.icio.us"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="propeller"  target="_blank" href="http://www.propeller.com/submit/?url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F22%2Fsharepoint-deep-diving-with-cross-forest-multi-forest-configuration-and-additional-info%2F" title="Propeller"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/propeller.png" title="Propeller" alt="Propeller" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="reddit"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F22%2Fsharepoint-deep-diving-with-cross-forest-multi-forest-configuration-and-additional-info%2F&amp;title=SharePoint%3A%20Deep%20Diving%20with%20Cross%20Forest%2C%20Multi%20Forest%20Configuration%20and%20Additional%20Info" title="Reddit"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="slashdot"  target="_blank" href="http://slashdot.org/bookmark.pl?title=SharePoint%3A%20Deep%20Diving%20with%20Cross%20Forest%2C%20Multi%20Forest%20Configuration%20and%20Additional%20Info&amp;url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F22%2Fsharepoint-deep-diving-with-cross-forest-multi-forest-configuration-and-additional-info%2F" title="Slashdot"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="stumbleupon"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F22%2Fsharepoint-deep-diving-with-cross-forest-multi-forest-configuration-and-additional-info%2F&amp;title=SharePoint%3A%20Deep%20Diving%20with%20Cross%20Forest%2C%20Multi%20Forest%20Configuration%20and%20Additional%20Info" title="StumbleUpon"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="technorati"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F22%2Fsharepoint-deep-diving-with-cross-forest-multi-forest-configuration-and-additional-info%2F" title="Technorati"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="mixx"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F22%2Fsharepoint-deep-diving-with-cross-forest-multi-forest-configuration-and-additional-info%2F&amp;title=SharePoint%3A%20Deep%20Diving%20with%20Cross%20Forest%2C%20Multi%20Forest%20Configuration%20and%20Additional%20Info" title="Mixx"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="yahoobuzz"  target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F22%2Fsharepoint-deep-diving-with-cross-forest-multi-forest-configuration-and-additional-info%2F&amp;submitHeadline=SharePoint%3A%20Deep%20Diving%20with%20Cross%20Forest%2C%20Multi%20Forest%20Configuration%20and%20Additional%20Info&amp;submitSummary=Deep%20Diving%20with%20Cross%20Forest%2C%20Multi%20Forest%20Configuration%20and%20Additional%20Info%0D%0A%0D%0AFrom%20Joel%20Oleson%27s%20Blog%20URL%3A%20http%3A%2F%2Fblogs.msdn.com%2Fjoelo%2Farchive%2F2007%2F03%2F08%2Fcross-forest-multi-forest-configuration-additional-info.aspx%3A%0D%0A%0D%0ABackground%0D%0AThe%20people%20picke&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="newsvine"  target="_blank" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F22%2Fsharepoint-deep-diving-with-cross-forest-multi-forest-configuration-and-additional-info%2F&amp;h=SharePoint%3A%20Deep%20Diving%20with%20Cross%20Forest%2C%20Multi%20Forest%20Configuration%20and%20Additional%20Info" title="NewsVine"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="facebook"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F22%2Fsharepoint-deep-diving-with-cross-forest-multi-forest-configuration-and-additional-info%2F&amp;t=SharePoint%3A%20Deep%20Diving%20with%20Cross%20Forest%2C%20Multi%20Forest%20Configuration%20and%20Additional%20Info" title="Facebook"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow" id="google"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F22%2Fsharepoint-deep-diving-with-cross-forest-multi-forest-configuration-and-additional-info%2F&amp;title=SharePoint%3A%20Deep%20Diving%20with%20Cross%20Forest%2C%20Multi%20Forest%20Configuration%20and%20Additional%20Info&amp;annotation=Deep%20Diving%20with%20Cross%20Forest%2C%20Multi%20Forest%20Configuration%20and%20Additional%20Info%0D%0A%0D%0AFrom%20Joel%20Oleson%27s%20Blog%20URL%3A%20http%3A%2F%2Fblogs.msdn.com%2Fjoelo%2Farchive%2F2007%2F03%2F08%2Fcross-forest-multi-forest-configuration-additional-info.aspx%3A%0D%0A%0D%0ABackground%0D%0AThe%20people%20picke" title="Google Bookmarks"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related Posts:<ol><li><a href='http://www.coderetard.com/2009/01/09/sharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation/' rel='bookmark' title='Permanent Link: SharePoint Search Web Service Error: Attempted to perform an unauthorized operation'>SharePoint Search Web Service Error: Attempted to perform an unauthorized operation</a></li>
<li><a href='http://www.coderetard.com/2008/12/24/sharepoint-error-and-resolution-sharepoint-failed-to-connect-to-the-configuration-database/' rel='bookmark' title='Permanent Link: SharePoint Error and Resolution: SharePoint, Failed to connect to the configuration database.'>SharePoint Error and Resolution: SharePoint, Failed to connect to the configuration database.</a></li>
<li><a href='http://www.coderetard.com/2008/03/20/sharepoint-search-failing-application-server-job-failed-for-service-instance/' rel='bookmark' title='Permanent Link: SharePoint Search Failing: Application Server job failed for service instance'>SharePoint Search Failing: Application Server job failed for service instance</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.coderetard.com/2009/01/22/sharepoint-deep-diving-with-cross-forest-multi-forest-configuration-and-additional-info/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Generate a .lib from a DLL with Visual Studio</title>
		<link>http://www.coderetard.com/2009/01/21/generate-a-lib-from-a-dll-with-visual-studio/</link>
		<comments>http://www.coderetard.com/2009/01/21/generate-a-lib-from-a-dll-with-visual-studio/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 15:43:00 +0000</pubDate>
		<dc:creator>adm_snackbar</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[C/C++]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[generate lib from dll]]></category>
		<category><![CDATA[visual studio]]></category>

		<guid isPermaLink="false">http://www.coderetard.com/2009/01/21/generate-a-lib-from-a-dll-with-visual-studio/</guid>
		<description><![CDATA[
		
		
		
		
Oftentimes programmers have to deal with external third party DLLs that their software rely on to function. This is both smart and useful because as long as the DLL interface remains the same, externally linked DLLs can be easily swapped in and out without having to recompile and rebuild code. However, linking code in Visual [...]


Related Posts:<ol><li><a href='http://www.coderetard.com/2008/04/07/how-to-automate-builds-with-visual-studio/' rel='bookmark' title='Permanent Link: How to Automate Builds with Visual Studio'>How to Automate Builds with Visual Studio</a></li>
<li><a href='http://www.coderetard.com/2008/11/30/microsoft-sues-to-defend-visual-studio-users/' rel='bookmark' title='Permanent Link: Microsoft Sues to Defend Visual Studio Users'>Microsoft Sues to Defend Visual Studio Users</a></li>
<li><a href='http://www.coderetard.com/2008/10/08/svn-error-while-loading-shared-libraries-libcom_errso3/' rel='bookmark' title='Permanent Link: SVN Error While Loading Shared Libraries: libcom_err.so.3'>SVN Error While Loading Shared Libraries: libcom_err.so.3</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.coderetard.com/2009/01/21/generate-a-lib-from-a-dll-with-visual-studio/";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "";
		digg_title = "Generate+a+.lib+from+a+DLL+with+Visual+Studio";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "Oftentimes programmers have to deal with external third party DLLs that their software rely on to function. This is both smart and useful because as long as the DLL interface remains the same, externally linked DLLs can be easily swapped in and out without...";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><p><img src="http://www.coderetard.com/wp-content/uploads/2009/01/vs_teamsystem.jpg" alt="visual studio team system" title="visual studio team system" width="500" height="375" class="size-full wp-image-3512" /></p>
<p>Oftentimes programmers have to deal with external third party DLLs that their software rely on to function. This is both smart and useful because as long as the DLL interface remains the same, externally linked DLLs can be easily swapped in and out without having to recompile and rebuild code. However, linking code in Visual Studio with an external library requires that a .lib file exist &#8211; the DLL is actually not sufficient for this task. Fortunately, there is a way to generate a .lib from a DLL with Visual Studio. Creating the .lib file is a bit like reverse engineering the DLL&#8217;s symbols.</p>
<p> <span id="more-3509"></span>
</p>
<ol>
<li>Regardless of your Visual Studio version, whether it&#8217;s for 2003, 2005, or 2008 .NET, open up the Visual Studio Tools command promopt (something like Start -&gt; Program Files -&gt; Microsoft Visual Studio -&gt; Visual Studio Tools -&gt; Visual Studio Command Prompt). </li>
<li>If you have a .def file for your DLL, you can skip this step. Otherwise if your DLL did not ship with a .def file, you have a bit of work ahead of you. You cannot generate a .lib without a .def file first, sorry. To generate a .def file from a DLL, execute the <strong>dumpbin</strong> command to extract the function names from your DLL. In our example, we will be building from sqlite3.dll.       <br /><code>dumpbin /exports C:\path\to\sqlite3.dll</code>The output appears below:<img title="vs_dumpbin" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="467" alt="vs_dumpbin" src="http://www.coderetard.com/wp-content/uploads/2009/01/vs-dumpbin.jpg" width="499" border="0" />       <br />The function names boxed in red are what you need to care about. Copy just the function name text into a new file with .def extension. Start the new file with &quot;EXPORTS” without the quotes and then have each function on its own line like this:       <br /><code>EXPORTS        <br />sqlite3_aggregate_context         <br />sqlite3_aggregate_count         <br />sqlite3_auto_extension         <br />sqlite3_bind_blob         <br />sqlite3_bind_double         <br />sqlite3_bind_int         <br />sqlite3_bind_int64         <br />...         <br /></code></li>
<li>With your new definition file in tow, in the command prompt you can execute the <strong>lib</strong> command to finally generate the .lib file:<code>lib /def:C:\path\to\sqlite3.def /out:C:\path\to\sqlite3.lib /machine:x86</code>       <br />This generates the .lib file you can use to link with in your project file. Note that the /machine argument can take any number of machine configuration so be sure to choose the correct one. To get a list of all machine types, simply type “lib” by itself. Here is the usage below for your edification:       <br /><code>usage: LIB [options] [files]
<p>options:         </p>
<p>/DEF[:filename]         <br />/EXPORT:symbol         <br />/EXTRACT:membername         <br />/INCLUDE:symbol         <br />/LIBPATH:dir         <br />/LIST[:filename]         </p>
<p>/MACHINE:{AM33|ARM|EBC|IA64|M32R|MIPS|MIPS16|MIPSFPU|MIPSFPU16|MIPSR41XX|         <br />SH3|SH3DSP|SH4|SH5|THUMB|X86}         <br />/NAME:filename         <br />/NODEFAULTLIB[:library]         <br />/NOLOGO         <br />/OUT:filename         <br />/REMOVE:membername         <br />/SUBSYSTEM:{CONSOLE|EFI_APPLICATION|EFI_BOOT_SERVICE_DRIVER|         <br />EFI_ROM|EFI_RUNTIME_DRIVER|NATIVE|POSIX|WINDOWS|         <br />WINDOWSCE}[,#[.##]]         <br />/VERBOSE</code> </li>
</ol>
<p>And if you came looking for sqlite3.lib we just saved you a lot of time.</p>
<script type="text/javascript" class="owbutton" src="http://www.onlywire.com/btn/button_2" title="Generate a .lib from a DLL with Visual Studio" url="http://www.coderetard.com/2009/01/21/generate-a-lib-from-a-dll-with-visual-studio/"></script>
<div class="sociable">

<ul>
	<li class="sociablefirst"><a rel="nofollow" id="twitter"  target="_blank" href="http://twitter.com/home?status=Generate%20a%20.lib%20from%20a%20DLL%20with%20Visual%20Studio%20-%20http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F21%2Fgenerate-a-lib-from-a-dll-with-visual-studio%2F" title="Twitter"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="digg"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F21%2Fgenerate-a-lib-from-a-dll-with-visual-studio%2F&amp;title=Generate%20a%20.lib%20from%20a%20DLL%20with%20Visual%20Studio&amp;bodytext=%0D%0AOftentimes%20programmers%20have%20to%20deal%20with%20external%20third%20party%20DLLs%20that%20their%20software%20rely%20on%20to%20function.%20This%20is%20both%20smart%20and%20useful%20because%20as%20long%20as%20the%20DLL%20interface%20remains%20the%20same%2C%20externally%20linked%20DLLs%20can%20be%20easily%20swapped%20in%20and%20out" title="Digg"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="del.icio.us"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F21%2Fgenerate-a-lib-from-a-dll-with-visual-studio%2F&amp;title=Generate%20a%20.lib%20from%20a%20DLL%20with%20Visual%20Studio&amp;notes=%0D%0AOftentimes%20programmers%20have%20to%20deal%20with%20external%20third%20party%20DLLs%20that%20their%20software%20rely%20on%20to%20function.%20This%20is%20both%20smart%20and%20useful%20because%20as%20long%20as%20the%20DLL%20interface%20remains%20the%20same%2C%20externally%20linked%20DLLs%20can%20be%20easily%20swapped%20in%20and%20out" title="del.icio.us"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="propeller"  target="_blank" href="http://www.propeller.com/submit/?url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F21%2Fgenerate-a-lib-from-a-dll-with-visual-studio%2F" title="Propeller"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/propeller.png" title="Propeller" alt="Propeller" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="reddit"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F21%2Fgenerate-a-lib-from-a-dll-with-visual-studio%2F&amp;title=Generate%20a%20.lib%20from%20a%20DLL%20with%20Visual%20Studio" title="Reddit"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="slashdot"  target="_blank" href="http://slashdot.org/bookmark.pl?title=Generate%20a%20.lib%20from%20a%20DLL%20with%20Visual%20Studio&amp;url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F21%2Fgenerate-a-lib-from-a-dll-with-visual-studio%2F" title="Slashdot"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="stumbleupon"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F21%2Fgenerate-a-lib-from-a-dll-with-visual-studio%2F&amp;title=Generate%20a%20.lib%20from%20a%20DLL%20with%20Visual%20Studio" title="StumbleUpon"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="technorati"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F21%2Fgenerate-a-lib-from-a-dll-with-visual-studio%2F" title="Technorati"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="mixx"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F21%2Fgenerate-a-lib-from-a-dll-with-visual-studio%2F&amp;title=Generate%20a%20.lib%20from%20a%20DLL%20with%20Visual%20Studio" title="Mixx"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="yahoobuzz"  target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F21%2Fgenerate-a-lib-from-a-dll-with-visual-studio%2F&amp;submitHeadline=Generate%20a%20.lib%20from%20a%20DLL%20with%20Visual%20Studio&amp;submitSummary=%0D%0AOftentimes%20programmers%20have%20to%20deal%20with%20external%20third%20party%20DLLs%20that%20their%20software%20rely%20on%20to%20function.%20This%20is%20both%20smart%20and%20useful%20because%20as%20long%20as%20the%20DLL%20interface%20remains%20the%20same%2C%20externally%20linked%20DLLs%20can%20be%20easily%20swapped%20in%20and%20out&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="newsvine"  target="_blank" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F21%2Fgenerate-a-lib-from-a-dll-with-visual-studio%2F&amp;h=Generate%20a%20.lib%20from%20a%20DLL%20with%20Visual%20Studio" title="NewsVine"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="facebook"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F21%2Fgenerate-a-lib-from-a-dll-with-visual-studio%2F&amp;t=Generate%20a%20.lib%20from%20a%20DLL%20with%20Visual%20Studio" title="Facebook"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow" id="google"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F21%2Fgenerate-a-lib-from-a-dll-with-visual-studio%2F&amp;title=Generate%20a%20.lib%20from%20a%20DLL%20with%20Visual%20Studio&amp;annotation=%0D%0AOftentimes%20programmers%20have%20to%20deal%20with%20external%20third%20party%20DLLs%20that%20their%20software%20rely%20on%20to%20function.%20This%20is%20both%20smart%20and%20useful%20because%20as%20long%20as%20the%20DLL%20interface%20remains%20the%20same%2C%20externally%20linked%20DLLs%20can%20be%20easily%20swapped%20in%20and%20out" title="Google Bookmarks"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related Posts:<ol><li><a href='http://www.coderetard.com/2008/04/07/how-to-automate-builds-with-visual-studio/' rel='bookmark' title='Permanent Link: How to Automate Builds with Visual Studio'>How to Automate Builds with Visual Studio</a></li>
<li><a href='http://www.coderetard.com/2008/11/30/microsoft-sues-to-defend-visual-studio-users/' rel='bookmark' title='Permanent Link: Microsoft Sues to Defend Visual Studio Users'>Microsoft Sues to Defend Visual Studio Users</a></li>
<li><a href='http://www.coderetard.com/2008/10/08/svn-error-while-loading-shared-libraries-libcom_errso3/' rel='bookmark' title='Permanent Link: SVN Error While Loading Shared Libraries: libcom_err.so.3'>SVN Error While Loading Shared Libraries: libcom_err.so.3</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.coderetard.com/2009/01/21/generate-a-lib-from-a-dll-with-visual-studio/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>SharePoint Search Web Service Error: Attempted to perform an unauthorized operation</title>
		<link>http://www.coderetard.com/2009/01/09/sharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation/</link>
		<comments>http://www.coderetard.com/2009/01/09/sharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation/#comments</comments>
		<pubDate>Fri, 09 Jan 2009 16:29:48 +0000</pubDate>
		<dc:creator>Son Riku</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[asmx]]></category>
		<category><![CDATA[Attempted to perform an unauthorized operation]]></category>
		<category><![CDATA[sharepoiint search]]></category>
		<category><![CDATA[sharepoint search]]></category>
		<category><![CDATA[web service]]></category>
		<category><![CDATA[_vti_bin/search.asmx]]></category>

		<guid isPermaLink="false">http://www.coderetard.com/?p=3348</guid>
		<description><![CDATA[
		
		
		
		Server was unable to process request. —> Attempted to perform an unauthorized operation


queryService.Credentials = new System.Net.NetworkCredential(“username”,“password”,“domain”);

or you may want to try different passing

queryService.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;

or

NetworkCredential networkCredential = CredentialCache.DefaultCredentials.GetCredential(new Uri(queryService.Url), “NTLM”);
or
queryService.Credentials = networkCredential;

 queryService.Credentials = System.Net.CredentialCache.DefaultCredentials;
queryService.PreAuthenticate = true;

What we found the error to be was:
1.  Check to make sure account you are logging in with [...]


Related Posts:<ol><li><a href='http://www.coderetard.com/2008/03/20/sharepoint-search-failing-application-server-job-failed-for-service-instance/' rel='bookmark' title='Permanent Link: SharePoint Search Failing: Application Server job failed for service instance'>SharePoint Search Failing: Application Server job failed for service instance</a></li>
<li><a href='http://www.coderetard.com/2008/10/13/how-to-enable-net-send-messenger-service-on-windows-xp/' rel='bookmark' title='Permanent Link: How to Enable NET SEND Messenger Service on Windows XP'>How to Enable NET SEND Messenger Service on Windows XP</a></li>
<li><a href='http://www.coderetard.com/2008/12/24/sharepoint-error-and-resolution-sharepoint-failed-to-connect-to-the-configuration-database/' rel='bookmark' title='Permanent Link: SharePoint Error and Resolution: SharePoint, Failed to connect to the configuration database.'>SharePoint Error and Resolution: SharePoint, Failed to connect to the configuration database.</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.coderetard.com/2009/01/09/sharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation/";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "";
		digg_title = "SharePoint+Search+Web+Service+Error%3A+Attempted+to+perform+an+unauthorized+operation";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "Server was unable to process request. —> Attempted to perform an unauthorized operationqueryService.Credentials = new System.Net.NetworkCredential(“username”,“password”,“domain”);or you may want to try different passingqueryService.Credentials...";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><p>Server was unable to process request. —> Attempted to perform an unauthorized operation<br />
<br />
<code><br />
queryService.Credentials = new System.Net.NetworkCredential(“username”,“password”,“domain”);<br />
<br />
or you may want to try different passing<br />
<br />
queryService.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;<br />
<br />
or<br />
<br />
NetworkCredential networkCredential = CredentialCache.DefaultCredentials.GetCredential(new Uri(queryService.Url), “NTLM”);<br />
<br />or</p>
<p>queryService.Credentials = networkCredential;<br />
<br />
 queryService.Credentials = System.Net.CredentialCache.DefaultCredentials;<br />
queryService.PreAuthenticate = true;<br />
</code></p>
<p>What we found the error to be was:<br />
1.  Check to make sure account you are logging in with has authority to do so.</p>
<p>2.  Make sure that you are able to connect to the sites search service (IE, make sure its working properly)  Try to connect to other search services to debug issue &#8211; Most times default credentials so not work and you will need to login.<br />
<br />
You can try to use the Search Service tool here:<br />
<a href="http://www.mosssearch.com/searchwebservice.html">http://www.mosssearch.com/searchwebservice.html</a><br />
But that only allows you to login with default credentials and may fail some of the time.</p>
<script type="text/javascript" class="owbutton" src="http://www.onlywire.com/btn/button_2" title="SharePoint Search Web Service Error: Attempted to perform an unauthorized operation" url="http://www.coderetard.com/2009/01/09/sharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation/"></script>
<div class="sociable">

<ul>
	<li class="sociablefirst"><a rel="nofollow" id="twitter"  target="_blank" href="http://twitter.com/home?status=SharePoint%20Search%20Web%20Service%20Error%3A%20Attempted%20to%20perform%20an%20unauthorized%20operation%20-%20http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F09%2Fsharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation%2F" title="Twitter"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="digg"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F09%2Fsharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation%2F&amp;title=SharePoint%20Search%20Web%20Service%20Error%3A%20Attempted%20to%20perform%20an%20unauthorized%20operation&amp;bodytext=Server%20was%20unable%20to%20process%20request.%20%E2%80%94%3E%20Attempted%20to%20perform%20an%20unauthorized%20operation%0D%0A%0D%0A%0D%0AqueryService.Credentials%20%3D%20new%20System.Net.NetworkCredential%28%E2%80%9Cusername%E2%80%9D%2C%E2%80%9Cpassword%E2%80%9D%2C%E2%80%9Cdomain%E2%80%9D%29%3B%0D%0A%0D%0Aor%20you%20may%20want%20to%20try%20different%20passing%0D%0A%0D%0Aque" title="Digg"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="del.icio.us"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F09%2Fsharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation%2F&amp;title=SharePoint%20Search%20Web%20Service%20Error%3A%20Attempted%20to%20perform%20an%20unauthorized%20operation&amp;notes=Server%20was%20unable%20to%20process%20request.%20%E2%80%94%3E%20Attempted%20to%20perform%20an%20unauthorized%20operation%0D%0A%0D%0A%0D%0AqueryService.Credentials%20%3D%20new%20System.Net.NetworkCredential%28%E2%80%9Cusername%E2%80%9D%2C%E2%80%9Cpassword%E2%80%9D%2C%E2%80%9Cdomain%E2%80%9D%29%3B%0D%0A%0D%0Aor%20you%20may%20want%20to%20try%20different%20passing%0D%0A%0D%0Aque" title="del.icio.us"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="propeller"  target="_blank" href="http://www.propeller.com/submit/?url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F09%2Fsharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation%2F" title="Propeller"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/propeller.png" title="Propeller" alt="Propeller" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="reddit"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F09%2Fsharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation%2F&amp;title=SharePoint%20Search%20Web%20Service%20Error%3A%20Attempted%20to%20perform%20an%20unauthorized%20operation" title="Reddit"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="slashdot"  target="_blank" href="http://slashdot.org/bookmark.pl?title=SharePoint%20Search%20Web%20Service%20Error%3A%20Attempted%20to%20perform%20an%20unauthorized%20operation&amp;url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F09%2Fsharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation%2F" title="Slashdot"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="stumbleupon"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F09%2Fsharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation%2F&amp;title=SharePoint%20Search%20Web%20Service%20Error%3A%20Attempted%20to%20perform%20an%20unauthorized%20operation" title="StumbleUpon"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="technorati"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F09%2Fsharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation%2F" title="Technorati"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="mixx"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F09%2Fsharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation%2F&amp;title=SharePoint%20Search%20Web%20Service%20Error%3A%20Attempted%20to%20perform%20an%20unauthorized%20operation" title="Mixx"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="yahoobuzz"  target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F09%2Fsharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation%2F&amp;submitHeadline=SharePoint%20Search%20Web%20Service%20Error%3A%20Attempted%20to%20perform%20an%20unauthorized%20operation&amp;submitSummary=Server%20was%20unable%20to%20process%20request.%20%E2%80%94%3E%20Attempted%20to%20perform%20an%20unauthorized%20operation%0D%0A%0D%0A%0D%0AqueryService.Credentials%20%3D%20new%20System.Net.NetworkCredential%28%E2%80%9Cusername%E2%80%9D%2C%E2%80%9Cpassword%E2%80%9D%2C%E2%80%9Cdomain%E2%80%9D%29%3B%0D%0A%0D%0Aor%20you%20may%20want%20to%20try%20different%20passing%0D%0A%0D%0Aque&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="newsvine"  target="_blank" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F09%2Fsharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation%2F&amp;h=SharePoint%20Search%20Web%20Service%20Error%3A%20Attempted%20to%20perform%20an%20unauthorized%20operation" title="NewsVine"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="facebook"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F09%2Fsharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation%2F&amp;t=SharePoint%20Search%20Web%20Service%20Error%3A%20Attempted%20to%20perform%20an%20unauthorized%20operation" title="Facebook"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow" id="google"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F09%2Fsharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation%2F&amp;title=SharePoint%20Search%20Web%20Service%20Error%3A%20Attempted%20to%20perform%20an%20unauthorized%20operation&amp;annotation=Server%20was%20unable%20to%20process%20request.%20%E2%80%94%3E%20Attempted%20to%20perform%20an%20unauthorized%20operation%0D%0A%0D%0A%0D%0AqueryService.Credentials%20%3D%20new%20System.Net.NetworkCredential%28%E2%80%9Cusername%E2%80%9D%2C%E2%80%9Cpassword%E2%80%9D%2C%E2%80%9Cdomain%E2%80%9D%29%3B%0D%0A%0D%0Aor%20you%20may%20want%20to%20try%20different%20passing%0D%0A%0D%0Aque" title="Google Bookmarks"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related Posts:<ol><li><a href='http://www.coderetard.com/2008/03/20/sharepoint-search-failing-application-server-job-failed-for-service-instance/' rel='bookmark' title='Permanent Link: SharePoint Search Failing: Application Server job failed for service instance'>SharePoint Search Failing: Application Server job failed for service instance</a></li>
<li><a href='http://www.coderetard.com/2008/10/13/how-to-enable-net-send-messenger-service-on-windows-xp/' rel='bookmark' title='Permanent Link: How to Enable NET SEND Messenger Service on Windows XP'>How to Enable NET SEND Messenger Service on Windows XP</a></li>
<li><a href='http://www.coderetard.com/2008/12/24/sharepoint-error-and-resolution-sharepoint-failed-to-connect-to-the-configuration-database/' rel='bookmark' title='Permanent Link: SharePoint Error and Resolution: SharePoint, Failed to connect to the configuration database.'>SharePoint Error and Resolution: SharePoint, Failed to connect to the configuration database.</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.coderetard.com/2009/01/09/sharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SharePoint C# &#8211; SecurityException: WebPermission Request Error</title>
		<link>http://www.coderetard.com/2008/06/16/sharepoint-c-systemsecuritysecurityexception-request-for-the-permission-of-type-systemnetwebpermission-system-version2000-cultureneutral-publickeytokenb77a5c561934e089-failed/</link>
		<comments>http://www.coderetard.com/2008/06/16/sharepoint-c-systemsecuritysecurityexception-request-for-the-permission-of-type-systemnetwebpermission-system-version2000-cultureneutral-publickeytokenb77a5c561934e089-failed/#comments</comments>
		<pubDate>Mon, 16 Jun 2008 20:47:44 +0000</pubDate>
		<dc:creator>Son Riku</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://www.coderetard.com/?p=957</guid>
		<description><![CDATA[
		
		
		
		Security Exception
Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application&#8217;s trust level in the configuration file. 
Exception Details: System.Security.SecurityException: Request for the permission of type &#8216;System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&#8242; failed.
Source Error: 
An [...]


Related Posts:<ol><li><a href='http://www.coderetard.com/2008/12/24/sharepoint-error-and-resolution-sharepoint-failed-to-connect-to-the-configuration-database/' rel='bookmark' title='Permanent Link: SharePoint Error and Resolution: SharePoint, Failed to connect to the configuration database.'>SharePoint Error and Resolution: SharePoint, Failed to connect to the configuration database.</a></li>
<li><a href='http://www.coderetard.com/2009/01/09/sharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation/' rel='bookmark' title='Permanent Link: SharePoint Search Web Service Error: Attempted to perform an unauthorized operation'>SharePoint Search Web Service Error: Attempted to perform an unauthorized operation</a></li>
<li><a href='http://www.coderetard.com/2009/02/11/sharepoint-template-error-the-template-you-have-chosen-is-invalid-or-cannot-be-found/' rel='bookmark' title='Permanent Link: SharePoint Template Error: The template you have chosen is invalid or cannot be found.'>SharePoint Template Error: The template you have chosen is invalid or cannot be found.</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.coderetard.com/2008/06/16/sharepoint-c-systemsecuritysecurityexception-request-for-the-permission-of-type-systemnetwebpermission-system-version2000-cultureneutral-publickeytokenb77a5c561934e089-failed/";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "";
		digg_title = "SharePoint+C%23+%26%238211%3B+SecurityException%3A+WebPermission+Request+Error";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "Security ExceptionDescription: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application&#8217;s trust level...";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><blockquote><p>Security Exception<br />
Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application&#8217;s trust level in the configuration file. </p>
<p>Exception Details: System.Security.SecurityException: Request for the permission of type &#8216;System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&#8242; failed.</p>
<p>Source Error: </p>
<p>An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
</p></blockquote>
<p>If you care getting the error above in SharePoint, there is a simple work around to get your code to work.</p>
<p>1.  Open the wss_minimaltrust.config located: &#8220;C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\CONFIG&#8221;</p>
<p>2.  Under the XML section &lt;namedpermissionsets&gt; and under the last &lt;permissionset&gt; add</p>
<p><code><br />
&lt;ipermission&gt;<br />
class="WebPermission"<br />
version="1"<br />
Unrestricted="true"&gt;<br />
&lt;/ipermission&gt;</code></p>
<p>3.  Save the file and you are good to go!</p>
<script type="text/javascript" class="owbutton" src="http://www.onlywire.com/btn/button_2" title="SharePoint C# - SecurityException: WebPermission Request Error" url="http://www.coderetard.com/2008/06/16/sharepoint-c-systemsecuritysecurityexception-request-for-the-permission-of-type-systemnetwebpermission-system-version2000-cultureneutral-publickeytokenb77a5c561934e089-failed/"></script>
<div class="sociable">

<ul>
	<li class="sociablefirst"><a rel="nofollow" id="twitter"  target="_blank" href="http://twitter.com/home?status=SharePoint%20C%23%20-%20SecurityException%3A%20WebPermission%20Request%20Error%20-%20http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F16%2Fsharepoint-c-systemsecuritysecurityexception-request-for-the-permission-of-type-systemnetwebpermission-system-version2000-cultureneutral-publickeytokenb77a5c561934e089-failed%2F" title="Twitter"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="digg"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F16%2Fsharepoint-c-systemsecuritysecurityexception-request-for-the-permission-of-type-systemnetwebpermission-system-version2000-cultureneutral-publickeytokenb77a5c561934e089-failed%2F&amp;title=SharePoint%20C%23%20-%20SecurityException%3A%20WebPermission%20Request%20Error&amp;bodytext=%0D%0ASecurity%20Exception%20%0D%0ADescription%3A%20The%20application%20attempted%20to%20perform%20an%20operation%20not%20allowed%20by%20the%20security%20policy.%20%20To%20grant%20this%20application%20the%20required%20permission%20please%20contact%20your%20system%20administrator%20or%20change%20the%20application%27s%20trust%20le" title="Digg"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="del.icio.us"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F16%2Fsharepoint-c-systemsecuritysecurityexception-request-for-the-permission-of-type-systemnetwebpermission-system-version2000-cultureneutral-publickeytokenb77a5c561934e089-failed%2F&amp;title=SharePoint%20C%23%20-%20SecurityException%3A%20WebPermission%20Request%20Error&amp;notes=%0D%0ASecurity%20Exception%20%0D%0ADescription%3A%20The%20application%20attempted%20to%20perform%20an%20operation%20not%20allowed%20by%20the%20security%20policy.%20%20To%20grant%20this%20application%20the%20required%20permission%20please%20contact%20your%20system%20administrator%20or%20change%20the%20application%27s%20trust%20le" title="del.icio.us"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="propeller"  target="_blank" href="http://www.propeller.com/submit/?url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F16%2Fsharepoint-c-systemsecuritysecurityexception-request-for-the-permission-of-type-systemnetwebpermission-system-version2000-cultureneutral-publickeytokenb77a5c561934e089-failed%2F" title="Propeller"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/propeller.png" title="Propeller" alt="Propeller" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="reddit"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F16%2Fsharepoint-c-systemsecuritysecurityexception-request-for-the-permission-of-type-systemnetwebpermission-system-version2000-cultureneutral-publickeytokenb77a5c561934e089-failed%2F&amp;title=SharePoint%20C%23%20-%20SecurityException%3A%20WebPermission%20Request%20Error" title="Reddit"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="slashdot"  target="_blank" href="http://slashdot.org/bookmark.pl?title=SharePoint%20C%23%20-%20SecurityException%3A%20WebPermission%20Request%20Error&amp;url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F16%2Fsharepoint-c-systemsecuritysecurityexception-request-for-the-permission-of-type-systemnetwebpermission-system-version2000-cultureneutral-publickeytokenb77a5c561934e089-failed%2F" title="Slashdot"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="stumbleupon"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F16%2Fsharepoint-c-systemsecuritysecurityexception-request-for-the-permission-of-type-systemnetwebpermission-system-version2000-cultureneutral-publickeytokenb77a5c561934e089-failed%2F&amp;title=SharePoint%20C%23%20-%20SecurityException%3A%20WebPermission%20Request%20Error" title="StumbleUpon"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="technorati"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F16%2Fsharepoint-c-systemsecuritysecurityexception-request-for-the-permission-of-type-systemnetwebpermission-system-version2000-cultureneutral-publickeytokenb77a5c561934e089-failed%2F" title="Technorati"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="mixx"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F16%2Fsharepoint-c-systemsecuritysecurityexception-request-for-the-permission-of-type-systemnetwebpermission-system-version2000-cultureneutral-publickeytokenb77a5c561934e089-failed%2F&amp;title=SharePoint%20C%23%20-%20SecurityException%3A%20WebPermission%20Request%20Error" title="Mixx"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="yahoobuzz"  target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F16%2Fsharepoint-c-systemsecuritysecurityexception-request-for-the-permission-of-type-systemnetwebpermission-system-version2000-cultureneutral-publickeytokenb77a5c561934e089-failed%2F&amp;submitHeadline=SharePoint%20C%23%20-%20SecurityException%3A%20WebPermission%20Request%20Error&amp;submitSummary=%0D%0ASecurity%20Exception%20%0D%0ADescription%3A%20The%20application%20attempted%20to%20perform%20an%20operation%20not%20allowed%20by%20the%20security%20policy.%20%20To%20grant%20this%20application%20the%20required%20permission%20please%20contact%20your%20system%20administrator%20or%20change%20the%20application%27s%20trust%20le&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="newsvine"  target="_blank" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F16%2Fsharepoint-c-systemsecuritysecurityexception-request-for-the-permission-of-type-systemnetwebpermission-system-version2000-cultureneutral-publickeytokenb77a5c561934e089-failed%2F&amp;h=SharePoint%20C%23%20-%20SecurityException%3A%20WebPermission%20Request%20Error" title="NewsVine"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="facebook"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F16%2Fsharepoint-c-systemsecuritysecurityexception-request-for-the-permission-of-type-systemnetwebpermission-system-version2000-cultureneutral-publickeytokenb77a5c561934e089-failed%2F&amp;t=SharePoint%20C%23%20-%20SecurityException%3A%20WebPermission%20Request%20Error" title="Facebook"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow" id="google"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F16%2Fsharepoint-c-systemsecuritysecurityexception-request-for-the-permission-of-type-systemnetwebpermission-system-version2000-cultureneutral-publickeytokenb77a5c561934e089-failed%2F&amp;title=SharePoint%20C%23%20-%20SecurityException%3A%20WebPermission%20Request%20Error&amp;annotation=%0D%0ASecurity%20Exception%20%0D%0ADescription%3A%20The%20application%20attempted%20to%20perform%20an%20operation%20not%20allowed%20by%20the%20security%20policy.%20%20To%20grant%20this%20application%20the%20required%20permission%20please%20contact%20your%20system%20administrator%20or%20change%20the%20application%27s%20trust%20le" title="Google Bookmarks"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related Posts:<ol><li><a href='http://www.coderetard.com/2008/12/24/sharepoint-error-and-resolution-sharepoint-failed-to-connect-to-the-configuration-database/' rel='bookmark' title='Permanent Link: SharePoint Error and Resolution: SharePoint, Failed to connect to the configuration database.'>SharePoint Error and Resolution: SharePoint, Failed to connect to the configuration database.</a></li>
<li><a href='http://www.coderetard.com/2009/01/09/sharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation/' rel='bookmark' title='Permanent Link: SharePoint Search Web Service Error: Attempted to perform an unauthorized operation'>SharePoint Search Web Service Error: Attempted to perform an unauthorized operation</a></li>
<li><a href='http://www.coderetard.com/2009/02/11/sharepoint-template-error-the-template-you-have-chosen-is-invalid-or-cannot-be-found/' rel='bookmark' title='Permanent Link: SharePoint Template Error: The template you have chosen is invalid or cannot be found.'>SharePoint Template Error: The template you have chosen is invalid or cannot be found.</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.coderetard.com/2008/06/16/sharepoint-c-systemsecuritysecurityexception-request-for-the-permission-of-type-systemnetwebpermission-system-version2000-cultureneutral-publickeytokenb77a5c561934e089-failed/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>c# Generate a Random Number</title>
		<link>http://www.coderetard.com/2008/06/10/c-generate-a-random-number/</link>
		<comments>http://www.coderetard.com/2008/06/10/c-generate-a-random-number/#comments</comments>
		<pubDate>Tue, 10 Jun 2008 23:53:55 +0000</pubDate>
		<dc:creator>Son Riku</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[c# Generate a Random Number. code]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[random number]]></category>

		<guid isPermaLink="false">http://www.coderetard.com/?p=923</guid>
		<description><![CDATA[
		
		
		
		The following code snippet shows how to generate a random number between a range in C#, where min and max are minimum and maximum range of the new number.
private int RandomNumber(int min, int max)
{
Random random = new Random();
return random.Next(min, max); 
}
How to use it?
Copy the above code in your class where you want to use [...]


Related Posts:<ol><li><a href='http://www.coderetard.com/2008/03/10/random-value-generator-with-string-arrays-in-c/' rel='bookmark' title='Permanent Link: Random Value Generator with String Arrays in C#'>Random Value Generator with String Arrays in C#</a></li>
<li><a href='http://www.coderetard.com/2009/01/21/generate-a-lib-from-a-dll-with-visual-studio/' rel='bookmark' title='Permanent Link: Generate a .lib from a DLL with Visual Studio'>Generate a .lib from a DLL with Visual Studio</a></li>
<li><a href='http://www.coderetard.com/2008/03/11/the-programmer-code-off/' rel='bookmark' title='Permanent Link: The Programmer Code Off!'>The Programmer Code Off!</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.coderetard.com/2008/06/10/c-generate-a-random-number/";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "";
		digg_title = "c%23+Generate+a+Random+Number";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "The following code snippet shows how to generate a random number between a range in C#, where min and max are minimum and maximum range of the new number.private int RandomNumber(int min, int max){Random random = new Random();return random.Next(min, max);...";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><p>The following code snippet shows how to generate a random number between a range in C#, where min and max are minimum and maximum range of the new number.</p>
<p><code>private int RandomNumber(int min, int max)<br />
{<br />
Random random = new Random();<br />
return random.Next(min, max); <br />
}</code></p>
<p>How to use it?</p>
<p>Copy the above code in your class where you want to use it and call like this:</p>
<p><code>int returnValue = RandomNumber(5, 20);</code></p>
<script type="text/javascript" class="owbutton" src="http://www.onlywire.com/btn/button_2" title="c# Generate a Random Number" url="http://www.coderetard.com/2008/06/10/c-generate-a-random-number/"></script>
<div class="sociable">

<ul>
	<li class="sociablefirst"><a rel="nofollow" id="twitter"  target="_blank" href="http://twitter.com/home?status=c%23%20Generate%20a%20Random%20Number%20-%20http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F10%2Fc-generate-a-random-number%2F" title="Twitter"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="digg"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F10%2Fc-generate-a-random-number%2F&amp;title=c%23%20Generate%20a%20Random%20Number&amp;bodytext=The%20following%20code%20snippet%20shows%20how%20to%20generate%20a%20random%20number%20between%20a%20range%20in%20C%23%2C%20where%20min%20and%20max%20are%20minimum%20and%20maximum%20range%20of%20the%20new%20number.%0D%0A%0D%0Aprivate%20int%20RandomNumber%28int%20min%2C%20int%20max%29%0D%0A%7B%0D%0ARandom%20random%20%3D%20new%20Random%28%29%3B%0D%0Areturn%20random." title="Digg"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="del.icio.us"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F10%2Fc-generate-a-random-number%2F&amp;title=c%23%20Generate%20a%20Random%20Number&amp;notes=The%20following%20code%20snippet%20shows%20how%20to%20generate%20a%20random%20number%20between%20a%20range%20in%20C%23%2C%20where%20min%20and%20max%20are%20minimum%20and%20maximum%20range%20of%20the%20new%20number.%0D%0A%0D%0Aprivate%20int%20RandomNumber%28int%20min%2C%20int%20max%29%0D%0A%7B%0D%0ARandom%20random%20%3D%20new%20Random%28%29%3B%0D%0Areturn%20random." title="del.icio.us"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="propeller"  target="_blank" href="http://www.propeller.com/submit/?url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F10%2Fc-generate-a-random-number%2F" title="Propeller"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/propeller.png" title="Propeller" alt="Propeller" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="reddit"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F10%2Fc-generate-a-random-number%2F&amp;title=c%23%20Generate%20a%20Random%20Number" title="Reddit"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="slashdot"  target="_blank" href="http://slashdot.org/bookmark.pl?title=c%23%20Generate%20a%20Random%20Number&amp;url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F10%2Fc-generate-a-random-number%2F" title="Slashdot"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="stumbleupon"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F10%2Fc-generate-a-random-number%2F&amp;title=c%23%20Generate%20a%20Random%20Number" title="StumbleUpon"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="technorati"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F10%2Fc-generate-a-random-number%2F" title="Technorati"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="mixx"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F10%2Fc-generate-a-random-number%2F&amp;title=c%23%20Generate%20a%20Random%20Number" title="Mixx"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="yahoobuzz"  target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F10%2Fc-generate-a-random-number%2F&amp;submitHeadline=c%23%20Generate%20a%20Random%20Number&amp;submitSummary=The%20following%20code%20snippet%20shows%20how%20to%20generate%20a%20random%20number%20between%20a%20range%20in%20C%23%2C%20where%20min%20and%20max%20are%20minimum%20and%20maximum%20range%20of%20the%20new%20number.%0D%0A%0D%0Aprivate%20int%20RandomNumber%28int%20min%2C%20int%20max%29%0D%0A%7B%0D%0ARandom%20random%20%3D%20new%20Random%28%29%3B%0D%0Areturn%20random.&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="newsvine"  target="_blank" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F10%2Fc-generate-a-random-number%2F&amp;h=c%23%20Generate%20a%20Random%20Number" title="NewsVine"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="facebook"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F10%2Fc-generate-a-random-number%2F&amp;t=c%23%20Generate%20a%20Random%20Number" title="Facebook"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow" id="google"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F10%2Fc-generate-a-random-number%2F&amp;title=c%23%20Generate%20a%20Random%20Number&amp;annotation=The%20following%20code%20snippet%20shows%20how%20to%20generate%20a%20random%20number%20between%20a%20range%20in%20C%23%2C%20where%20min%20and%20max%20are%20minimum%20and%20maximum%20range%20of%20the%20new%20number.%0D%0A%0D%0Aprivate%20int%20RandomNumber%28int%20min%2C%20int%20max%29%0D%0A%7B%0D%0ARandom%20random%20%3D%20new%20Random%28%29%3B%0D%0Areturn%20random." title="Google Bookmarks"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related Posts:<ol><li><a href='http://www.coderetard.com/2008/03/10/random-value-generator-with-string-arrays-in-c/' rel='bookmark' title='Permanent Link: Random Value Generator with String Arrays in C#'>Random Value Generator with String Arrays in C#</a></li>
<li><a href='http://www.coderetard.com/2009/01/21/generate-a-lib-from-a-dll-with-visual-studio/' rel='bookmark' title='Permanent Link: Generate a .lib from a DLL with Visual Studio'>Generate a .lib from a DLL with Visual Studio</a></li>
<li><a href='http://www.coderetard.com/2008/03/11/the-programmer-code-off/' rel='bookmark' title='Permanent Link: The Programmer Code Off!'>The Programmer Code Off!</a></li>
</ol></p>