gpt4 book ai didi

Unable to Copy the Media/Images from one project to the another on build in c# in VS 2022 in Wpf (using WindowsApp SDK)(无法将媒体/图像从一个项目复制到另一个项目(使用WindowsApp SDK))

转载 作者:bug小助手 更新时间:2023-10-25 21:54:49 26 4
gpt4 key购买 nike



I have these two csproj

我有这两个csproj


One the main project

其中一个主要项目


LIT

点亮


<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Label="Globals">
<SccProjectName>SAK</SccProjectName>
<SccProvider>SAK</SccProvider>
<SccAuxPath>SAK</SccAuxPath>
<SccLocalPath>SAK</SccLocalPath>
</PropertyGroup>
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
<WindowsPackageType>None</WindowsPackageType>
<UseWPF>true</UseWPF>
</PropertyGroup>

<ItemGroup>
<Content Include="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

<ItemGroup>
<PackageReference Include="iTextSharp" Version="5.5.13.3" />
<PackageReference Include="itextsharp.xmlworker" Version="5.5.13.3" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.4.230822000" />
<PackageReference Include="Nuctech.Xaml.Behaviors.Wpf" Version="1.0.2" />
<PackageReference Include="Prism.Unity" Version="8.1.97" />
<PackageReference Include="Prism.Wpf" Version="8.1.97" />
<PackageReference Include="Extended.Wpf.Toolkit" Version="4.5.1" />
<PackageReference Include="SuperJMN.Microsoft.Xaml.Behaviors.Wpf" Version="1.0.2" />

</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LIT.Core\LIT.Core.csproj" />
<ProjectReference Include="..\LITModels\LITModels.csproj" />
<ProjectReference Include="..\Modules\LIT.Modules.TabControl\LIT.Modules.TabControl.csproj" />
<ProjectReference Include="..\SQLDataAccessLayer\SQLDataAccessLayer.csproj" />
</ItemGroup>
</Project>

and the project where the images are stored
LIT.Core

和存储图像的项目LIT.Core


<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Label="Globals">
<SccProjectName>SAK</SccProjectName>
<SccProvider>SAK</SccProvider>
<SccAuxPath>SAK</SccAuxPath>
<SccLocalPath>SAK</SccLocalPath>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
<WindowsPackageType>None</WindowsPackageType>
<UseWPF>true</UseWPF>
</PropertyGroup>

<ItemGroup>
<None Remove="Media\Images\box-green.png" />
<None Remove="Media\Images\check.png" />
<None Remove="Media\Images\checked.png" />
<None Remove="Media\Images\delete.png" />
<None Remove="Media\Images\delimages.png" />
<None Remove="Media\Images\deticon.png" />
<None Remove="Media\Images\edit.png" />
<None Remove="Media\Images\folder-search2.png" />
<None Remove="Media\Images\folder.png" />
<None Remove="Media\Images\house.png" />
<None Remove="Media\Images\image_2023_06_30T13_35_12_642Z.png" />
<None Remove="Media\Images\LIV_interary_logo.png" />
<None Remove="Media\Images\LIV_logo.png" />
<None Remove="Media\Images\LIV_logo_3.png" />
<None Remove="Media\Images\login_bg.png" />
<None Remove="Media\Images\next-arrow.png" />
<None Remove="Media\Images\next_move.png" />
<None Remove="Media\Images\next_shift.png" />
<None Remove="Media\Images\null.png" />
<None Remove="Media\Images\paperClip.png" />
<None Remove="Media\Images\plus.png" />
<None Remove="Media\Images\prev-arrow.png" />
<None Remove="Media\Images\save.png" />
<None Remove="Media\Images\sell.png" />
<None Remove="Media\Images\sendEmail.png" />
<None Remove="Media\Images\tickimg.png" />
<None Remove="Media\Images\unchecked.png" />
<None Remove="Media\Images\warning.png" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="CommunityToolkit.Common" Version="8.2.1" />
<PackageReference Include="CommunityToolkit.Diagnostics" Version="8.2.1" />
<PackageReference Include="CommunityToolkit.HighPerformance" Version="8.2.1" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.1" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.4.230822000" />
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.39" />
<PackageReference Include="Prism.Unity" Version="8.1.97" />
<PackageReference Include="Prism.Wpf" Version="8.1.97" />
</ItemGroup>

<ItemGroup>
<Resource Include="Media\Images\box-green.png" />
<Resource Include="Media\Images\check.png" />
<Resource Include="Media\Images\checked.png" />
<Resource Include="Media\Images\delete.png" />
<Resource Include="Media\Images\delimages.png" />
<Resource Include="Media\Images\deticon.png" />
<Resource Include="Media\Images\edit.png" />
<Resource Include="Media\Images\folder-search2.png" />
<Resource Include="Media\Images\folder.png" />
<Resource Include="Media\Images\house.png" />
<Resource Include="Media\Images\image_2023_06_30T13_35_12_642Z.png" />
<Resource Include="Media\Images\LIV_interary_logo.png" />
<Resource Include="Media\Images\LIV_logo.png" />
<Resource Include="Media\Images\LIV_logo_3.png" />
<Resource Include="Media\Images\login_bg.png" />
<Resource Include="Media\Images\next-arrow.png" />
<Resource Include="Media\Images\next_move.png" />
<Resource Include="Media\Images\next_shift.png" />
<Resource Include="Media\Images\null.png" />
<Resource Include="Media\Images\paperClip.png" />
<Resource Include="Media\Images\plus.png" />
<Resource Include="Media\Images\prev-arrow.png" />
<Resource Include="Media\Images\save.png" />
<Resource Include="Media\Images\sell.png" />
<Resource Include="Media\Images\sendEmail.png" />
<Resource Include="Media\Images\tickimg.png" />
<Resource Include="Media\Images\unchecked.png" />
<Resource Include="Media\Images\warning.png" />
</ItemGroup>

</Project>

The error I am getting is this

我收到的错误是这样的


Error MSB3030 Could not copy the file "C:\Users\MANAV\Downloads\WindowsSDK_NewPrismUpgrade_MajorArchImprove\LIT\LIT.Core\bin\Debug\net6.0-windows10.0.19041.0\LIT.Core\Media\Images\box-green.png" because it was not found. LIT C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets 5167

错误MSB3030无法复制文件“C:\Users\MANAV\Downloads\WindowsSDK_NewPrismUpgrade_MajorArchImprove\LIT\LIT.Core\bin\Debug\net6.0-windows10.0.19041.0\LIT.Core\Media\Images\box-green.png”,因为找不到该文件。Lit C:\Program Files\MICROSOFT VISUAL Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets 5167


Although I have reference of LIT.Core in LIT
everything is correctly referred but couldn't understand why it is not picking up the resource, although the resource is usable in the xaml.

虽然我在LIT中引用了LIT.Core,但我不能理解为什么它不提取资源,尽管该资源在XAML中是可用的。


更多回答

Error says "because it was not found". The code is looking for "net6.0-windows10.0.19041.0", I would first try a clean build and see if that solves issue. You either do not have the library loaded or wrong version of library. You are running the debug version so I would check the bin folder and see if files are in the release instead of the build folder. Also cases like this you are running the X64 arm version and the build folder may have different build options. You may need to change the build properties of the project. Check the project bin folder to see what files exist.

错误显示“因为找不到它”。代码正在寻找“net6.0-windows10.0.19041.0”,我会首先尝试一个干净的构建,看看这是否能解决问题。您没有加载库或库的版本错误。您正在运行调试版本,所以我会检查bin文件夹,看看文件是否在发行版中,而不是Build文件夹中。同样,在这种情况下,您运行的是X64 ARM版本,而Build文件夹可能具有不同的构建选项。您可能需要更改项目的生成属性。检查项目bin文件夹以查看存在哪些文件。

Cases like this the child project may of failed. Try compiling child project by itself.

像这样的案例,子项目可能会失败。尝试单独编译子项目。

@jdweng nope it is not in the Release, I did all this, still there

@jdweng不,它不在新闻稿中,这一切都是我做的,还在那里

Search machine for file box-green.png

搜索机器的文件box-green.png

@jdweng LIT.Core/ │ ├── LIT.Core.csproj ├── Media/ │ └── Images/ │ ├── box-green.png │ ├── check.jpg │ └── other images... It is in the correct directory, but on build the other project is not taking the reference, even though I have give it

@jdweng LIT.Core/│├──LIT.Core.csproj├──媒体/│└──图像/│├──Box-green.png│├──Check.jpg│└──Other Images...它位于正确的目录中,但是在构建时,其他项目没有引用它,即使我已经给了它

优秀答案推荐
更多回答

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com