question

toviaschlesinger-6241 avatar image
0 Votes"
toviaschlesinger-6241 asked toviaschlesinger-6241 answered

By building as Class Library - All the resources keep getting lost

When changing my project from a "Windows Form Application" to a "Class Library"
and then building it, the resources keep getting lost creating many errors, that the resources are missing.
So, to work around this problem, I kept a copy of all the resources, and I copy the resources back in every time.

How can I prevent this from happening?

vs-msbuild
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AnnaXiu-MSFT avatar image
0 Votes"
AnnaXiu-MSFT answered

Hi @toviaschlesinger-6241 ,

Welcome to Microsoft Q&A!

What is your target framework? You can check it by right-clicking project > Properties > Application.

Please check if you put your resource file in bin folder of your project folder or not. if so, it will be deleted when re-building project.

In order for us to investigate it further, could you share us more reproduce steps or screenshots about the errors?

Sincerely,
Anna


If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

toviaschlesinger-6241 avatar image
0 Votes"
toviaschlesinger-6241 answered AnnaXiu-MSFT commented

my framwork i use is
.Net Framwork 4.8
139530-error.png



this is the picture of my
Namespace My.Resources

most Propertys got deleted by building the first time to as Class Library
then i copy of all the resources, and I copy the resources back in
avry time i build it


error.png (195.9 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Dear custome, have you tried to create a new project and check if the situation appears in specific project or not?

0 Votes 0 ·
toviaschlesinger-6241 avatar image
0 Votes"
toviaschlesinger-6241 answered

i will try this next week

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.