Tuesday, December 7, 2010

IIS 7.5 clickonce application Config error

one of my team member reported me that he is unable to USE 7.5 as clickone deployment server, upon downloading click one application system was throw an exception in the log files that it is unable to download the ****.exe.config file. when i browsed the file IIS showed me 404.7 :The request filtering module is configured to deny the file extension.
which simply means that file is in restricted extensions.
so to resolved this issue i went to IIS manager then website then request filtering and then i added .config ext as allowed type. in file names extension tab.
remember to use this only when there is nothing special in the config files.
this can also be done by web.config using following article.
http://www.petefreitag.com/item/741.cfm
some more details here

Crystal Reports Viewer in Sharepoint

I have an issue Regarding Crystal Reports.
I have created sharepoint 2007 web application and deployed it to the server, whcih have some reports. All Reports are working fine on Production site, but the Navigation images in toolbar of Crystal Reports. I pasted aspnet_client folder to Sharepoint site directory as well as in root Directory too. but havn't got that images. then i made virtual directory and gave permissions, but still not getting images on toolbar.
Solution
it usually causes problem better to use webpart for crystal reporting available here
http://jsiegmund.wordpress.com/2007/08/20/crystal-reports-web-part-for-moss-2007/
or
http://beta.codeproject.com/KB/sharepoint/CustomCRWP2.aspx?msg=3288957

follwoing actions willl also help to show images if aboove both not work


Solution 1:

1. In your WebPart override Render method. Within this override extract output HTML and replace “CrystalImageHandler.aspx” with something like this “CrystalImageHandler.xxx”. Render new HTML.

2. In web.config replace CrystalImageHandler.aspx with CrystalImageHandler.xxx within tag.


Now all CR image requests will be processed by CrystalDecisions.Web.CrystalImageHandler. I think this solution is pretty self-explanatory. Let me know if you need the source code on how to alter output HTML within Render override.


Unfortunately, SP team still did not allow us to have any httpHander tags in the web.config, so they suggested to create a layout page called CrystalImageHandler.aspx (goes into _layouts directory), inherit that page from our own class and process image request programmatically. So, here is



Solution 2:

Within code behind of CrystalImageHandler.aspx page on Page_Load event place this code:

Dim hndlr As New CrystalDecisions.Web.CrystalImageHandler
hndlr.ProcessRequest(Context)

You will still have to override Render method of your WebPart and replace CrystalImageHandler.aspx path with something that will look like this:

sNewHTML = Regex.Replace(sCurrentHTML, “/CrystalImageHandler.aspx”, “/_layouts/your_folder_within_layouts_directory/CrystalImageHandler.aspx”).

Now you need to delete httpHandler tag from web.config.
------------------------
Rename the CrystalImageHandler.aspx file to a different extension, so the MOSS handler won’t pick it up. Offcourse you’ll have to alter the web.config to include a handler to the correct file.
Place a custom made CrystalImageHandler.aspx file in the TEMPLATE/LAYOUTS directory of the 12 hyve. Now write a regex which will replace all calls to the old imagehandler with a call to that file which will be in the _layouts directory of your web app.

Blue Screen Error when update to SPS 2007

i belive the problem is due to installtion failure of .NET 3.0 so i have downloaded the new framework and now gona try it you can download the entire insllation of .net 3.0 from MS site link is
http://go.microsoft.com/fwlink/?LinkId=70848

ADO.NET hierarchical data from database

i dont know why but i am unable to draw parentchild relations with this code in IE

_
Public Function ReceiveDataSet(ByVal CategoryID As String) As DataSet
Try
'Get the data from database and put it in the DataSet
Dim nwindConn As OleDbConnection = New OleDbConnection("Provider=MSDataShape;Data Provider=SQLOLEDB;" & _
"Data Source=.;Integrated Security=SSPI;Initial Catalog=northwind; user id=sa; password=123")
Dim custDA As OleDbDataAdapter = New OleDbDataAdapter("SHAPE {SELECT CategoryID, CategoryName FROM Categories where categoryID=" & CategoryID & "} " & _
" APPEND ({SELECT * FROM Products} AS Products " & _
" RELATE CategoryID TO CategoryID)", nwindConn)
Dim custDS As DataSet = New DataSet
custDA.Fill(custDS, "Categories")
Return custDS
Catch ex As Exception
HttpContext.Current.Response.Write(ex.ToString)
End Try

changing CD Key visual studio trial team suite

if you have trial version of VS 2005 and you are MSDN subscriber and have a valid licence key for a full verstion VS team suite or other version you can update by changing licence key at the end of setup.sdp located in setup folder of VS DVD.

this will save your time to redownload all 3.2 GB from subscribers download site.

NET System.IO.Compression and zip files

Today i observed an interesting thing in this name space I had a file of 713 kb
When i compressed this file it got a new side of 738KB and when I decompressed this file again it got 712 kb. interestingly file sized increased which I observed on many forum.

http://www.eggheadcafe.com/articles/20011231.asp
http://dotnetslackers.com/Microsoft/re-25702_NET_System_IO_Compression_and_zip_files.aspx
http://pluralsight.com/blogs/craig/archive/2004/03/19/1266.aspx
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=179704&SiteID=1
http://blogs.wdevs.com/marcclifton/archive/2005/11/22/11303.aspx


some lines from my code. i think i am too old to play with code now

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim sf As System.IO.FileStream = New System.IO.FileStream("c:\test1.doc", FileMode.Open)

Dim ds As System.IO.FileStream = New System.IO.FileStream("C:\test2.doc", FileMode.CreateNew)

Dim Compressedfile As System.IO.Compression.GZipStream = New System.IO.Compression.GZipStream(sf, CompressionMode.Decompress)

'Dim byteData(sf.Length) As Byte

'sf.Read(byteData, 0, sf.Length)

'Compressedfile.Write(byteData, 0, byteData.Length)

'Dim destinationfile(Compressedfile.Length) As Byte

'Compressedfile.Read(destinationfile, 0, destinationfile.Length)

'Dim sw As StreamWriter = New StreamWriter(ds)

'sw.Write(destinationfile, 0, destinationfile.Length)

'ds.Write(destinationfile, 0, destinationfile.Length)

'ds.Close()

Dim data As Object

Do

data = CType(Compressedfile.ReadByte(), Integer)

If (CType(data, Integer) = -1) Then

Exit Do

End If

ds.WriteByte(CType(data, Byte))

Loop While (CType(data, Integer) <> -1)

End Sub

ReportViewer Credentials on SQL server 2008 R2

While migrating a project from VS 2005 to VS2010 and to a new version of SQL server i Came across an issue where we need to pass access credentials to the report viewer before showing any report. following code snippet help to resolve exception which will arise if you do not provide reporting server credentials.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Security.Principal;
using System.Net;

///
/// Summary description for CustomReportCredentials
///

[Serializable]
public class CustomReportCredentials : Microsoft.Reporting.WebForms.IReportServerCredentials
{

// local variable for network credential.
private string _UserName;
private string _PassWord;
private string _DomainName;
public CustomReportCredentials(string UserName, string PassWord, string DomainName)
{
_UserName = UserName;
_PassWord = PassWord;
_DomainName = DomainName;
}
public WindowsIdentity ImpersonationUser
{
get
{
return null; // not use ImpersonationUser
}
}
public ICredentials NetworkCredentials
{
get
{

// use NetworkCredentials
return new NetworkCredential(_UserName, _PassWord, _DomainName);
}
}
public bool GetFormsCredentials(out Cookie authCookie, out string user, out string password, out string authority)
{

// not use FormsCredentials unless you have implements a custom autentication.
authCookie = null;
user = password = authority = null;
return false;
}

}

Monday, December 6, 2010

IIS 7.5 WebResource.axd and ScriptResource.axd not found

Last week i deployed a web application on a new server. the site was containing wordpress blog and posting, when i took the web online i observed that my AJAX toolkit is not working. so i started debugging the problem. after spending couple of days and 30 hours i concluded that it is due to some handler which is not allowing the runtime files to be shown because each time i try to browse a webresource it throw 404 page not found. i was using Windows server 2008 R2 so i observed in the handler that each request which blongs to a web resouce which does not exists is actually routed to php/wordpress engine. who then evalute this request as valid or not so it was my issue. some people suggested that i have to use static url path for web resource which was not possible due to extensive change. so this was the issue
script src="/ScriptResource.axd?d=6jlaIZUKRXg3wAiiwb5CXRLLE4-Gm23NRJYO6UGKsEfKVWmmRDjpjYUxUQc3rzA15AxvjFMTyyBHnHZwnp436Rh4PelOuGVzY5dYg0oEc1rFylLCCtLPLtzdaF9l9sPZW6Nu8_s0HdGhCknizdMILSk85R81&t=634213836780000000" type="text/javascript".
many solution like these
http://stackoverflow.com/questions/3822733/ajaxtoolkit-iis7-asp-net-4-0-sys-is-not-defined-handler-mapping-issue

http://efreedom.com/Question/1-3822733/AjaxToolkit-IIS7-AspNet-40-Sys-Defined
http://geekswithblogs.net/lorint/archive/2007/03/28/110161.aspx
http://geekswithblogs.net/ranganh/archive/2007/07/15/113963.aspx
so looked over the net for the solution since it has been many days i could not remember the linke but following the solution.
in web.config section
System.webservrer
<rewrite> <rules> <rule name="wordpress" patternsyntax="ECMAScript">
<match url=".*"> <conditions> <add negate="true" input="{REQUEST_FILENAME}"
matchtype="IsFile"> <add negate="true" input="{REQUEST_FILENAME}" matchtype="IsDirectory">
<add negate="true" input="{URL}" pattern="\.axd$"> </conditions> <action
url="index.php" type="Rewrite"> </rule>


Tuesday, January 15, 2008

QuickBooks dependent client application installers

ast week we were busy in the deployment package of ERP related installer. There were number of issues that we found in this exercise and I am documenting those for the future reference. Following items were found to be culprit and they need to be taken care during any installer developed for quick books related items.
  1. Qbfc6.dll is a dynamic link library which is a COM component. Ideally all component can be copied anywhere in the computer as per definition of COM and they are accessible to other applications. But unfortunately qbfc6.dll can only be registered in program files –> common files–> QuickBooks folder. The reason of the problem is that dll entry point qbfc6.dll is located in some other module. So any installer which is using qbfc6.dll must have the ability to register this dll from above mentioned location. So far no document available for this problem.
  2. QBFC merge module is the second area which needs to be focused. As per documentation this merge module is responsible to install and copy the interops (inter-operatablity .net wrappers) and copy/register COM objects to the location mentioned above. But in actual merge modules only copy the files to the location and they do not register any component.
  3. If you have installed QBSDK 7.0 there are three different versions of Interop files. By default these interops are registered to global assembly cache but no documentation is available which describes this feature of these interop files. These versions are 6.0.0.174, 7.0.0.134, 6.0.0.137 no SDK document mentions that a new version qbfc6.dll interop is a part of QBSDK 7.0.
  4. You can create interop of any COM file by just adding the reference of COM to your .net project but in case of qbfc6.dll you have to use the interops provided by quickbooks not the one generated by VS 2005.

So any installer which is developed for QuickBooks related project must be able to copy the qbfc6.dll to common files, and then register from this location. All QBFC Interops must be register to GAC (global assembly cache) and they should be available at application path for the applications. All project using QBFC 6.0 must use the itnerops developed by QuickBooks not the one generated by VS 2005.

Friday, December 7, 2007

Compaing managment tool

Today me and my team is searching for good CRM with compaign managment feature. none of the good software provides all features related to customer requriment. i think we should go for a custom one.
there are not multi compaign fetures and lot more that we need. i have not idea now wat to do.

BizTalk 2006 is unable to validate the Char data Type of SQL server 2005

we ll i am posting the same bolg again so it will be more short this time

the problem is if you use generated items from SQL adapter for a stored procedure with Char data type as parameter or you use an update gram with char data type of SQL server you will be unable to validate the generated schema. i observed this thing couple of months back so thought to share it with other.

the resolution is to change either the data type of the table field if your table filed is not critical or change the type of Stored procedure parameter. alternatively you can change the data type of schema from Char to xs:string

hope everybody will be able to understand it

Thursday, June 7, 2007

MS CRM migration/redeployment to new domain servers

Deploying or redeploying Microsoft® CRM 3.0 to a second system is a multi-step process that involves:

· Several manual procedures

· The use of standard backup and restore procedures and utilities

· A wizard designed specifically for this process

The wizard is the Microsoft CRM Redeployment Wizard. Using this wizard and the processes described in this document, a

system administrator or software developer can copy and use their Microsoft CRM data in another Microsoft CRM

implementation separate from the original system.

The following are some examples of redeployments that you can make using these tools, processes, and procedures.

On a separate Microsoft CRM implementation with its own Active Directory forest and domain that is not connected to

the original Active Directory forest and domain.

Step 1: Back Up the Databases

Make a copy of or back up the Microsoft CRM databases. Perform the following tasks before copying the databases:

Step 2: (Optional) Back Up Customizations, Workflow, and Custom Reports

Important: Customizations, workflow, and customized reports are not redeployed using the Redeployment Tool. If you want your redeployed Microsoft CRM system to have the customizations, workflow rules, or custom reports from your source Microsoft CRM system, you must back them up manually and restore them to your redeployed system manually.

Step 3: Install Servers and Configure Users

Install all server applications for your new implementation, including:

• Active Directory domain controllers

• Microsoft SQL Server

• Microsoft Exchange Server (optional)

Step 4: Restore the Microsoft CRM Databases

Step 5: Complete the Microsoft CRM Redeployment Wizard

Step 6: Install Microsoft CRM

Install Microsoft CRM on the computer in the new system and make sure to select the Connect to existing database option during setup. Each Microsoft CRM implementation must have the appropriate license.

Step 7: (Optional) Import Customizations,

Workflow Rules, and Custom Reports

Known Issues

Microsoft Windows Operating System Additions and Database Triggers

If you want to install any Microsoft Windows® operating system enhancements or “add-on” programs or create or add any

custom database triggers (other than system defaults) to your new Microsoft CRM system, you must install them before

using the Microsoft CRM Redeployment Wizard. If you have installed the “add-on” programs or added any custom

database triggers, you must remove them, complete the redeployment process on the new Microsoft CRM system, and then

re-install them after you have verified that the new Microsoft CRM system is functioning.

The Microsoft CRM Redeployment Wizard Does Not Finish

If, for any reason, the Microsoft CRM Redeployment Wizard does not complete, you will need to do the following:

1. Delete the Organization_MSCRM and Organization_METABASE databases on the Microsoft SQL Server of your

new deployment. These database files should be located in the folder:

:\Program Files\Microsoft SQL Server\MSSQL\Data.

2. Start the redeployment process again at Step 4 in this document.

Installing Microsoft CRM Server always creates a log files that can be reviewed and used for troubleshooting. By default,

the location of the log files is:

:\Documents and Settings\User\Application Data\Microsoft\Microsoft CRM\Logs

Source CD-1 MSCRM server installer Redeployment Guide

Monday, May 7, 2007

RTHDCPL.EXE - Illegal System DLL Relocation

Back after couple of weeks basically i was busy in design sessions with different teams for new project this time come up with a new type of problem


i think Realteck Audio is unable to initialize and throws error some sort of


---------------------------
RTHDCPL.EXE - Illegal System DLL Relocation
---------------------------
The system DLL user32.dll was relocated in memory. The application will not run properly. The relocation occurred because the DLL C:\WINDOWS\system32\HHCTRL.OCX occupied an address range reserved for Windows system DLLs. The vendor supplying the DLL should be contacted for a new DLL.
---------------------------
OK
---------------------------


the problem finally resolved by installing a patch mentioned on the follwing page


http://support.microsoft.com/default.aspx/kb/935448/


interestingly Microsoft patch worked this time

Saturday, April 7, 2007

Using Windows Fax Service to Send Fax using C#

somebody Asked this question to me and i thought it would be easy to search rather than to dig

so here it is from http://www.binaryspectrum.com/knowledge_bank/send_fax_using_CSharp.htm

In todays world, while building an application you might run into scenarios where you need to send a Fax from the application. And to a certain extent this is very much required, because I would not want take a print out and go to a fax machine to send a fax. Why cant it be sent from my application?

It is very simple to send a fax using Windows 2000 Fax Service in C#. The application makes use of FaxCom.dll that ships with Windows 2000. This dll is usually located in C:\WINNT\system32 folder. Within the VS.NET IDE, adding a reference to this DLL generates the equivalent Interop.

You can than use the following code to send a fax.

FaxServerClass fs = new FaxServerClass();
fs.Connect("mymachine"); //specifies the machinename
object obj = fs.CreateDocument("myfilename");
FaxDoc fd = (FaxDoc)obj;
fd.FaxNumber = "myfax#";
fd.RecipientName = "Tester";
int i = fd.Send();
MessageBox.Show(i.ToString());
fs.Disconnect();

Prior to using this, we must make sure to attach the Fax modem, install its drivers and see if the modem is shown within the Device Manager. This same code will also work on Windows 2003 and Windows XP Operating systems.

Now that you have implemented a system which will send a fax. Well what about if you want to receive a fax. Well writing all that would mean serious trouble keeping in mind the small time frame you will have to develop your applicaiton. Well every Fax Server, receives a fax as an image and stores it in a Folder (You can see the destination folder path in the properties). There is also an option to save a copy of the incoming fax to a specific folder. Just set these changes, and write a code which will display the contents of that folder and thats it. You are done with your Fax Integration for your application.

Wednesday, March 7, 2007

An exception occurred while trying to synchronize the state of service 'SharePointPSSearch' to Running. The operation will be retried in 4 minute(s).

i think that problem can be resolve only by reinstalling or repairing SPS so i am going for repair option. lets see what happens after that.

Thursday, December 7, 2006

“craxdui.dll” and “crviewer9.dll”; the file “craxdrt9.dll” is not getting registered.

Following are the reasons for the problem that I identified during long session of conversations.

Crystal 9.0 is basically a managed code but it can be used as COM objects in VB 6.0 applications. So instead of runtime libraries we need complete of reusable DLL files which is around 26 files
Crystal Report 9.0 have almost 7 services packs due to huge number of problems in this first release of managed code we need to make sure that we have latest services pack on developers machine before creating a setup of the project.
create a new installer including all files mentioned below and then install on client machine.

sacommoncontrols.dll ,
filedialog.dll ,
crdb_dictionary.dll ,
p2ixbse.dll ,
CRAnalyzer.dll ,
sscdlg.dll ,
sscrc.dll ,
keycode.dll ,
u2ddisk.dll ,
u2ftext.dll ,
crtslv.dll ,
ExportModeller.dll ,
crxf_xls.dll ,
crxf_wordw.dll ,
crxf_rtf.dll ,
crxf_pdf.dll ,
sscsdk80.dll ,
exlate32.dll ,
querybuilder.dll ,
crdb_odbc.dll ,
crdb_dao.dll ,
crdb_ado.dll ,
crqe.dll ,
Implode.dll ,
u25samp1.dll ,
u25dts.dll ,
u252000.dll ,
u2lfinra.dll ,
u2lexch.dll ,
u2ldts.dll ,
u2lcom.dll ,
u2l2000.dll ,
ufmanager.dll ,
crtowords_en.dll ,
unicows.dll ,
craxddrt9.dll ,
craxdrt9.dll ,
crviewer9.dll ,


above files are included basically in PD wizard

Tuesday, November 28, 2006

about:Tabs

well i think i should make it since IE 7 is launched by MS with these words in each empty tab :)

Blue Screen Error when update to SPS 2007

i belive the problem is due to installtion failure of .NET 3.0 so i have downloaded the new framework and now gona try it you can download the entire insllation of .net 3.0 from MS site link is
http://go.microsoft.com/fwlink/?LinkId=70848

Virtual Machine Reset Error Code (13)

since last two months facing this problem tried everything i know about computers and VMs finally found a solution which very basic.
if you are facing similar problem simply disable the hyper threading from setup and this problem will be resolved.

Friday, December 23, 2005

CRM tools

Today me and my team is searching for good CRM with compaign managment feature. none of the good software provides all features related to customer requriment. i think we should go for a custom one.
there are not multi compaign fetures and lot more that we need. i have not idea now wat to do.