简体   繁体   English

在 Visual Studio 2010 中将项目添加到项目

[英]Adding projects to a project in Visual Studio 2010

I'm developing an application that uses Managed WiFi .我正在开发一个使用Managed WiFi的应用程序。 Normally I would just add the.dll to the project, but this library comes as a regular VS project.通常我只会将 .dll 添加到项目中,但这个库是作为常规 VS 项目提供的。 How do I use it in my program?如何在我的程序中使用它? I tried adding Interop.sc and WlanApi.cs to my project, but WiFi classes are not recognised.我尝试将 Interop.sc 和 WlanApi.cs 添加到我的项目中,但无法识别 WiFi 类。

Visual Studio works with solutions and projects . Visual Studio 适用于解决方案和项目 You want to add your Managed WiFi project to your existing solution您想将托管 WiFi 项目添加到现有解决方案中

and then reference that project from your own project然后从您自己的项目中引用该项目


(source: programming4.us ) (来源: programming4.us

Just add the ManagedWifi project to your solution and then reference if from your main project (Add reference → Projects tab).只需将 ManagedWifi 项目添加到您的解决方案中,然后从您的主项目中引用(添加引用 → 项目选项卡)。

If you do not need to modify the source code of this managed wrapper.如果您不需要修改此托管包装器的源代码。 Just open the project in a separate Visual Studio and build it, grab the output library and add it to your project.只需在单独的 Visual Studio 中打开项目并构建它,获取 output 库并将其添加到您的项目中。

Add it to your solution by clicking File |单击文件 | 将其添加到您的解决方案中。 Add then select existing project.然后添加 select 现有项目。

Find the.csproj file and select that.找到 .csproj 文件和 select 文件。 This will add it into your Visual Studio solution.这会将其添加到您的 Visual Studio 解决方案中。

In the project you want to use this new project, right-click References and Add reference.在您要使用这个新项目的项目中,右键单击引用并添加引用。 You can then select the new project and it will be usable in your main project now.然后,您可以 select 新项目,它现在可以在您的主项目中使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM