I'm using Visual Studio 2017. I used the asset generator to auto-generate icons for my app, but most of them look very bad. So, I thought to cut down on the number of icons, but now I can't find any option to remove an image from the Visual Assets listing. only adding/auto-generating them. Opening the associated Package.appxmanifest file doesn't show any of these images being even referenced. And without solving this problem, Visual Studio is not letting me even build the project >_<
So, I'd like to understand how to remove some of these images? Searching the microsoft forums, but haven't yet found anything related to "removing" assets,
Just delete the path to the file, ie Assets\SmallTile.png in Package.appxmanifest.
You cannot however remove all the assets since some sizes like splash screen or medium tile are required - you'll have to generate/add new.
Also make sure that these checkboxes are not checked for icons you've removed.
You need to undo in 3 steps:
Remove the Logo settings from Package.appxmanifest, but leave the required ones.
Open Assets folder, delete all auto-generated assets, again, leave the required ones.
Close your project, and open your .csproj file in notepad, delete the newly added referenced items - they look like below, and then save the csproj file.
<ItemGroup>
<Content Include="Assets\LargeTile.scale-100.png" />
<Content Include="Assets\LargeTile.scale-125.png" />
<Content Include="Assets\LargeTile.scale-150.png" />
<Content Include="Assets\LargeTile.scale-200.png" />
<Content Include="Assets\LargeTile.scale-400.png" />
<Content Include="Assets\SmallTile.scale-100.png" />
<Content Include="Assets\SmallTile.scale-125.png" />
<Content Include="Assets\SmallTile.scale-150.png" />
...
Related
colleagues.
I created simple VS2015 Extension: myExtension.vsix
Then I created .msi installer (used WIX and this article)
It's OK! I installed my Extension and it works.
I created local private MyLocalGallery.xml and registered myExtension.vsix in it
As a result I see installed myExtension in Tools - Extensions and Updates - Online - MyLocalGallery
I increase version for myExtension in MyLocalGallery.xml => I saw my update and the button UPDATE here: Tools - Extensions and Updates - Updates
QUESTION:
I press update, VS takes
<content type="application/octet-stream" src="Extensions\myExtension.vsix" />
from MyLocalGallery.xml and makes update. But... I want VS to make redirect to my own website where users can download .msi (not .vsix)
How can I ask Visual Studio to go to my URL???
If I remove this element
<content type="application/octet-stream" src="Extensions\myExtension.vsix" />
button UPDATE is present, I click it but nothing happens.
If I set .msi file, I get error ("The file is not a valid VSIX package")
<content type="application/octet-stream" src="Extensions\myExtension.msi" />
May be it's very trivial issue, but I spent a lot of time trying to do it.
I can't find answer and hope you help me. Thank you
I found the answer accidentally!
This question helps me
So we should add element to our entry in MyLocalGallery.xml:
<entry>
...
<title type="text">my extension</title>
...
<link rel="update" type="text" href="http://example.com/install.msi"/>
<Vsix xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/developer/vsx-syndication-schema/2010">
...
</Vsix>
And when we click Download or Update then VS redirect us to http://example.com/install.msi
Also we should remove this element from the feed xml (because it has higher priority)
<content type="application/octet-stream" src="Extensions\myExtension.msi" />
Before modifying a resource file, it looks like this in VS.NET (2013):
Strings.resx
Strings.Designer.cs
After saving, it looks like this:
Strings.resx
Strings.Designer.cs
Strings1.Designer.cs
If I try to run the project, I get an error that Strings already exist. I have to then delete Strings.Designer.cs and rename Strings1.Designer.cs to Strings.Designer.cs.
Then I have to unload the project and modify those references in the project file XML. Then reload and all is well until I modify again.
Any idea how to fix this?
I faced the same issue. I deleted my old resource file and created a new resource file with same name and content. Now it is working fine.
So, delete the Strings.resx file and create a new file with the same name that is Strings.resx
I found the answer from this link Generating *.Designer.cs from .resx.
Basically, you need to:
Right-click on your project and click Unload.
Then right-click again and click on Edit on your project.
Find the string <LastGenOutput> and change the entry to whatever you want.
For example, I need to generate Strings.Designer.cs:
<ItemGroup>
<Compile Update="App_GlobalResources\Strings.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Strings.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="App_GlobalResources\Strings.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
I hope this post can help someone in the future.
Cheers
I'd like to use the selected platform target -- $(PlatformTarget) for certain content items in my .csproj file.
For example:
<Content Include="Plugins\$(PlatformTarget)\Plugins.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
When opening this project in VS, it seems that the platform target property is not yet resolved (the file appears to be non-existing).
Is there any way to overcome this?
Do you mean $(Platform)?
<Content Include="Plugins\$(Platform)\Plugins.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
I have a WinForm project that contains a form called MainUI. You can see that the automatically generated partial class shows up as a node under MainUI.cs. Is there a way to "move" my self created partial class MainUI.Other.cs under MainUI.cs so that it'll show as another node?
Close the solution in Visual Studio, and open your .csproj file in a text editor. Find MainUI.Other.cs, and add the following XML element:
<Compile Include="MainUI.Other.cs">
<SubType>Form</SubType>
<DependentUpon>MainUI.cs</DependentUpon> <!-- this is the magic incantation -->
</Compile>
Reopen the solution in Visual Studio and enjoy subnodular goodness.
That said, you may want to reconsider whether this is a good idea. The reason the .designer.cs file is displayed as a subnode is because you won't normally need or want to open it, because it contains generated code which you'd normally view or edit through the designer. Whereas a partial class file will contain your code, that you'll want to edit and view; it may be confusing to maintenance programmers if the file is not easily visible in Solution Explorer. However, only you can know what's right for your project -- just something to bear in mind!
Yes, this is possible, but you will have to hand edit the project file.
In the project file (open it with the XML Editor) locate the file listing item group. In my example, I left the form as "Form1.cs". Add the child element "<DependentUpon>" to your extended class as per the example below:
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="Form1.Designer.Other.cs">
<DependentUpon>Form1.cs</DependentUpon>
<SubType>Form</SubType>
</Compile>
Typically though you wouldn't want any non-generated code to be hidden as a child node though. My normal practice is to create a folder in the project called "Partial Classes" and add them all in the same location.
You can modify the project source file to group the related files.
In the project source file, find ItemGroup element which contains MainUI.cs and add an entry for MainUI.Others.cs
Here a blog post showing how to do it in details.
Group/nest source code files
Just to add to #itowlson's answer: if you're getting an error such as "Duplicate 'Compile' items were included." when compiling, that's probably because the files you're telling it to include are already included using a wild card.
The solution is to remove then add them to the compile config like so:
</Project>
<ItemGroup>
<Compile Remove="MainUI.Other1.cs" />
<Compile Remove="MainUI.Other2.cs" />
</ItemGroup>
<ItemGroup>
<Compile Include="MainUI.Other1.cs">
<DependentUpon>MainUI.cs</DependentUpon>
</Compile>
<Compile Include="MainUI.Other2.cs">
<DependentUpon>MainUI.cs</DependentUpon>
</Compile>
</ItemGroup>
</Project>
To explain a little more, I have a file Sidebar.cs, and I have Sidebar.js, and Sidebar.css.
I would like to be able to make it Sidebar.cs, Sidebar.cs.js, and Sidebar.cs.css, and have the js and css file go "under" (as children of) the Sidebar.cs node in the treeview, just like what happens with .designer files and .aspx.cs files.
Is this possible to accomplish?
Open up the project file in a text editor or using the "edit project file" context menu (might be only part of an add-in I have). You can then use the DependentUpon XML tag to get the hierarchy. For example, this is how a Form and it's designer look:
<Compile Include="Views\SSWizardForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Views\SSWizardForm.designer.cs">
<DependentUpon>SSWizardForm.cs</DependentUpon>
</Compile>
Note the "DependentUpon" tag, meaning "make this a child of another file".
I haven't tried this myself, so take this with a pinch of salt, but this is what I infer by looking at projects I have to hand
Open the project file in notepad (or other preferred text editor), and the structure of a project file so it looks like
<Compile Include="whatever.cs">
<DependentUpon>whatever.else</DependentUpon>
</Compile>
<None Include="whatever.else" />
instead of
<Compile Include="whatever.cs" />
with as many DependentUpon clauses and None elements as needed