Loading

including-generated-files

نگه‌دارنده dotnet

مهارت targetهای MSBuild را اصلاح می‌کند تا فایل‌های تولیدشده در build در compilation و output قرار گیرند. جزئیات اجرایی، شرایط استفاده و محدودیت‌های آن در متن مرجع زیر حفظ شده است. متن مرجع: Fix MSBuild targets that generate files during the build but those files are missing from compilation or output. USE FOR: generat

نسخه فعلی
نامشخص
مجوز
MIT
دسترسی شبکه
نامشخص / ارزیابی‌نشده
وضعیت بررسی
تأیید نشده

چه مسئله‌ای را حل می‌کند؟

مسئلهٔ targetهای MSBuild را اصلاح می‌کند تا فایل‌های تولیدشده در build در compilation و output قرار گیرند. جزئیات اجرایی، شرایط استفاده و محدودیت‌های آن در متن مرجع زیر حفظ شده است. متن مرجع: Fix MSBuild targets that generate files during the build but those files are missing from compilation or output. USE FOR: generated source files not compiling (CS0246 for a type that should exist), custom build tasks that create files but they are invisible to subsequent targets, globs not capturing build-generated files because they expand at evaluation time before execution creates them, ensuring generated files are cleaned by the Clean target. Covers correct BeforeTargets timing (CoreCompile, BeforeBuild, AssignTargetPaths), adding to Compile/FileWrites item groups, using $(IntermediateOutputPath) instead of hardcoded obj/ paths. DO NOT USE FOR: C# source generators that already work via the Roslyn pipeline, T4 design-time generation that runs in Visual Studio, non-MSBuild build systems را با قابلیت‌های تصریح‌شده در منبع حل می‌کند.

چه زمانی مناسب است؟

وقتی targetهای MSBuild در build فایل می‌سازند اما فایل در compilation یا output نیست، از این مهارت استفاده کنید: خطای CS0246، task سفارشیِ نامرئی برای target بعدی، glob با زمان expand نادرست یا نیاز به Clean target. برای تنظیم BeforeTargets در CoreCompile، BeforeBuild یا AssignTargetPaths و Compile/FileWrites و $(IntermediateOutputPath) نیز مناسب است؛ برای C# source generatorهای Roslyn، T4 design-time در Visual Studio و build system غیر-MSBuild استفاده نشود.

targetهای MSBuild را اصلاح می‌کند تا فایل‌های ساخته‌شده هنگام build در compilation و output قرار گیرند. برای خطای CS0246ِ فایل source تولیدشده، task سفارشی که فایلش در targetهای بعدی دیده نمی‌شود، globهایی که پیش از ایجاد فایل expand می‌شوند، و پاک‌سازی فایل تولیدی در Clean target است. زمان‌بندی BeforeTargets شامل CoreCompile، BeforeBuild و AssignTargetPaths، افزودن آیتم‌های Compile/FileWrites و $(IntermediateOutputPath) به‌جای مسیر obj/ ثابت را پوشش می‌دهد. برای source generatorهای C# در Roslyn pipeline، تولید design-time با T4 در Visual Studio یا build system غیر-MSBuild استفاده نشود.

نصب و به‌روزرسانی

این دستورها فقط برای کپی نمایش داده می‌شوند و روی سرور RefHub اجرا نمی‌شوند. پیش از اجرا، منبع بالادستی پیوندشده را بررسی کنید.

دستور نصب
npx skills add dotnet/skills --skill including-generated-files -y

سازگاری با ایجنت‌ها

هنوز تست سازگاری ثبت نشده است

تا وقتی شواهد تست ثبت نشده، سازگاری این مهارت با ایجنت‌ها را تأییدشده فرض نکنید.

منبع و وضعیت بررسی

توضیح بالا معرفی ساختاریافتهٔ کاتالوگ است و بازبینی تحریریه‌ای آن ثبت نشده؛ اطلاعات فنی و وضعیت راستی‌آزمایی جداگانه نمایش داده می‌شوند.

آخرین بررسی منبع
ثبت نشده