Sunday, August 25, 2013

HOW TO LightSwitch Webdeploy

This post assumes that you have a VPS or Dedicated Windows Server hosted and you want to host your LightSwitch Application on it.

Requirements:
Development Machine:


  • Visual Studio with LightSwitch
Production Machine(Hosted Server)
  • IIS 6/7/8
  • Microsoft Sql Server
  • WebDeploy
  • Web Platform Installer
Installing Web Deploy:



To install WebDeploy we will be using Microsoft’s Web Platform Installer (WebPI) 4.0. You can download WebPI here.
Once you’ve downloaded WebPI, launch the installer. In the search bar, type in, “Recommended”. We want to select “Recommended Configuration for Hosting Providers” by clicking Add…
WebPI Installer
If you click the “Items to be installed” link at the bottom, you can see a list of what will be installed. Anything the has an “X” beside it can be removed. For example if you do not want or need PHP and its components you can remove them.
Notice the WebDeploy features about half way down:
WebDeploy 3.0
In this walkthrough, I’ll be leaving all the components for this configuration. Next, click Install. Then, once you Accept the License Agreements, your installation will begin:
Install WebDeploy
Once that completes, you can close WebPI.
Next we’ll want to create a local non-admin user that we will use with WebDeploy. Open Server Manager, and then select Computer Management.
Server manager
Once Computer Management loads, navigate to Local Users and Groups, then right-click the Users folder and select New User. In my example, I created a new user “GabeWebDeploy”.
Make sure you remember or document this password. You’ll need it later.
Local Users and Groups Username and Password
We also should go ahead and create a WebDeploy folder to contain our Publishing settings for later. I created a WebDeploy folder in: C:\inetpub. This simplifies the management of Publishing Profile management.
WebDeploy Folder
Next, open up IIS Manager, Control Panel > Administrative Tools > IIS Manager. When you launch IIS Manager, you will get the following prompt:
IIS Manager
Click the “Do not show this message” checkbox if you would like and then click “No” hown above. Clicking Yes will just take you back to the website where you download Web Platform Installer.
For this walkthrough I also created a new website, “Gabe OW Webdeploy Test”. We now need to edit the WebDeploy Publishing Settings. To do this, select your site and then right-click Deploy > Configure WebDeploy Publishing…
WebDeploy Test Site
Now we need to change some settings here on the Configure WebDeploy Publishing window:
WebDeploy Configuration Settings
Click the … next to the top line that begins with Servername\Username. We want to change this to the new WebDeploy user we created earlier.
Pro Tip: We want to use a non-administrator account and NOT and administrator level account, as we want to contain the server access of the user account to this site/application for security purposes.
As of this writing in the Server 2012 RTM version, you’ll need to enter the username in the Servername\Username format as the clicking the Select… function will close IIS. This appears to be a bug.
Allow User
After you enter the username, go to the line that says, “Specify a location to save the publish settings file” and change the path to the WebDeploy folder we created earlier. Change “C:\Users\Username\” to new path: “C:\inetpub\Webdeploy\”. Then click Publish. See screenshot example:
Configure WebDeploy Publishing
After you click Setup a publishsettings file will be created at that folder.
Copy that file into the Development Machine.

Publishing Using Visual Studio

Open your project in VS Lighstwitch.
Right Click on the properties of the project and click publish.


In the Application Server Configuration click on Import Settings and select the publish Settings file.



Then in the database connection pane click the button highlighted below.
It will take you to the database connection settings.I suggest you to do this way because it will remove any anomalies that may occur in connection string due to human error.



Then click on the publish to publish the app to server



ENJOY :)

Tuesday, October 30, 2012

Workaround for importing Foreign Keys in Entity Framework 4 in VS 2010 with MySql

Well this was another BIG issue I faced when designing database for my application.
I decided to use Entity Framework 4 for ORM and C# as my development language and Ms Sql Server 2008 as my backend.
But then there some issues with its license so I wished to switch to MySql as my DB.After designing the whole databse from scratch in MySql I found that the EF4 was not generating foreing keys and the navigation properties in its EDMX i.e its data model.
I was really frustrated after desinging the whole Db from scartch and then it was not working in EF4.
As usual I googled it and no help from ther also....I did not found any proper solution for that.
Then as aiming arrow in the dark I thought of trying MySql Migration ToolKit and BINGO.
so the Workaround......
Go to Mysql Migration Toolkit
Import the database from MsSql Server into Migration Toolkit
Then from Visual Studio import the Model in EF4 as usual.
Hope this works for you guys also....!

Wednesday, July 20, 2011

Free Ms Access Password Recovery

This little tool here was a life saver for me .
Well as per the title this tool recovers the password for your Microsoft Access Database in case you have lost it.
Its Free , Its written in JAVA and do not show only 3 or 4 characters which other trial or demo recovery softwares do and which is really frustrating.This little tool recovered me a full fledged 12 characters long password which had upper and lower case characters and digits also.
All the credit goes to its creator Yongxin Zhao.
Its an executable jar file,so you need to have the Java installed in order to execute it!
Link!
Dropbox Link
http://db.tt/7QYiOuC