0
votes

I make simple Azure app with ASP.NET MVC 3 (Razor) and SQL Server 2008 Express. And have this mistake: "error CS0234: The type or namespace name 'WindowsAzure' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)"

in this View:

@foreach (var item in Model) { // error string
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.TextThought)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id = item.IdThought }, new { id = item.IdThought }) |

Method in controller:

public ActionResult Index()
    {

        return View(db.GetThoughts());
    }

Method contents:

public IQueryable<Thoughts> GetThoughts()
    {
        return _db.Thoughts;
    }

Please Help me, Somebody.

3

3 Answers

0
votes

It sounds like you are missing or misspelt reference. Check your using statements and project references are all correct.

0
votes
  1. Can you provide us with your using statement?
  2. Why did you need that reference? I only use explicit Azure classes for table and blob storage.
  3. Are you sure you added a reference to that assembly as the error message suggests?
0
votes

There is very simple way you can repro this problem. Try creating a sample MVC3 ASP.NET Web Role first and then remove the the reference "Microsoft.WindowsAzure.ServiceRuntime" and you will hit the exact same error where ever you will reference the methods coming out from your Microsoft.WindowsAzure.ServiceRuntime.

So the problem could that you have missing reference to "Microsoft.WindowsAzure.ServiceRuntime" in your application and to solve this problem you would need to add the correct reference.

The DLL is located at as below:

C:\Program Files\Windows Azure SDK\_SDK_Ver(v1.6)_\ref\Microsoft.WindowsAzure.ServiceRuntime.dll