问题
I'm writing a c# library, and trying out Visual Studio Code. I'm generally liking what I'm seeing, but there are some things that I'm finding frustrating, that are really easy in Visual Studio standard version... for example, marking a file as an embedded resource.
Is this possible without some complicated voodoo? Is there an extension I need to install? It's not obvious to me.
回答1:
You have to edit the .csproj and change the node that represents your file to
<EmbeddedResource Include="Resources\yourEmbeddedResource.json" />
If your c#-library-project uses the older project-type you should find a content-node or none-node for your file because this project type needs all files added in the csproj. If you have the newer and far mor shorter project-type your file may not be listed because this type auto collects it's project files. You may have to add this node (remember to wrap it inside an itemgroup)
来源:https://stackoverflow.com/questions/49479476/how-to-mark-a-file-as-an-embedded-resource-in-visual-studio-code