Recently, I installed Ubuntu Linux desktop on my computer. Before the installation, I had Windows XP. I got a bigger hard drive and I did partition on HD as 2 partitions. I plan to set a dual boots system, one for my Windows and another for Ubuntu.
My previous HD also had two partitions, that was done by HP, one small one for backup systems. I used Norton Ghost to do a partition image of my Windows and after I install the new HD, I restored my windows. That safes me a lot of time to reinstall my application and configure my working environment. So far so good.
The Ubuntu was installed successfully, and it is very impressive. I am going to further to investigate the OS.
My Windows works fine. However, I encountered a problem while I was compiling a solution project. I got a message saying that "The volume does not contain a recognized file system, ...". The build was failed because the binary files could not be created. I checked my path. It is fine. The message is very misleading.
Finally, I figured out the problem. It is the environment var Temp. I set this one to my "D:\temp". After the dual OS systems was set up, the D: partition was not available any more. What I did is to format the missing partition D:. After that, all the temporary files can be created and there is no problem to build my solution.
Sunday, June 17, 2007
Building Solution Failure: binary files could not be created
Posted by D Chu at 12:52 PM 0 comments
Labels: Windows
Signing a Solution for publishing
For publishing application by click-once to deploy, I found that I have to set all the assemblies or projects to sign with a key file (pfx). In the project which is the start one, you have to make sure the Certificate option is checked in project's property Signing tab and make sure this certificate was generated by the same key file. Otherwise, you will get an error message saying failure to run tool SignTool.
After every thing are built correctly, you may use internet explorer to link to the URL which was set in the solution's property (Publication Location). Click on Install to deploy the application. You may have download the setup.exe installation file first. You will get an application file such as Bankshell.application. Still you cannot run the application in your downloaded folder. You have find the file in your URL location, where you can click on Bankshell.application to install the application.
This is just a note for me as a reference. I got this problem while I was doing exercises of Lab 5:
Posted by D Chu at 12:36 PM 0 comments
Labels: Visual Studio Tips
Tuesday, May 08, 2007
Add Microsoft.Practices.CompositeUI.WinForms components to VS ToolBox
I installed Microsoft Pattern & Practices Composite UI Application Block (CAB) in my box (CBA_CS.msi). Howerver I could not find Microsoft.Practices.CompositeUI components in my VS Toolbox.
What I did is to Browser components from the dialog window and find the file (Microsoft.Practices.CompositeUI.WinForms.dll) in:
C:\Program Files\Microsoft SCSF\GuidancePkg\bin
Before I add these components, I create a tab in Toolbox "MSPP CompositeUI" and then add those components there.
Posted by D Chu at 12:28 PM 0 comments
Labels: CAB/SCSF
Saturday, May 05, 2007
DetailView/GridView/FormView and ObjectDataSource (APS.Net 2.0)
I found one thing interesting about web UI controls and ObjectDataSource control in APS.Net. The background story of this finding is that I tried to create a business logic layer (BLL) with a method to update some data in a database through those web UI controls.
My BLL, ProductsBLL, has a method UpdateProducts() with a list parameters corresponding some fields defined in a table Products, such as productName, unitPrice, unitsInStock, unitsOnStock, reorderLevel, etc. Somehow, I mistyped some field names in the parameter, for example, reorderLeve. That's OK. It is just a parameter for a cs class method.
I tried to configure my ObjectDataSource in an aspx page through ODS' wizard. The mistyped parameter name is auto-generated in aspx file as followings:
<asp:ObjectDataSource ID="ObjectDataSource" runat="server"
DeleteMethod="DeleteProduct" InsertMethod="AddProduct"
SelectMethod="GetProducts" TypeName="ProductsBLL"
OldValuesParameterFormatString="{0}" UpdateMethod="UpdateProduct" >
<DeleteParameters>
<asp:Parameter Name="productID" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="productName" Type="String" />
<asp:Parameter Name="supplierID" Type="Int32" />
<asp:Parameter Name="categoryID" Type="Int32" />
<asp:Parameter Name="quantityPerUnit" Type="String" />
<asp:Parameter Name="unitPrice" Type="Decimal" />
<asp:Parameter Name="unitsInStock" Type="Int16" />
<asp:Parameter Name="unitsOnOrder" Type="Int16" />
<asp:Parameter Name="reorderLeve" Type="Int16" />
<asp:Parameter Name="discontinued" Type="Boolean" />
<asp:Parameter Name="productID" Type="Int32" />
</UpdateParameters>
In the web UI control(DetailView/GridView/FormView) section, I also used the same ODB control through GetProducts() methods in ProductsBLL, which returns a ProductTable with correct field names (for example, ReorderLevel). As a result, my aspx page got an expception when I tried to update a record. The exception's message is something like this:
ObjectDataSource 'ObjectDataSource' could not find a non-generic method 'UpdateProduct' that has parameters: ProductName, SupplierID, CategoryID, QuantityPerUnit, UnitPrice, UnitsInStock, UnitsOnOrder, reorderLeve, Discontinued, ProductID, ReorderLevel.
Notice that reorerLeve and ReorderLevel appear in the error message. The first one is the one defined in parameter list, and the next one is the field in UI control. They have to be matched! Otherwise, they both are used to make a method call to ProductsBLL, which results method not matching exception.
In addition to this finding, I find that the case is not sensitive for matching parameter names to UI field names for updating. I hope it would be better in a UI field definition where you can use a new attribute to specify which parameter is matched for updating/editting/deleting. By explicitly specifying a parameter, there would no need to couple ProductsBLL method's parameters to UI field names.
Posted by D Chu at 1:34 PM 0 comments
Labels: ASP.NET
Friday, April 27, 2007
DataSet 2.0 Issues
When I tried to use Visual Web Developer 2005 Express to compile a project with TypedDataSet, I got some warning message for compling. Basically, these warning messages are about some XML attributes for DataSet not being declared. For example:
Warning 2 The 'ParameterPrefix' attribute is not declared. G:\Datadc\Programming\ASP.Net\Data Tutorials\DT01\App_Code\Northwind.xsd 8 231 G:\...\DT01\
I googled solution to find out why and to remove these warning. Here is a link about this issue. In short, these attibutes are not defined in VS IDE's xsd file. I could to add these attributes there but it is not recommended. Steve Cheng from Microsoft Online Help said that you can ignore these messages and the build should be fine.
That's a good explaination for this issue.
Posted by D Chu at 10:47 AM 0 comments
Labels: Visual Studio Tips
Tuesday, April 24, 2007
SQL 2005 Express error regarding generating new instances
Recently, I installed Microsoft SQL 2005 Express. Late on, I encounted a problem to open a database from Visual Web Developer 2005 Express. The error message is something like:
Generating user instances in SQL Server is disabled. Use 'user instances enabled' ...
I think the problem was caused by my installtion of SQL-Tools for adding Reporting services. I googled through web and found a solution to solve the problem from this link MSDN143684. Here are some steps:
- Open Microsoft SQL Server Management Studio Express
- Open a query and type in: Select * from sys.dm_os_child_instances. This will list all the users instances.
- Comment out the above line. Type in the commands:
RECONFIGURE;
GO
Then open a project in VWD, and try to open a db again. The db was opened without error message.
I think there is a configuration in SQL to set either shared DB or new instances. If it is shared DB, no new instances are created.
Posted by D Chu at 7:48 AM 0 comments
Labels: SQL
Monday, April 23, 2007
SQL Server Report Service Installation
Here are my nodes about installation of SQL Server Report Service.
My OS is Windows XP Pro. I installed .Net 2.0 Framework for learning ASP.Net purpose. Then When I needed SQL Server Report Service and Report Studio for creating report projects, I had to install IIS 5.1.
After I installed IIS5.1, then I installed SQLEXPR_ADV.exe which includes SQL Report Service. I got a program to browse //localhost/Reports/. The error message is "Failed to access IIS metabase".
The problem is caused by the fact that .Net 2.0 and ASP.Net 2.0 was installed before IIS. The solution is to run aspnet_regiis.exe in a cmd console (at .Net framework 2.0 folder):
aspnet_regiis -i
what this one does is to install and configure APS.Net 2.0 again. After that, the problem is solved!
One IIS related issue: do not use IP number in IP Adress (IIS configuration tool for Detault Web Site). It should be (All unassigned). I think the reason is that I don't fix IP and my IP is dynamically assigned through my router.
Through IIS configuration tool (from Control Panel|Administration Tools or MMC), you can set/add virtual directory, how to access the web page, and what is the default page. Many more settings can be done there.
Report Service configuration problem: use the tool from Microsoft SQL Server 2005|Configuration Tools|Reporting Service Configuration. Make sure all the settings are correct (checked V). I did not set Reporting Service Virtual Directory because it was checked V. However, it was not set and empty. After I accepted the default settings. My SQL Reporting Service page (//localhost/Reprots/) is opened!
Posted by D Chu at 9:18 AM 0 comments
Labels: SQL
Thursday, January 19, 2006
Array var in Managed(.Net) C++
In managed C++, define an array variable for a managed class, in syntax, is different from standard C/C++. For example,
using System::Drawing;
//...
array<PointF, 1>^ pointsF = gcnew array<PointF, 1>(100);
// PointF pointsF[100]; // is wrong
// PointF pointsF[] = gcnew PointF[100]; // is wrong
//...
pointsF[0].X = 11.23f;
pointsF[0].Y = 0.54f;
where PointF is a structure defined in System::Drawing namespace.
For String class, you have define an array of String as:
array<String^, 1>^ s = gcnew array<String^, 1>(10);
//String^ s[] = gcnew String^[10]; // wrong again
The general format to define an array of type is:
[qualifiers] [cli::]array<[qualifiers]type1[, dimension]>^ var =
gcnew [cli::]array<type2[, dimension]> (val[,val...])
See MSDN on Array Keyword
Posted by D Chu at 2:35 PM 0 comments
Labels: C++
Wednesday, January 11, 2006
Windows Installer Problem
Some times I got anoying error messages when I tried to open some applications such as VB6.0. The message is like a dialog window with the message:Setup is aborting now. Cannot detect file: mediainfo.ini
This is caused by Windows Installer when I tries to find some files based on Registry settings. For example, I removed some binary files which were installed by Windows Installer but I could not find Uninstaller for those files or I could not run uninstaller successfully.
Here are some steps to avoid these messages:
Locate missing files
- Open Event Viewer from Administration Tools.
- View property for the most recent warning messages in Application node, and make a note of missing file, for example, "C:\MyTools\Bin\Interop.Utility.dll".
- Open RegEdit
- Locate to "My Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer"
- Search for the file with path found above. Note, do not include drive like "C:" in the search string.
- You should find a key like this: "...\UserData\S-1-5-18\Components\D1311F8CC3D78BB42BCF6A". Under this one you will find a key Item with a value like "C?\\MyTools\Bin\Interop.Utility.dll".
- What I do first is to find the missing files and copy them to a folder like "C:\MissingFiles\Installer\"
- Then I change the registry key item's value to "C?\MissingFiles\Installer\Interop.Utility.dll".
I am not sure if I should remove these registry keys or not. For safe purpose, I try to find missing files and udpate registry instead.
Posted by D Chu at 9:10 AM 0 comments
Labels: Windows
Friday, November 04, 2005
WMI class
Here are two entries I posted to my Yahoo blog, regaring the problem of using WMI class to query memory stat and a solution in case of memory > 4GB.
Problem of using WMI class to query memory stat when memory size > 4GB.
A solution of getting memory stat.
I change to Blogger to continue my posting because I found that Yahoo's blog does not have tag feature.
Posted by D Chu at 9:50 PM 0 comments
Friday, May 21, 2004
My First Blog Entry
Blog is not new for me, but I have never tried to set up one. This is my first try. I don't know how long I'll keep it. Good start!
Posted by D Chu at 9:03 AM 0 comments
Labels: Blog