Installation of Namespace

Asked

Viewed 320 times

0

I have a test project that came without the Namespace System.Web.Helpers and others. I searched and didn’t find it. I should be, but it’s not. How to install the guy? Well, I can hunt on the internet and add, but since I think it’s a basic namespace, I wonder if there’s any way to install it to be available for all my projects. I’m not talking about installing a reference, that’s not the problem, but installing the Assembly and it becomes available to everyone. Just find the DLL on the internet and install? The Framework is the 4.0.

  • I don’t know if I understand, but I think you want to put in the GAC http://www.codeproject.com/Tips/5817/Installing-a-DLL-into-the-Global-Assembly-Cache-GA Documentation of the https://msdn.microsoft.com/en-us/library/ex0ss12c(v=vs.110).aspx. I’m not sure if this is a good idea..

  • What type of project?

  • Like I said, it’s not adding a reference, it’s not that. Is to install the namespace in Visual Studio, so that this DLL is available to any project. I am without this dll in my VS and need it for many things, many projects.

2 answers

2


That one Namespace can be installed using the NuGet in the way visual or using the console. For more information about this package visit website.

To open the console you can use ALT + T N O (ALT + T afterward N afterward O) in visual studio and type the following command:

PM> Install-Package microsoft-web-helpers
  • I understood Leandro, by Nuget. I thought I had to download somewhere first, then take this DLL and add it to the corresponding folder, but this would not install, IE, whenever I needed that reference I could not install, because I did and could not. Thank you.

  • Lenadro, that way it didn’t work. Maybe it’s the package name that is wrong, because the namespace would be: system.web.helpers, system.web.mvc and system.web.webpages, these are the namespace I need to install.

  • I discovered the error. It was not a point(.) but a hyphen(-), it would look like this: pm>Install-Package microsoft-web-helpers

  • Then it was the other package, now yes ;)

0

In fact, what is missing from your project is a reference to some library (dll). The namespace is only an organization structure and is available if the dll providing it is referenced correct in the project.

To do so, just call add the reference to your project and it will become available.

If the dll is from a third party (not from another project of your own or from Microsoft - part of the framework) you need to keep it close to the application and sometimes perform some installation procedures in the environment where it will run.

If it’s just a framework reference, just add it to your project and everything will be fine. Be careful when working with external references, incorrect versions or compilations for different architectures can cause problems in your application with some ease.

In this link you can see how to add a reference in Visual Studio: https://msdn.microsoft.com/pt-br/library/wkze6zky.aspx

In the very place where you find the reference, just search the home "helpers"

  • Valeu Intruso, ms as I said in the post, is not add a reference but add Namespace in Visual Studio. I’m without him so I could add his reference. But for Nuget, I think I can do it. I thought there was another way, but I only knew this one, through Nuget.

  • @pnet, I understand that the answer does not solve your problem, but it is of great interest to you. The namespace is the code-level organizational structure of a library (physics). A reference should be made to the library to then have access to it from its namespaces.

  • @Caiquec., I don’t understand your comment. What I said in the post is that the dll was not installed and would like to know how to do and the Intruder has already answered me. The answer yes, solved my problem. I didn’t understand, but ok, no problem.

  • @pnet is that in the comment above, you said, "[...] is not adding a reference but adding Namespace to Visual Studio.". To add Namespace you need to add the reference to the project, without it you do not have access to the namespaces.

  • So for me to add the reference I need it to be installed in the VS, right? Then I go in ADD References, select Assembly and mark the reference I want to install, right? Well and if there is not that installed? I need to install it first and then reference it, right? That’s exactly what’s going on. I don’t have Assembly system.web.mvc and etc. I have already installed and opened another post as it is giving a version incompatibility error.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.