LorisYounger / VPet

虚拟桌宠模拟器 一个开源的桌宠软件, 可以内置到任何WPF应用程序
Apache License 2.0
4.63k stars 465 forks source link

VPet.Solution build error #325

Closed luanon404 closed 4 months ago

luanon404 commented 4 months ago

image

// I really don't know how to fix this since tried everything i know.

luanon404 commented 4 months ago

everything works fine in debug mode

LorisYounger commented 4 months ago

There are some things that may cause you to encounter this kind of problem

  1. You have used an old version of Visual Studio and need to use Visual Studio 2022
  2. Your visual studio does not have the required plugins installed, (.net Desktop development & Universal Windows development) See https://store.steampowered.com/news/app/1920960/view/7950611950256749982
  3. Package reference invalid, try execute the following instruct in the Package Manager Console Update-Package -reinstall
luanon404 commented 4 months ago

1/ using Visual Studio 2022

2/ installed (.net Desktop development & Universal Windows development) with latest version

// first error, fix by add references

image

// second error, tried Update-Package -reinstall

image

luanon404 commented 4 months ago

// Panuon.WPF.UI properties // Looks like it was not installed or broken

image

luanon404 commented 4 months ago

// fixed by removing broken Panuon.WPF.UI and adding it by browsing

luanon404 commented 4 months ago

I don't know, but there are two reasons that need to be addressed before a successful build can be made.

1/ add VPet.Solution reference to VPet-Simulator.Windows

// Right click on VPet-Simulator.Windows > Add > Project Reference...

image

// Tick on VPet.Solution, then press OK

image

2/ remove broken Panuon.WPF.UI packages in VPet.Solution, then add it by browsing.

// In solution explorer, click on VPet,Solution > References > Right click on Panuon.WPF.UI, then press remove

image

// Then right click on References > Add reference...

image

// Then click on browse, browse to F:\VPet\packages\Panuon.WPF.UI.1.1.16.8\lib\net462\Panuon.WPF.UI.dll // My case i put project on F:\VPet

image

// Then setup like this and press run button

image

Then, build successfully

luanon404 commented 4 months ago

For core error, just copy & paste core mod from F:\VPet\VPet-Simulator.Windows\bin\x64\Release\net462\mod to D:\VPet-Simulator\mod if you want put it in another disk

image

LorisYounger commented 4 months ago

The original problem was this, which I intentionally removed. The reason for referencing it in Release is that the reference will automatically copy a generated result to the output directory, which is convenient for me to upload to Steam https://github.com/LorisYounger/VPet/blob/12364348ed93009801c5bafc95a35a1013e5f342/VPet-Simulator.Windows/MainWindow.cs#L37-L39 I will remove the Release Tag in the following commit

For Fixing Reference, I think some computers may not support this referencing method (which is usable on both my computer and the developer's computer, but some players may display an error message) I am trying to change the reference method to be consistent with other projects to ensure compatibility

luanon404 commented 4 months ago

The original problem was this, which I intentionally removed. The reason for referencing it in Release is that the reference will automatically copy a generated result to the output directory, which is convenient for me to upload to Steam

https://github.com/LorisYounger/VPet/blob/12364348ed93009801c5bafc95a35a1013e5f342/VPet-Simulator.Windows/MainWindow.cs#L37-L39

I will remove the Release Tag in the following commit

For Fixing Reference, I think some computers may not support this referencing method (which is usable on both my computer and the developer's computer, but some players may display an error message) I am trying to change the reference method to be consistent with other projects to ensure compatibility

I mean the Panuon.WPF.UI version is wrong, so the package is broken, 1.1.16.8 not 1.1.16.5.

luanon404 commented 4 months ago

It's really bad because it took me 2 days to find it without having any knowledge.

LorisYounger commented 4 months ago

It's really bad because it took me 2 days to find it without having any knowledge.

I'm sorry for the bad experience. I believe it was caused by a bug in Visual Studio I don't have this problem on my end, and my programmers haven't encountered this problem before, so I couldn't find it

It has been fixed now. Thank you for your debugging

LorisYounger commented 4 months ago

For core error, just copy & paste core mod from F:\VPet\VPet-Simulator.Windows\bin\x64\Release\net462\mod to D:\VPet-Simulator\mod if you want put it in another disk

image

For Core Error, Run Vpet-Simulator.Windows/mklink.bat as administrator. This links the mod folder to the build folder. https://github.com/LorisYounger/VPet/blob/main/README_en.md#how-to-deploy-vpet-simulatorwindows

luanon404 commented 4 months ago

For core error, just copy & paste core mod from F:\VPet\VPet-Simulator.Windows\bin\x64\Release\net462\mod to D:\VPet-Simulator\mod if you want put it in another disk image

For Core Error, Run Vpet-Simulator.Windows/mklink.bat as administrator. This links the mod folder to the build folder. https://github.com/LorisYounger/VPet/blob/main/README_en.md#how-to-deploy-vpet-simulatorwindows

i wonder why you dont add it as default, the 0000_core mod folder

LorisYounger commented 4 months ago

For core error, just copy & paste core mod from F:\VPet\VPet-Simulator.Windows\bin\x64\Release\net462\mod to D:\VPet-Simulator\mod if you want put it in another disk image

For Core Error, Run Vpet-Simulator.Windows/mklink.bat as administrator. This links the mod folder to the build folder. https://github.com/LorisYounger/VPet/blob/main/README_en.md#how-to-deploy-vpet-simulatorwindows

i wonder why you dont add it as default, the 0000_core mod folder

Because the mod folder is too big, if you set it to auto-copy, it will be copied 4 times for people who are developing 4 versions. #281 Use a script to set it as a link, it will save a lot of space.

luanon404 commented 4 months ago

For core error, just copy & paste core mod from F:\VPet\VPet-Simulator.Windows\bin\x64\Release\net462\mod to D:\VPet-Simulator\mod if you want put it in another disk image

For Core Error, Run Vpet-Simulator.Windows/mklink.bat as administrator. This links the mod folder to the build folder. https://github.com/LorisYounger/VPet/blob/main/README_en.md#how-to-deploy-vpet-simulatorwindows

i wonder why you dont add it as default, the 0000_core mod folder

Because the mod folder is too big, if you set it to auto-copy, it will be copied 4 times for people who are developing 4 versions. #281 Use a script to set it as a link, it will save a lot of space.

Ahh okay, thank you for your response. All problems have been solved. Have a nice day!

LorisYounger commented 4 months ago

Thanks again for catching this issue. When I was testing the bug for other players, I thought it was an installation problem.