The scenario is to port one of the ASP.NET starter kits from Windows to Linux using cross-platform of choice (like Grasshopper, Mono, PHP, Macromedia and so on). We can use existing SQL Server (which ASP.NET TimeTracker already works with) or any other database like MySQL, PostgreSQL and so on.
Among the 4 choices I decided to go ahead with Grasshopper. Although Mono is a very good too.
TimeTracker starter kit is proven to work with SQL Server, I didn't want to fix it when it is not broken. I simply choose to use Hosted SQL Server instead of migrating to MySQL, PostgreSQL and so on.
The project uses SQL Server 2000 and ASP.NET using C# (can be done using VB.NET too).
There are situations where a ASP.NET project has to be migrated to Linux. Some companies seem to have this senario. The typical solution is that they take the .NET Project code and then convert it into java code so that they can run on Linux as shown below.
Converting .NET code to Java code for each project is a solution. But Grasshopper guys though about the solution like a Grasshopper (started looking from ground level - grasshopper is at ground level usually). Their solution is very nice. Any .NET code compiles down to .NET Assembly which depends on .NEt Libraries. They wrote libraries for .NET in java. They use this to do the conversion of .NET code to Java bytecode directly, making it easy to run it on Lunix.
We will address the issues that occur during the Windows to Linux porting process. Practically we discover and solve all the issues during build and testing time. For this project the easiest issues are build time errors or warning.
warning JC8000: Not Implemented Element 'customErrors' warning JC8000: Not Implemented Element 'sessionState' warning JC8000: Not Implemented Element 'pages'All these warnings are from web.config file and are due to the fact customErrors, sessionState and pages are unsupported elements. The solution is to comment them out in web.config.
<add key="ConnectionString" value="server=localhost;Trusted_Connection=true;database=TimeTracker" />The problem seems to be that my starter kit installation was using 'localhost' for server in web.config's ConnectionString's property. I had to change it to 'HOME' (my home PC). Then I discovered that it had troubles connecting using 'Trusted connection', as my SQL Server didn't give any permission. I changed the connection string to use username/password instead of Trusted connection as below...
<add key="ConnectionString" value="server=HOME;Trusted_Connection=true;database=TimeTracker;user id=sa;password=" />Issues #2 fixed. Note: It looks like we have to rebuild whenever we change the connectionString in web.config, otherwise the application is not picking it up.
catch (Exception ex)
{
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-us");
}
Remove or comment out the (Exception ex) to remove the warning. The resultant code should look like below... catch // (Exception ex)
{
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-us");
}
| You must Sign In to use this message board. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||