0

I have researched this topic and pulled up a couple of hits that I thought might have helped me. So far I am still pulling out my hair over here because everything was fine until I added a field to a table in Azure and then tried to update my model.

Here's a short sitrep of what the problems have been and what I have done to solve them.

Problem 1
Compiling transformation: Metadata file 'C:\Program Files\VS2013\Common7\Tools..\IDE\Microsoft.Data.Entity.Design.dll' could not be found

Compiling transformation: Metadata file 'C:\Program Files\VS2013\Common7\Tools..\IDE\EntityFramework.dll' could not be found

I solved the problem by changing my global environment variable in advanced system properties to the correct location of these files, which in my case was : F:\Program Files (x86)\Common7\IDE

This is probably due to the fact that I just installed VS 2013 ultimate on my F drive; however, I have been developing on it successfully now for a week and never had a problem until now.
After this I run into problem 2:
Problem 2
A namespace cannot directly contain members such as fields or methods C:\Users\Adrian.Campos\Documents\Visual Studio 2013\Projects\ConsoleApplication2\ConsoleApplication2\Model1.cs 1 1 ConsoleApplication2

As you can see the problem is arising from my Model1.cs class. My .edmx file is named model1 (fyi)

I found some links that weren't of help to me since my error is coming from a different source than that of the links.

VS2012: My Entity Framework model doesn´t get included to my project output using InstallShield
A namespace cannot directly contain members such as fields or methods.
A namespace cannot directly contain members... + Type or namespace definition, or end-of-file expected errors

That last link seemed the most promising; however, it did not fix my problem. What I do not understand is how in the world did everything just blow up after I updated my model?

Has anyone else experienced this and fixed it?

Community
  • 1
  • 1
Adrian
  • 3,332
  • 5
  • 34
  • 52
  • Adrian, did you figure out what happened? I have a similar situation going on now. Last Friday I was working fine and yesterday when I came in, I added a field to the DEV database and when I tried to compile I received the "A namespace cannot directly contain members such as fields or methods" error. I even tried rolling back the changes and even tried going into my TEST environment thread (where no changes have been made to the db or to the code) and am getting the same error. – John Oct 21 '14 at 12:57
  • Unfortunately I did not find out what the error was. It was something with references that was going wacky. I ended up re-installing visual studio. Sorry! – Adrian Oct 22 '14 at 16:31

0 Answers0