Error compiling project

1

I'm getting the following message holding the build in the project.

Error

  

The namespace can not directly contain members such as fields or methods

     

Files: Model1.cs Model1.Context.cs Line 1 Column 1

You can also view the error by clicking here .

Another thing, I have two HD on my machine. Visual Studio is installed on a partition on a partition other than the operating system.

When I add an Entity datamodel to the project, it looks in the C: partition for the Entity DLL reference. Only in the Model.tt file and when compiling the project it gives an error because it can not find the DLL in the path of the C: partition.

Does anyone know how to change this reference?

    
asked by anonymous 03.04.2016 / 10:51

1 answer

0

Well, the error message itself already says.

You can not insert variables or methods outside a class, it hurts the principle of object orientation.

Your class is probably very large, and you have not realized that you are trying to insert artifacts out of it. Just make sure that where you are entering it is inside the class keys. (Within Namespaces, you can enter only classes)

    
27.10.2016 / 15:17