Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Losing csproj references upon transition to SDK #1610

Open
Toastedcranium opened this issue Nov 7, 2024 · 2 comments
Open

Losing csproj references upon transition to SDK #1610

Toastedcranium opened this issue Nov 7, 2024 · 2 comments

Comments

@Toastedcranium
Copy link

I noticed that when I convert from .net framework 4.8.1 to the SDK framework style, I lose lots of information within the csproj that affects the files in my project. It removes all embedded resources and compile items in itemgroups. Some of my files are Windows Forms and pre-SDK, I can edit the form in designer style, but after converting them, the files convert to normal .cs files and lose their design feature for all forms in the project. The .resx still exists under the file. When I add back in the itemgroup to add the embedded resource and subtype, the file type changes back to designer, but cannot be modified under the designer feature in visual studio.

Am I converting them incorrectly? Or is there something else I am missing?

@Abdragiz
Copy link

Abdragiz commented Nov 8, 2024

It removes all embedded resources and compile items in itemgroups.

In SDK-style projects some files are included by default.
https://learn.microsoft.com/en-us/dotnet/core/project-sdk/overview#default-includes-and-excludes

Can't say anything about problems with designer.

@Toastedcranium
Copy link
Author

Toastedcranium commented Nov 14, 2024

Image
Not sure what I can share from the project, but once I convert to SDK, assembly references that previously worked just fine and were static references (not compiled from another project), they are broken and I have to re-add them manually.

The old .csproj for the project does not have a hintpath for the missing references in there, but right clicking on the reference and going to properties, there is a path field filled out for the reference to the correct spot.

For the designer/forms, the fix was to change the inheritance to Form and back to whichever class it inherited from and it fixed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants