Wednesday, September 30, 2009

Not enough storage available to add a user into Admin group

If you know you attend within a many Active Directory Groups then its possible to receive an error if you try to add additional users into e.g. administration group on a certain server. Not enough storage / memory - well then then try to add the following:


Registry: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters
new DWORD Value
name: MaxTokenSize
value (Decimal): 65535

after adding this registry key you have to reboot the server and then it works. Why exactly that happens I don't know but it happens if an active directory account attends to much active directory groups.

since this have to be done on every single machine it should be covered in a company rule which is distributed to every machine then this cause eventually also other problems.

Monday, September 21, 2009

Microsoft launches CDN for AJAX

The free Microsoft AJAX CDN provides caching for libraries, improving Web site performance

Microsoft's ASP.Net team is offering a free AJAX CDN (content delivery network service) to cache AJAX libraries and boost Web site performance, a company official said this week.
With the Microsoft AJAX CDN, performance can be significantly improved for ASP.Net Web Forms and ASP.Net MVC applications using ASP.Net AJAX or jQuery libraries, said Scott Guthrie, corporate vice president of the Microsoft Developer Division, in a blog entry.

read the full article: http://news.idg.no/cw/art.cfm?id=CE83C22A-1A64-67EA-E4E9EF7A77915A48

Wednesday, September 16, 2009

Installing Sharepoint 2007 on Windows Server 2008 R2

we are using in our lab a clean installation of Windows Server 2008 R2 which is running as Hyper-V instance. Today we wanted to install a clean installation of Sharepoint 2007 with SP1 on this machine and we explorer an error that we are not able to install it. The setup is comes up with an error which is described here: http://support.microsoft.com/kb/962935 but this is not our szenario. A printscreen of this message can be found here: http://www.ronischuetz.com/images/SP_2007SP1_Inst_Error.png

@Microsoft,

my personal point of view is that it cannot be that we need to install first 2008, then Sharepoint 2007 with SP1, then SP2 and upgrade to 2008 R2. Nobody is going be happy with this solution and I hope we find a fast way how customers can install Sharepoint direclty on 2008 R2.


Anyway, thanks in advance for any further information how we should go on with this issue.

The issue is listed here:
http://social.msdn.microsoft.com/Forums/en-US/sharepointadmin/thread/91a6be50-9009-43c8-a37c-66cfb83d738f

and here:
http://stackoverflow.com/questions/1432417/installing-sharepoint-2007-on-windows-server-2008-r2

(a possible solution is already posted - i will try that and update the post)

Update:
Solution I used:
http://social.technet.microsoft.com/Forums/en-US/sharepointadmin/thread/183b5ab9-dc4b-4c27-aecd-55df60167a68

Sunday, September 13, 2009

ASP.NET Membership Tables Export to SQL File

With C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe its possible to create needed asp.net membership tables for authentification in web / win applications.

With this executable its also possible to create a SQL file and install it on every wanted database. To export everything to SQL file we just need to run the following command:

aspnet_regsql.exe -E -S localhost -d targetDBSchemaName -A all -sqlexportonly c:\membership.sql

The output of this script looks like this:

---------------------------------------
Starting execution of InstallCommon.SQL
---------------------------------------

(130 row(s) affected)
Creating the aspnet_Applications table...
Creating the aspnet_Users table...
Creating the aspnet_SchemaVersions table...
Cannot grant, deny, or revoke permissions to sa, dbo, entity owner, information_schema, sys, or yourself.
Cannot grant, deny, or revoke permissions to sa, dbo, entity owner, information_schema, sys, or yourself.

(0 row(s) affected)

(1 row(s) affected)
Cannot grant, deny, or revoke permissions to sa, dbo, entity owner, information_schema, sys, or yourself.
Creating the vw_aspnet_Applications view...
Creating the vw_aspnet_Users view...
Cannot grant, deny, or revoke permissions to sa, dbo, entity owner, information_schema, sys, or yourself.
Cannot grant, deny, or revoke permissions to sa, dbo, entity owner, information_schema, sys, or yourself.
----------------------------------------
Completed execution of InstallCommon.SQL
----------------------------------------
-------------------------------------------
Starting execution of InstallMembership.SQL
-------------------------------------------
Creating the aspnet_Membership table...
Creating the vw_aspnet_MembershipUsers view...
Cannot grant, deny, or revoke permissions to sa, dbo, entity owner, information_schema, sys, or yourself.

(0 row(s) affected)

(1 row(s) affected)
Cannot grant, deny, or revoke permissions to sa, dbo, entity owner, information_schema, sys, or yourself.
--------------------------------------------
Completed execution of InstallMembership.SQL
--------------------------------------------
------------------------------------------------
Starting execution of InstallProfile.SQL
------------------------------------------------
Creating the aspnet_Profile table...
Creating the vw_aspnet_Profiles view...
Cannot grant, deny, or revoke permissions to sa, dbo, entity owner, information_schema, sys, or yourself.

(0 row(s) affected)

(1 row(s) affected)
Cannot grant, deny, or revoke permissions to sa, dbo, entity owner, information_schema, sys, or yourself.
-------------------------------------------------
Completed execution of InstallProfile.SQL
-------------------------------------------------
--------------------------------------
Starting execution of InstallRoles.SQL
--------------------------------------
Creating the aspnet_Roles table...
Creating the aspnet_UsersInRoles table...
Creating the vw_aspnet_Roles view...
Creating the vw_aspnet_UsersInRoles view...
Cannot grant, deny, or revoke permissions to sa, dbo, entity owner, information_schema, sys, or yourself.

(0 row(s) affected)

(1 row(s) affected)
Cannot grant, deny, or revoke permissions to sa, dbo, entity owner, information_schema, sys, or yourself.
---------------------------------------
Completed execution of InstallRoles.SQL
---------------------------------------
------------------------------------------------
Starting execution of InstallPersonalization.SQL
------------------------------------------------
Creating the aspnet_Paths table...
Creating the aspnet_PersonalizationAllUsers table...
Creating the aspnet_PersonalizationPerUser table...
Creating the vw_aspnet_WebPartState_Paths view...
Creating the vw_aspnet_WebPartState_Shared view...
Creating the vw_aspnet_WebPartState_User view...
Cannot grant, deny, or revoke permissions to sa, dbo, entity owner, information_schema, sys, or yourself.

(0 row(s) affected)

(1 row(s) affected)
Cannot grant, deny, or revoke permissions to sa, dbo, entity owner, information_schema, sys, or yourself.
-------------------------------------------------
Completed execution of InstallPersonalization.SQL
-------------------------------------------------
----------------------------------------------------
Starting execution of InstallWebEventSqlProvider.SQL
----------------------------------------------------
Creating the aspnet_WebEvent_Events table...
Cannot grant, deny, or revoke permissions to sa, dbo, entity owner, information_schema, sys, or yourself.

(0 row(s) affected)

(1 row(s) affected)
Cannot grant, deny, or revoke permissions to sa, dbo, entity owner, information_schema, sys, or yourself.
-----------------------------------------------------
Completed execution of InstallWebEventSqlProvider.SQL
-----------------------------------------------------

Thursday, September 10, 2009

World’s smallest web server in C#

today I found the following code: World’s smallest web server


World’s smallest web server

It’s always fun to play with .Net, the HTTP Listener class in .Net 2.0 makes it really easy. With this little block of code you can setup a very simple (multithreaded) web server…

public class Server
{
private static System.Threading.AutoResetEvent listenForNextRequest = new System.Threading.AutoResetEvent(false);

protected Server()
{
_httpListener = new HttpListener();
}

private HttpListener _httpListener;

public string Prefix { get; set; }
public void Start()
{
if (String.IsNullOrEmpty(Prefix))
throw new InvalidOperationException("No prefix has been specified");
_httpListener.Prefixes.Clear();
_httpListener.Prefixes.Add(Prefix);
_httpListener.Start();
System.Threading.ThreadPool.QueueUserWorkItem(Listen);
}

internal void Stop()
{
_httpListener.Stop();
IsRunning = false;
}

public bool IsRunning { get; private set; }

private void ListenerCallback(IAsyncResult result)
{
HttpListener listener = result.AsyncState as HttpListener;
HttpListenerContext context = null;

if (listener == null)
// Nevermind
return;

try
{
context = listener.EndGetContext(result);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex.ToString());
return;
}
finally
{
listenForNextRequest.Set();
}
if (context == null)
return;
ProcessRequest(context);
}

// Loop here to begin processing of new requests.
private void Listen(object state)
{
while (_httpListener.IsListening)
{
_httpListener.BeginGetContext(new AsyncCallback(ListenerCallback), _httpListener);
listenForNextRequest.WaitOne();
}
}

}

Tuesday, September 08, 2009

The /debug option causes the compiler to generate debugging information and place it in the output file or files.

C# Language Reference
/debug (Emit Debugging Information) (C# Compiler Options)

The /debug option causes the compiler to generate debugging information and place it in the output file or files.


/debug[+ | -]
/debug:{full | pdbonly}

Arguments

+ | -

Specifying +, or just /debug, causes the compiler to generate debugging information and place it in a program database (.pdb file). Specifying -, which is in effect if you do not specify /debug, causes no debug information to be created.
full | pdbonly

Specifies the type of debugging information generated by the compiler. The full argument, which is in effect if you do not specify /debug:pdbonly, enables attaching a debugger to the running program. Specifying pdbonly allows source code debugging when the program is started in the debugger but will only display assembler when the running program is attached to the debugger.


Remarks

Use this option to create debug builds. If /debug, /debug+, or /debug:full is not specified, you will not be able to debug the output file of your program.

If you use /debug:full, be aware that there is some impact on the speed and size of JIT optimized code and a small impact on code quality with /debug:full. We recommend /debug:pdbonly or no PDB for generating release code.
NoteNote:

One difference between /debug:pdbonly and /debug:full is that with /debug:full the compiler emits a DebuggableAttribute, which is used to tell the JIT compiler that debug information is available. Therefore, you will get an error if your code contains the DebuggableAttribute set to false if you use /debug:full.

For more information on how to configure the debug performance of an application, see Making an Image Easier to Debug.

To change the location of the .pdb file, see /pdb (Specify Debug Symbol File) (C# Compiler Options).

To set this compiler option in the Visual Studio development environment

1. Open the project's Properties page.
2. Click the Build property page.
3. Click the Advanced button.
4. Modify the Debug Info property.

For information on how to set this compiler option programmatically, see DebugSymbols.

Example

Place debugging information in output file app.pdb:

csc /debug /out:app.pdb test.cs

Twitter is over capacity

That's the second time today I receive the message on twitter:

Twitter is over capacity
To many tweets! Please wait a moment and try again.




Would that also happen if twitter would use .net C# ?? Just joking - great service twitter developers!

How to display product comparsions

  1. 70+ Examples of Product Comparison Tables in Web Design
  2. 25 Clear And Beautiful Comparison Tables

Sunday, September 06, 2009

Capturing ScreenShots in C#

found this today here: http://kseesharp.blogspot.com/2008/11/c-capture-screenshot.html

using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
using System.Windows.Forms;

namespace KSeeSharp
{
class ScreenShot
{
[DllImport("gdi32.dll")]
static extern bool BitBlt(IntPtr hdcDest, int xDest, int yDest, int wDest, int hDest, IntPtr hdcSource, int xSrc, int ySrc, CopyPixelOperation rop);
[DllImport("user32.dll")]
static extern bool ReleaseDC(IntPtr hWnd, IntPtr hDc);
[DllImport("gdi32.dll")]
static extern IntPtr DeleteDC(IntPtr hDc);
[DllImport("gdi32.dll")]
static extern IntPtr DeleteObject(IntPtr hDc);
[DllImport("gdi32.dll")]
static extern IntPtr CreateCompatibleBitmap(IntPtr hdc, int nWidth, int nHeight);
[DllImport("gdi32.dll")]
static extern IntPtr CreateCompatibleDC(IntPtr hdc);
[DllImport("gdi32.dll")]
static extern IntPtr SelectObject(IntPtr hdc, IntPtr bmp);
[DllImport("user32.dll")]
public static extern IntPtr GetDesktopWindow();
[DllImport("user32.dll")]
public static extern IntPtr GetWindowDC(IntPtr ptr);

public void CaptureScreenShot(string filePath)
{
Size sz = Screen.PrimaryScreen.Bounds.Size;
IntPtr hDesk = GetDesktopWindow();
IntPtr hSrce = GetWindowDC(hDesk);
IntPtr hDest = CreateCompatibleDC(hSrce);
IntPtr hBmp = CreateCompatibleBitmap(hSrce, sz.Width, sz.Height);
IntPtr hOldBmp = SelectObject(hDest, hBmp);
bool b = BitBlt(hDest, 0, 0, sz.Width, sz.Height, hSrce, 0, 0, CopyPixelOperation.SourceCopy | CopyPixelOperation.CaptureBlt);
Bitmap bmp = Bitmap.FromHbitmap(hBmp);
SelectObject(hDest, hOldBmp);
DeleteObject(hBmp);
DeleteDC(hDest);
ReleaseDC(hDesk, hSrce);
bmp.Save(filePath);
bmp.Dispose();
}
}
}

would be intersting to know how to capture in C# only the IE Browser content :-)

New feature called branchcache

in my test installation of Windows Server 2008 R2 I found today below the "Add Features Wizard" the item: "Branchcache" and I was asking myself if this is based on Velocity CTP 3 or is this an indiviual development??



BranchCache

BranchCache, available on both Windows Server 2008 R2 and Windows 7, enables client computers in a branch office to retrieve content securely and locally, instead of retrieving it from a central office server. Because branch offices are typically connected over slower WAN links, BranchCache reduces WAN traffic, and increases application responsiveness on the client computer.






BranchCache installs the services needed to provide BranchCache client functionality. It also provides BranchCache server support for the HTTP protocol, Hostet Cache, and services other then the BranchCache for network files role service.

Thursday, September 03, 2009

Hyper-V Tips

  • Never save state on a Domain Controller, doing so can cause domain synchronization issues.
  • Never pause a Domain Controller, this can cause replication issues.
    Do not take Snapshots of Domain Controllers.
  • Use fixed size disks, this will improve performance, and help reduce disk fragmentation.
    Always defragment a physical disk before creating a virtual hard disk.
  • Be mindful of the intergration services affect on a Domain Controller. If you provide the time synchronization service to a Domain Controller, you can cause time synchronization issues in your domain.
  • Dont expand the Virtual Hard Disk if you have snapshots which haven’t merged with the main VHD. This will make it impossible to remerge them.
  • If you cannot merge your snapshot (avhd) files back into the main VHD. You can attempt to use Winimage (http://www.winimage.com) to retrieve the data from within the snapshot file. To do this simply rename the snapshot file from string.avhd to string.vhd then open with winimage.

Wednesday, September 02, 2009

Hyper-V Network and Windows Server 2003

If you setup a virtual machine with Windows Server 2003 Standard, Windows Server 2003 Enterprise or Windows Server 2003 Datacenter and you are missing your network then this happens because you have to install Windows Server 2003 Service Pack 2.

Without the Service Pack 2 of Windows Server 2003 the instance within Hyper-V will NOT recognize your network.

First you have to install Service Pack 2 and second you will have to install Hyper-V integration components. Due this your virtual machines guest have access to Microsoft VMBus Network Adapter.

Links:

Note: prepare yourself with a CD you can burn since you cannot map any USB stick to Hyper-V.


After we installed Windows Server 2003 Service Pack 2 we can install: Hyper-V integration components


After the restart we simply can configure our network and everything works:



enjoy!

Team Foundation Server & and & and & and

During the past 2 years I installed TFS 2008 (Team Foundation Server 2008) at least 25 times most of it for testing and migration purposes. Same I had to do now for a migration scenario from two single installations into a multi-layer installation.

Since Service Pack 1 is out it's possible to install TFS 2008 on Windows 2008 (x-86) and as we know there is now Windows 20008 R2 out but there are no downloads for x-86. Therefore we have to take an earlier Version: Windows Server 2008.

The installation guidance describes exactly what you have to do to run the installation. You have to configure several files, need to adapt WML checks as I posted in my earlier post yesterday: http://netrsc.blogspot.com/2009/09/tfs-sp1-installation-problem.html

At the end of the day it worked beside the "Reporting Services" - as usual! I will try not to get emotional now but it should not be a problem for Microsoft to create installation files which are as easy to install as previous installations.

I mean how much effort Microsoft have to put to create an installer for the following setup:
  • Windows 2003 Server Enterprise / Standard
  • Sql Server 2008
Press 15 times enter, choose your servers and done - no they prefer to handle thousands of forum messages, emails, sending responses to blog post etc.

take 10 % of your communication efforts and put them into a normal installer for single and multi installations with new software.

I really hope Micorosoft consider this for the next TFS 2010.

Another feedback would be to create a personal version of TFS -> Mini Tfs which would fit to the express editions for home use :-)


Swiss hostages still in Libya

The world does not talk about it so lets talk about it at Facebook group.

Hopefully there are a lot of people who join this supporter group. Assist our Swiss citizens which are still held in Libya as hostages: http://bit.ly/HJfZ1

Tuesday, September 01, 2009

TFS SP1 Installation Problem

For some testing I had to setup a Team Foundation Server with SP 1. To accomplish this mission I had to merge the service pack like it's described here:

  1. To integrate the installation of Team Foundation Server and Service Pack 1
    Download SP1 from the Microsoft Web site, and save the update to a folder on the local computer. For example, you can save the file to C:\SP1Download.
  2. From the files that originated on the DVD for Team Foundation Server, copy the AT folder to a location on the local computer. For example, you can copy the folder to C:\InstallMedia.
  3. Open a Command Prompt window, and type the following command, replacing C:\SP1Download with the location that you chose in step 1 and C:\SP1Extract with a separate location on the local computer:
    C:\SP1Download\TFS90SP1-KB949786-ENU /extract:C:\SP1Extract
  4. Create a folder where you can merge files from SP1 and the DVD.
    Type the following command, replacing C:\InstallMedia with the location that you chose in step 2, C:\SP1Extract with the location that you chose in step 3, and C:\MergeFolder with the absolute path of the location that you chose in step 4:
    msiexec /a C:\InstallMedia\vs_setup.msi /p C:\SP1Extract\TFS90sp1-KB949786.msp TARGETDIR=C:\MergeFolder
    Note:
    You must replace C:\MergeFolder with an absolute path, but you can replace C:\InstallMedia and C:\SP1Extract with absolute or relative paths.
  5. From C:\MergeFolder (which you created in step 4), run setup.exe to install Team Foundation Server with SP1.

Now if you use Microsoft SQL Server 2008 Service Pack 1 then you have to modify your hcpackage.xml (I attached my version at the end of this post). After some researches I could find this link: http://support.microsoft.com/kb/969985 Once you have done this the following errors should not appear anymore:
  • The selected instance of SQL Server is not compatible with Team Foundation Server 2008.
  • A compatible version of SQL Server is not installed.
  • The SQL Server Analysis Services assemblies are installed, but they are the SQL 2005 version instead of SQL 2008.

My modified hcpackage you can find here: http://www.ronischuetz.com/download/hcpackage.xml or download it: http://www.ronischuetz.com/download/hcpackage.zip

Facebook is down for me



What the hack - why Facebook.com is closing my account for a maintenance window???

using jQuery to catch the keyboard - amazing plugin

no need to write a lot about it - just check it out:

has been taken from here: http://9lessons.blogspot.com/2009/08/9-most-useful-jquery-plugins.html

Shared Cache - .Net Caching made easy

All information about Shared Cache is available here: http://www.sharedcache.com/. Its free and easy to use, we provide all sources at codeplex.

Facebook Badge