简体   繁体   中英

Add text file not available in Xamarin.iOS project in visual studio

When I select Add > New Item in my Xamarin.iOS project in VS 2012 or 2013, I see the screen below. Notably absent is "text file." Why might I be unable to add a text file?

在此处输入图片说明

There are a lot of other things missing in that list. The simplest solution would be to create that text file in the file system and then adding it to your project in Visual Studio. The easiest way to do this is to enable "Show All Files" at the top of the Solution Explorer, then right-click the text file and choose "Include In Project". After doing that, be sure to select the desired build action in the file's properties.

The other solution would be to add the entries by hand into the .csproj file. That would look something like this:

<Content Include="test.txt" />
<EmbeddedResource Include="test.txt" />
<BundleResource Include="test.txt" />
<None Include="test.txt" />

(pick one). You can do this in Visual Studio by right-clicking the project and selecting "Unload Project". After right-clicking the project again, the edit option appears.

What version of the tools are you using? I believe that was fixed in the newer releases

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM