I'm getting the “missing a using directive or assembly reference” and no clue what's going wrong

后端 未结 8 765
鱼传尺愫
鱼传尺愫 2020-11-29 06:29

I\'m trying to allow a user to enter data into a textbox that will be added to the web.config file. I\'ve added the relevent lines to the web.config file but when I make thi

相关标签:
8条回答
  • 2020-11-29 06:59

    This problem would be caused by your application missing a reference to an external dll that you are trying to use code from. Usually Visual Studio should give you an idea about which objects that it doesn't know what to do with so that should be a step in the right direction.

    You need to look in the solution explorer and right click on project references and then go to add -> and look up the one you need. It's most likely the System.Configuration assembly as most people have pointed out here while should be under the Framework option in the references window. That should resolve your issue.

    0 讨论(0)
  • 2020-11-29 07:00

    I had the same problem earlier today. I could not figure out why the class file I was trying to reference was not being seen by the compiler. I had recently changed the namespace of the class file in question to a different but already existing namespace. (I also had using references to the class's new and previous namespaces where I was trying to instantiate it)

    Where the compiler was telling me I was missing a reference when trying to instantiate the class, I right clicked and hit "generate class stub". Once Visual Studio generated a class stub for me, I coped and pasted the code from the old class file into this stub, saved the stub and when I tried to compile again it worked! No issues.

    Might be a solution specific to my build, but its worth a try.

    0 讨论(0)
提交回复
热议问题