VS2013 … WebDeploy

If you have an existing web server with web deploy already installed and you are creating a new VS 2013 webapp to deploy.

  1. Before you set up a publish profile in VS2013, you should go to the web server and create the new website manually first via IIS.
  2. Then you can create the publish profile in VS2013.
  3. “Server:” is the web server name.
  4. “Site name:” is the website you created manually via IIS.
  5. “Destination URL:” is optional.  You can leave it blank.

image

http://msdn.microsoft.com/query/dev12.query?appId=Dev12IDEF1&l=EN-US&k=k(WebApplicationProjects.PublishDlg);k(TargetFrameworkMoniker-.NETFramework,Version%3Dv4.5)&rd=true

Troubleshoot VS2013 WebApi with Fiddler

If you run client code in VS to test against a webapi in VS2013’s IIS Express, Fiddler does not see the traffic, because you are using “http://localhost:8080”.

The work around is to use “http://machinename:8080”.  But that won’t work with IIS Express; you can the error 400 saying invalid hostname.

So the work around is to modify the applicationhost file. 

  1. Find the IIS Express in your system tray. 
  2. Right click on it and select ‘Show All Applications’
  3. Select your site name.  Don’t click on the URL.
  4. Click on the “Config:” link.
  5. image
  6. Add a binding for your machine hostname:
  7. Restart VS 2013 (run as admin).

Note:

One can “add urlacl” to avoid the need to run VS2013 in admin.

 

Reference:

http://stackoverflow.com/questions/5433786/configure-iis-express-for-external-access-to-vs2010-project

http://msdn.microsoft.com/en-us/library/windows/desktop/cc307223(v=vs.85).aspx

Windows Azure SQL Database

Here are my strategies on setting up Windows Azure SQL Database for a development database with a developer login.

  1. Create a new SQL database on a new server.  You will get an assigned server. 
  2. Make sure you have a meaningful database server admin name.  Do not name it for a database “databaseXYZsa”.  Rather, name it like “dbserverXYZsa”.  Why? because you will probably add more databases to the same server and they all will share the same admin account.
  3. Use the admin account to connect to “master” database.  You cannot do “use master go”.  You have to configure a database connection, specifying “master” as the database.  Then you can create a login.
  4. CREATE LOGIN login1 WITH password='<ProvidePassword>';
  5. Then you can connect to your new database and add a user as an dbowner.

     

    reference: http://msdn.microsoft.com/en-us/library/windowsazure/ee336235.aspx

    Reset MySQL Root Password on Windows

    If you forgot the password for MySQL Root, then you need following the online instruction.

    1. I saved the update password and flush command to “resetpw.txt”
    2. Launch command prompt as an administrator.
    3. “C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld” –defaults-file=”C:\Program Files\MySQL\MySQL Server 5.1\my.ini” –init-file=D:\\resetpw.txt –console
    4. I included –console so that I can see any error right away.
    5. After I reset the MySQL server, I verified by running a command prompt and typed “mysql –u root –p” and entered the password when prompted.

    How to troubleshoot Entity Framework SQL Error Exception “String or binary data would be truncated”

    If you get this error, it means you are trying to insert data of a length larger than the max length of a data column.  For example, you may be inserting “San Francisco” to city varchar(10).

    Now, the problem is identify which column is the culprit. I don’t see a way to determine the column from the run time exception.

    So you can try 2 other ways:

    1. Examine each field length of the entity being inserted and compare against the database schema.
    2. Use SQL Profiler to capture the SQL statement.  Then you could examine the length of each insert value.  Or you can use the process of elimination by setting each insert value to an empty string until your insert statement executes without error.

    VS2013 The project file has been moved, renamed, or not on your computer

    I was restructuring the solution/project folders.  When I try to add back the relocated projects, I got this error above.

    The solution is simple:

    1. Close your solution.
    2. Delete the solution’s .suo file 
    3. Reopen your solution.
    Reference:

    http://stackoverflow.com/questions/2002088/the-project-file-has-been-moved-renamed-or-not-on-your-computer