You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Xamarin.Forms安卓项目编译错误:Csc任务OutputAssembly参数异常

Fix for "OutputAssembly" Parameter Error in Xamarin.Forms Android Project

Hey there, sorry to hear you're stuck with this CSC task error after resolving the earlier IO exception in your cross-platform Xamarin.Forms project. Let's go through practical fixes to get past this issue:

  • Clean and Rebuild Your Solution Thoroughly

    • First, right-click your solution in Visual Studio and select Clean Solution to clear existing build artifacts.
    • Navigate to your Android project's directory manually and delete the bin and obj folders—sometimes the IDE's clean command misses leftover files that cause conflicts.
    • Rebuild the solution, starting with your shared/PCL project first, then the Android project.
  • Verify Android Project Output Settings

    • Right-click your Android project → Properties → Build → Output.
    • Double-check that the Output path field only contains a single valid directory, with no duplicate entries or extra semicolons.
    • Head to the Advanced build settings (under the same Build tab) and confirm the Output file name isn't configured to generate duplicate assembly files.
  • Manually Fix the Project File (.csproj)

    • Close Visual Studio entirely, then locate your Android project's .csproj file and open it with a text editor (like Notepad++ or VS Code).
    • Search for <OutputAssembly> entries—you might find duplicate lines pointing to the same DLL path, like this:
      <OutputAssembly>obj\Debug\Test.Droid.dll</OutputAssembly>
      <OutputAssembly>obj\Debug\Test.Droid.dll</OutputAssembly>
      
    • Delete one of the duplicate lines, save the file, then reopen your solution in Visual Studio and rebuild.
  • Check for Duplicate References or NuGet Conflicts

    • In your Android project's References section, make sure you don't have duplicate references to Test.Droid.dll or any related assemblies.
    • Open the NuGet Package Manager for your solution, check for any outdated or conflicting packages, and try updating them or reinstalling the Xamarin.Forms-related packages.

If none of these steps resolve the issue, you could also try resetting Visual Studio's component cache, or even creating a new blank Xamarin Android project and migrating your existing code/files over—occasionally project files can get corrupted in hard-to-spot ways that cause these odd build errors.

内容的提问来源于stack exchange,提问作者Deep Soni

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.29 08:08:52