Wednesday, May 20, 2020
Delete old file command line script for Schedule Task
Schedule a task with a trigger to delete the files you wish.
Example Script:
ForFiles /p "C:\dev\CardsDirect\Development\Preview\PlateFiles" /s /d -5 /c "cmd /c del @file"
ForFiles /p "C:\dev\data\Project Outputs\PlateFiles\Production" /m *.jpg /s /d -5 /c "cmd /c del @file"
ForFiles /p "C:\dev\data\Project Outputs\PlateFiles\Production" /m *.pdf /s /d -5 /c "cmd /c del @file"
Monday, May 26, 2014
Hostgator: How to clear the ASP.NET Application Pool from Parallels Panel
Don't have a hostgator account? you can get one by using this coupon link to claim your hosting under $4.00.
I contact support asking to find a way to do this from Parallels and they told me there is no way to do that. They can reset it for me when I wish to. Well, that doesn't work for me. I am not going to sit and wait 13 min in the chat window to get an agent on the line and ask them to please reset the application pool for my website.
The Workaround:
If you are a developer you probably already know this work around.
Edit the web.config via the web management panel in Parallels or FTP the updated web.config via the ftp and the application pool should reset automatically. But you don't have experience you can easily do these easy steps from the Hostgator Hosting Panel for Windows.
Follow these Steps:
1) Login to Hostgator Parallels Panel Web Interface
2) Under the Websites & Domains, location your website and find the ASP.NET Settings Link
4) Save the changes by clicking on the OK button.
Friday, May 16, 2014
Visual Studio Deploying DatabaseProject Error Could not find DATABASE.SQLPERMISSIONS
Error message: Could not find a part of the path 'C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 10.0\COMMON7\IDE\PROPERTIES\DATABASE.SQLPERMISSIONS'. C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 10.0\COMMON7\IDE\PROPERTIES\DATABASE.SQLPERMISSIONS
The first thing I did was check the history of the database project and yet there was nothing unusual that had changed. Then I check to see if I actually had that file in the path that it was given and nope I did not had it. Obviously vs.net was looking at the wrong path. The file did existed within the database project path \properties\ folder.
The answers on stackoverflow.com did not helped me at all.
Then I remembered about the metadata files so I went into the location of the database project file and removed the *.dbmdl files and the .user files associated to my database project file.
In order to remove those files I had to first unload the db project from visual studio, otherwise you get an error. That did the trick. Load the project again and I was able to successfully deploy the database project.
Wednesday, March 26, 2014
JSON Webservice Error There was an error processing the request
Any ways after looking and trying different things I found that the issue was with the max response limit was exceeding. Of course it was hard because there was no detail error log information any where. The webservice class was not throwing any particular exception. IIS was just return the Error 500 with this message.
Message":"There was an error processing the request.","
The FIX:
Simply added this to the web.config where the .ASMX class lives and the problem was solved.
<system.web.extensions>
<scripting>
<webServices>
<jsonSerialization maxJsonLength="50000000" />
</webServices>
</scripting>
</system.web.extensions>
Tuesday, February 11, 2014
How to remove a TFS Workspace Mapping?
Error:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Build.targets (806): The path c:\builds\bizproj\QA\Sources\Configuration2.0 is already mapped in workspace LOCALBUILD02_72_2;
Go to the build machines and delete the files under this folder.
C:\Users{UserName}\AppData\Local\Microsoft\Team Foundation\3.0\Cache
After you clear that trigger a new build and see the results.
Friday, January 24, 2014
Windows 7 Device and Printers not loading. Issues with Printer Spooler service.
I right click and restart and immediately the Devices and Printers on the Control panel load up. However, I was not able to print. I tried to read the device and nothing would come up.
I continue to had this issue for several days. When an application like snag-it or Word or Excel would hang up, I restarted the Printer Spooler and it worked right away. So I thought this freaking Printer Spooler is corrupt. I tried finding help online but no help at all. I end up finding about Restarted the Bluetooth Service. This was not helpful for me at. However, it looks like for several users it did helped. So give that a shot first if your Devices and Printers is now loading in Windows 7 or possible in Windows 8.
What you want to do is make sure you start up the services:
1) Bluetooth Service
2) Bluetooth Support Service.
If after your start or restart this services you still have the issue like me, try the following:
1. Go to the Start menu and type REGEDIT. Then right-click on REGEDIT and select 'Run as Administrator'.
2. Go down to the following key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Environment\Windows NT x86\Print Processors Under Print Processors there should be a folder called 'winprint'. If it's there delete and recreate it. if it's not there create it.
3. To create the 'winprint' folder and key, right-click on 'Print Processors' and select 'New' - 'Key'. Type in winprint Now, select the new winprint folder and right-click in the black white space to the right where the sub keys should be and select 'New' - 'String Value'.
Type in Driver for the name. Double click driver and enter in winprint for the value.
4. Now try installing the printer.
I found this from the Microsoft website http://answers.microsoft.com/en-us/windows/forum/windows_7-hardware/windows-7-add-printer-does-not-work/f7d4e46e-7f5a-48fa-b8db-d709d57494ac
After doing this I was able to add a new printer and all my printer spooler issuer where gone.
Wednesday, December 15, 2010
jQuery hasClassName prototypejs function: How to check if element has class with JQuery
if($('#target').hasClass('foo')){
// Do something
}
// With Prototype js you would use...
if($('target').hasClassName('foo')){
// Do something
}
jQuery check element is visible : How to check if div is visible with jQuery
This is how you can determine if an element is visible.
<div id="target" style="display:none"></div>
if( $('#target').is(':visible') ) {
// this element is visible
}
// Check if its hidden
if( $('#target').is(':hidden') ) {
// this element is hidden
}
Tuesday, December 14, 2010
jQuery add class to element: How to add a class to a div
// With JQuery
$('#target').addClass('bar');
// With Prototypejs...
$('target').addClassName('bar');
// Removing a class with Jquery
$('#target').removeClass('bar');
// With Prototypejs...
$('target').removeClassName('bar');
Once again, jQuery has shorter function names which is awesome!
Wednesday, October 13, 2010
Linq Lamba Expressions Performance Problems SingleOrDefault Super Slow
Wednesday, August 25, 2010
SDC Tasks Failed to Update IIS website on Windows Server 2008 R2 IIS7
static void Main(string[] args)
{
try
{
string MachineName = "LOCALQA01";
var Identifier = GetIdentifierFromDescription("LOCALQA01", "Acme.com").ToString();
string path = @"D:\websites\app_offline\Acme";
// load the site
DirectoryEntry site = new DirectoryEntry("IIS://" + MachineName + "/w3svc/" + Identifier + "/ROOT");
// make the changes we need to make
if (!string.IsNullOrEmpty(System.IO.Path.GetFullPath(path)))
{
// Log.LogMessage(string.Format("Setting Path: {0}", path));
site.Properties["Path"][0] = path;
}
site.CommitChanges();
Console.WriteLine(Identifier);
}
catch(Exception ex){
Console.WriteLine(ex.ToString());
}
Console.ReadLine();
}
public static int GetIdentifierFromDescription(string machineName, string description)
{
// load the W3SVC and check all the children for a property that matches
DirectoryEntry de = new DirectoryEntry("IIS://" + machineName + "/W3SVC");
foreach (DirectoryEntry o in de.Children)
{
if (o.SchemaClassName == "IIsWebServer")
{
if ((string)o.Properties["ServerComment"][0] == description)
{
return Convert.ToInt32(o.Name);
}
}
}
return 0;
}
Bu when I run this from the build machine I was then getting this error:
[System.Runtime.InteropServices.COMException] {"Unknown error (0x80005000)"}
System.Runtime.InteropServices.COMException
Unknown error (0x80005000)
at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
at System.DirectoryServices.DirectoryEntry.Bind()
at System.DirectoryServices.DirectoryEntry.get_IsContainer()
at System.DirectoryServices.DirectoryEntries.CheckIsContainer()
at System.DirectoryServices.DirectoryEntries.Find(String name, String schemaC
lassName)
Without going to further details the caused of this error was because I did not had IIS 6 Metabase Compability role service installed for IIS7 on the build machine where I was running the scripts from. You can installed this by going to :
Server Manager > Roles> Web Server (IIS) > Add Role Services

Thursday, August 19, 2010
How to disable flash debugger Error Messages in FireFox
You can disable this by creating a file mm.cfg under your users settings folder
Windows Vista / Windows 7:
c:\users\
Enter this in this file and save it.
SuppressDebuggerExceptionDialogs=1
Restart Firefox and the errors will no longer show.
If you need to display the debugger error messages set the value to:
SuppressDebuggerExceptionDialogs=0
Wednesday, August 11, 2010
IIS 7 WebResource.axd forbidden Windows Server 2008
HttpException: Because your server does not support reflection or you set the attribute 'reflectionAlloweded="false"', You must specify a non-autogenerated machine key in your web.config to compress Webresource.axd
System.Web.HttpException
Mensagem: Because your server does not support reflection or you set the attribute 'reflectionAlloweded="false"', You must specify a non-autogenerated machine key in your web.config to compress Webresource.axd
Source: MbCompression
at Miron.Web.MbCompression.WebResourceCompressionModule.ThrowHttpException(Int32 num, String SRName)
at Miron.Web.MbCompression.WebResourceCompressionModule.GetDataFromQuery(NameValueCollection queryString)
at Miron.Web.MbCompression.WebResourceCompressionModule.OnPreRequestHandlerExecute(Object sender, EventArgs e)
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
This issue is generated via the MbCompression library used to dynamically compress requests for Javascript files including the WebResources in asp.net 2.
My web.config does not have any configuration settings in the web.config for the Mbcompression library. The solution is very simple and was fixed by adding the Machinekey in the web.config in the section.
Thursday, July 29, 2010
IIS 7.5 Windows Server 2008 R2: Access Denied Permissions
I'll just be short about this error. New to IIS 7.5 Windows Server 2008 R2 and have issues with permissions write access on folders that the application is using?
Write Access to folders will not cut it by simply giving permissions to IUSR or IIS_IUSRS group.
If the application pool is using “ApplicationPoolIdentity” this means that the application pool has its own user account.
You need to add the App Pool use to that folder and give it access.


Wednesday, July 28, 2010
Puerto Vallarta Apartments is now in English
Please feel free if you have any comments or suggestions about the this website. I am open to hear from any one.
Tuesday, July 27, 2010
Verizon's Router has issues when you connect 3 or more devices drops Internet Connections
Recently I have been working from home for often and got another computer connected in my LAN network. After this change I started noticing internet drops very often. So I contacted Verizon Technical Support (let me say that I hate Verizon’s call centers, you have to enter a hundred keys to get to the right agent). Any ways, tech support did some trouble shooting and made changes to the router etc. Problem still persists.
I called again, they send a technician to troubleshoot it and he just replaced the router and was out of the door in less than 5 minutes. OK it was fine for 2-3 days and then the problem again.
I called tech support again and yes again they send over another technician which he just change my router from Ethernet to Coax cable. It was good for 1 day and then the problem as still going on. The internet was dropping every 5 minutes. It was actually recycling the entire router powering itself on and off. I had three machines connected via Ethernet cable and 2 devices on the wireless network. Normal activities except for one machine which I might be transferring 1-2 Gigs of data, but noticed that the drops were occurring even If I wasn’t at home, as long as the computers where connected the internet was dropping. By this time I was already in the 3rd router.
Technical support sent another technical and he stayed for a while until he visually saw the drops himself. This time he decides to replace the box outside and put in a brand new router (same router of course Verizon only carries one type of router). Any ways I believe it worked at least for 4-5 days and Yes again the same problem. This was a nightmare I could not do my work and it was embarrassing with my clients when I had video conference calls and online meetings since it will drop my internet connecting on random times.
Frustrated, I called Technical support again and they put their Special Team on the line and said that it might be a problem on their central office so they said they were going to change me to another slot. That probably means to another server. Not sure but it worked for 1 day and still the same problem. Finally they send another technical to my house again and said dude you have 4 computers connected. I am like “So” it’s a router it was four Ethernet ports it’s mean to handle that. And he responded “Normally not a lot of people use all ports, they have 1 or 2 computers connected”. I asked if Verizon had another router perhaps the business account might come with a different router and he said “no, it’s the same router”. So it occurred to me that it’s possible that the router had an issue since they had replaced almost everything from my house to their central office. I decided to connect an ether hub and plugged in all my devices there and only connect the hub to the Verizon router and that did it. Since then connections have only dropped 1 or 2 times, still not a perfect solution but what am I doing to do. They are the only ones that have the speeds that I want.
Tuesday, July 06, 2010
Debugging Flash Player Actionscript errors. How to get the amf response.

Just found out about a very useful tool that allows you to see the request and response for amf types when flash makes a request to the server. Fiddler does not show the actually data that comes back from the server. But there is this tool called AppPuncher that shows in details the amf response with the request arguments and the return data or any error information.
Thursday, June 24, 2010
Puerto Vallarta Real Estate | Bienes Raices
I have recently got interested in the real estate market in Puerto Vallarta Mexico. As result I did an investment in Mexico to build a 6 unit apartments in downtown Puerto Vallarta. After searching for several deals I finally pulled the trigger on a 260 square meters lot where I plan to build 6 apartments that will built with similar designs here in the United States. As results since I am a developer of course I decided to create my own website here I would be listing my apartments for rent and after 1 month I launched this website to find real estate properties in puerto vallarta. Decided to setup the site for public visitors to find apartments for rent or sale, homes, condos, lots, villas and vacation rentals in puerto vallarta and bahia de banderas like Buceria, nuevo vallarta, sayulita, punta mita and others. I integrated several Google API to do things like translations from Spanish to English. My goal is to allow Mexican users to post their ads in their native language and like my site handle the North America market in United States and Canada.
The type or namespace name 'Office' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
After installing Visual Studio 2010 on the new server I found this error.
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets (1360): Could not resolve this reference. Could not locate the assembly "Microsoft.Office.Interop.Excel, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
I had a project referencing Microsoft.Office.Interop.Excel.dll with the path
C:\Program Files\Microsoft Visual Studio 9.0\Visual Studio Tools for Office\PIA\Office11\Microsoft.Office.Interop.Excel.dll
If you did not installed the office tools for visual studio 2010 you can download the PIA VSTO Install here http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=06c32242-2289-4471-93aa-ce96aa5cbc36
I went to the project and updated the reference to use the new path for VS.NET 2010 using %ProgramFiles(x86)%\Microsoft Visual Studio 10.0\Visual Studio Tools for Office\PIA\Office14 and it compiled perfectly fine.


