infolink

Friday, March 25, 2011

How to fix the Indexing Service in Windows 2003 Server R2 SP2 when it hangs

I was having some issues with Ektron CMS.NET and it's search API. While building and rebuilding Catalogs it started hanging the Indexing service. I read several posts that suggested deleting the catalogs, but I was not clear on all there locations as the IIS server has 39 websites. So after playing around a bit I found an easy way to delete these catalogs even when the service hangs from within the MMC.
Here are the steps:

• Open the MMC and expand the node for the index service.
• Now open the task manager (CTR+ALT+DEL)
• End task on CISVC.EXE
• Now run Services.msc
• Start the indexing services.
• Go back to your MMC instance and it should not be hanging anymore.

Now you can delete your catalogs, but note you must stop the service again if you want a copy of the catalog before you delete or move. I had t delete and recreate all mine and it no longer hung. It looks like one of my catalogs was corrupt.

Thursday, March 17, 2011

HTTPS SSL not working since making Google Chrome my default browser

Earn easy money advertising on your blog or website: Click Here to learn more.

I decided the other day to make Google Chrome browser my default web browser. I then noticed later in the day, any HTTPS site I visited, I got an error telling me the site was unavailable through any web browser.
I did Install IE 9 and did a few Windows Updates after installing Google Chrome.

I did a system restore in Windows 7. I went back prior to the IE9 install and after a reboot the problem still occurred.

I then figured since it was just HTTPS, SSL driven sites that there must be an issue with encryption. I went into Google Chrome to see what was going on and noticed that in the setting Use TLS 1.0 and SSL 3.0 were unchecked. Once I checked these SSL started to work.

To get to the settings for SSL and TLS, Click on the wrench. Then goto Settings on the menu. At the bottom of the form click show advanced settings. Scroll down to the Network section. Click on change proxy settings. Now the internet properties dialog comes up. Click the Advanced tab. Scroll down and you can set SSL and TLS there.
I cannot fathom why when making Google Chrome my default browser would affect all my other browsers SSL settings. Sounds strange but  by simply checking those two boxes for SSL 3.0 and TLS 1.0 fixed my issue with SSL driven sites.

Earn easy money advertising on your blog or website: Click Here to learn more.

Sunday, February 27, 2011

Easy way to copy Database and table data in Microsoft SQL server

For years I have always found issues importing and exporting data using Microsoft SQL server on the same SQL Server instance. I was very happy with the release of SQL server 2008 and the COPY database feature. This works really well and avoids all the IDENT inserts and other assorted foreign key issues.

Well I recently took on a project that used SQL Server Express 2008 R2. Unfortunately, the Copy database is not available in the express version and with the complex data structure of the database I was working with, I was unable to create a beta version for testing alongside the live database on the live server.

I tried to script everything out and that worked fine, but importing my data did not.

I tried to start with a fresh database and had some issues as keys and indexes did not come over.

So I decided to poke around and noticed that while doing a backup, you can also do a restore from a backup to another database. So I tried this, wow, I feel like an idiot. For over 15 years I always had issues copying databases and their data while retaining their structure on the same instance. I could always get it to where I wanted it, but there were always issues along the way with complex data structures.

This was so simple to just take a backup from the live database. Then restore that bak file to a database on the same server , on he same instance, I just provide the name.

Hope this saves someone the years of trouble it has caused me, sad thing it has always been right there, I just assumed it would be messed up due to file naming.

Steps to copy database to another database on the same SQL Server Express 2008 R2 Management Studio.

1: Right click on the database you want a copy of. Choose TASKS,then choose BACKUP. Click OK.

2: Right click the database folder/node, NOT A DATABASE, Choose TASKS, then RESTORE, then DATABASE. (Note: if you right click on the database, it will overwright that database, if you click on the database node you will get the option to name a new database)

3: Type in the name you want your new database to be named in the To Database text box.

4: Choose the FROM DATABASE, and then below check thebackup you want restored to. (NOTE: You must have a backup for he Original database to appear in this dropdown)

5: Click OK, and SMILE!!!

wasn't that easy!!!!

Wednesday, December 29, 2010

LINQ to SQL DataContext is not accessable, does not show even in intellisense

I have been seeing this strange behavior using LINQ to SQL in Visual Studio 2008 in the last two months.

I was working on a project and defined my DataContext using the LINQ designer. I applied the same namespace as my main class, yet in my main class I do not see my data context, and when I try to type it, it states it does not exist. I check the backend code of the LINQ designer and everything looks right, same namespace and the DataContext is named properly.

I played around trying many things to no avail, so as a last ditch effort I reinstalled Visual Studio 2008 SP1.

When I went back into Visual Studio 2008 I tried to type out my DataContext variable and still same issue, it wasn't accessable. So I then deleted my LINQ to SQL class.

I now recreate my LINQ to SQL class. Add my stored procedures, save the DataContext and then back to my class and guess what, it is there.

So, now here I am, different machine, a month later, same exact issue on a ASP.NET Web Application in Visual Studio 2008. It would not see my Data Context. So I repeat the steps that fixed it for me before in the follow order:

#1 Reinstalled Visual Studio 2008 SP1 (Yes, on both machines I had already installed Visual Studio 2008 SP1)

http://www.microsoft.com/downloads/en/details.aspx?FamilyId=FBEE1648-7106-44A7-9649-6D9F6D58056E&displaylang=en

#2 Open project back up and delete the Linq To SQL class

#3 Recreate the LINQ to SQL class in the designer

#4 Save and Recompile

That was it, it is now working as expected on this machine also, very strange, hope this helps someone else. The other project type was a ASP.NET Web Service.

Tuesday, December 28, 2010

How to read Excel file in .Net C# and VB.NET

I have many times int the past been asked to import/export data from an excel spreadsheet. In the past I have used Interop and OLEDB, but I found this to be a simple dll which allowed me to roll this stuff out a bit faster. This a very simple, lightweight DLL which allows you to read from an excel spreadsheet without Interop and installing an obsolete OLEDB dll.

Excel Data Reader - Read Excel files in .NET

Lightweight and fast library written in C# for reading Microsoft Excel files ('97-2007).
Cross-platform:
- Windows with .Net Framework 2
- Windows Mobile with Compact Framework
- Linux, OS X, BSD with Mono 2+

http://exceldatareader.codeplex.com/

Wednesday, November 17, 2010

How to get Fiddler to work with local host in asp.net while debugging in Visual Studio

Well I have been using Fiddler for some time now and it is a great tool when debugging a web application in ASP.NET/

Currently I use Visual Studio 2008 SP1 and there have been many issues with images not loading and request handling that Fiddler has helped me solve. it is by far one of the best web debugging tools out there.

You can grab it at http://www.fiddler2.com/fiddler2/
target="_blank"


For now if you put http://localhost./ (NOTICE THE DOT) it will work with Visual Studio

Timed out waiting for a program to execute. The command being executed was "C:\WINDOWS\Microsoft.NET\Framework\v3.5\vbc.exe"

Well today was boatloads of fun. I make a quick change to an aspx file in a DotNetNuke project and all the sudden the site started to hang. After about 10 minutes or so I got the following error:

Timed out waiting for a program to execute. The command being executed was "C:\WINDOWS\Microsoft.NET\Framework\v3.5\vbc.exe"/noconfig @"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\2e8bd0df\9885eac5\lqud30cx.cmdline".

So first thing I thought is since this file was in the skin of my DotNetNuke site that the compiler must have detected a change in the code and tried to recompile. I must have broke soemthing , right?

No, as I restored the site filesystem with a backup and did a restore of the SQL 2008 Database. I still get the same error:

Timed out waiting for a program to execute. The command being executed was "C:\WINDOWS\Microsoft.NET\Framework\v3.5\vbc.exe"/noconfig @"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\2e8bd0df\9885eac5\lqud30cx.cmdline".

So, what gives, I looked around and cannot find an answer to this issue. Microsoft tells me to do this:

• Reinstall the asp.net (aspnet_regiis –u then aspnet_regiis -i)
• Gave required permissions on ASPNET account by running aspnet_regiis -ga ASPNET


For anyone who doesn't know the actual command it is:

This will uninstall ASP.net:

C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/aspnet_regiis -u

This will install ASP.net:

C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/aspnet_regiis -i

When I ran the install I got the following error at the command line:

...............
Finished installing ASP.NET (2.0.50727).
Setup has detected some errors during the operation. For details, please rea
e setup log file C:\DOCUME~1\USERNAME\LOCALS~1\Temp\1\ASPNETSetup_00005.log

Now, when I look at the log, I see this in the log:

Failure Creating directory: E:\MYWEBAPP\aspnet_client: CreateDirectoryInternal failed with HRESULT 80070003: 'The system cannot find the path specified. '

This error only occurs on the .Net application where this error started.

I then deleted the aspnet_client directory and ran aspnet_regiis -u
and then aspnet_regiis -i

My issue still remains. I also made sure the security account permissions were correct.

I also stopped IIS and all related services and deleted the asp.net temp files located in c:\Windows\Microsoft.NET\Framework\v2.0.50727\

This did not help

At this time I have no resolution...

UPDATE:


Try to run the app pool under the identity "LOCAL SYSTEM"

Then run IISREST

load your page.

If this works check the framework folders or what was my major issue is your temp folder, in my case C:\Windows\Temp . Make sure NetworkService has proper permissions. Add full permissions to confirm this isn't the issue.

Now, I know this permission was there so, some how it just dropped off, which is just plain odd. Did take some updates recently and this didn't become an issue until I made a code change which forced IIS to recompile the site.

This server is now back up and running.
Buy Me a Beer

Amazon1