![]() \.\ClassLibrary1\ClassLibrary1\bin\x86\Debug\netstandard2.0\ClassLibrary1.dll \.\ClassLibrary1\ClassLibrary1\bin\圆4\Release\netstandard2.0\ClassLibrary1.dll \.\ClassLibrary1\ClassLibrary1\bin\圆4\Debug\netstandard2.0\ClassLibrary1.dll Then, use four ItemGroup elements with all combinations of settings, as follows: For example, suppose the binary you're referencing is ClassLibrary1 and there are different paths for Debug and Release configurations, as well as x86 and 圆4 versions. To set up your project to use these references, first add the reference, and then open the project file and edit it to add an ItemGroup with a condition that references both the configuration, and the target platform. NET assembly or DLL that has both x86 and 圆4 versions. Referencing x86 and 圆4 assemblies and DLLs You can set RegisterAssemblyMSBuildArchitecture to the desired platform architecture (such as x86 or 圆4) by adding it to a top-level PropertyGroup element in the project file. There is a property you can set to override this behavior, RegisterAssemblyMSBuildArchitecture. If you set the platform architecture using the methods described previously in this article, or specify a different PlatformTarget in the project file, MSBuild will respect that when registering. If you're building in Visual Studio, that's 圆4 in Visual Studio 2022 and later, and x86 in Visual Studio 2019 and earlier. NET assembly that’s built for Any CPU, MSBuild defaults to registering it for MSBuild's current runtime. ![]() If your assembly already targets a specific platform, then that is used, but if you're registering a. NET assembly and exposing it to COM, Visual Studio registers the assembly with a particular platform architecture, since there are different registry locations for each platform architecture (for example, x86 and 圆4). Manually editing a C++ project file that you're using in Visual Studio isn't recommended. The tool that processes the project file is MSBuild. An example is when you have conditions that can't be specified in the IDE, such as a reference that is different for two different platforms, or an assembly that must be registered for a particular platform in order to expose it to COM. Sometimes, you need to manually edit the project file for some custom configuration. See the following links for more information:įor Visual Basic projects, see /platform (Visual Basic).įor C# projects, see Build page, Project Designer (C#). Performing this task varies based on the programming language you're using. If selecting one of the platforms included in the list in the New Solution Platform dialog box doesn't work for your solution, you can create a custom configuration name and modify the settings in Project Properties to target the correct platform. The Project Designer or Project Properties UI also provides a way to target different platforms with your project. Target platforms in the Project Designer or Project Properties UI The solution-level platform is shown in the Active solution platform dropdown, and the table shows the project-level platform for each project. ![]() To see both project-level platform and solution-level platform settings, open Configuration Manager and note the two platform settings. When you choose x86 as the solution configuration, Visual Studio selects the Win32 platform for C++ projects. C++ projects use Win32 and 圆4, but the solution platforms use x86 and 圆4. Visual Studio considers both project-level platforms and solution-level platforms, and the project platforms come from the language-specific project systems. The Win32 platform name is used for C++ projects, and it means x86.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |