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

Determine the project context when opening the RESX designer #5757

Open
tmeschter opened this issue Dec 20, 2019 · 4 comments
Open

Determine the project context when opening the RESX designer #5757

tmeschter opened this issue Dec 20, 2019 · 4 comments
Assignees
Labels
Blocked This issue is blocked from making progress due to another issue. Feature-Codespaces Running Visual Studio in a cloud environment Feature-Resource-Designer Specific to the resource file (RESX) editor. Must-Have Items that must be delivered by the end of the assigned milestone Triage-Approved Reviewed and prioritized
Milestone

Comments

@tmeschter
Copy link
Contributor

Currently, when you open a .resx file in the designer on a cloud-connected client there is no way to tell what project the file is associated with. This creates the following known limitations in the designer experience:

  • The user is unable to switch between "public" and "internal" access. This is because doing so requires we change the generator used, which requires updating metadata on the item in the project file.

It probably causes other limitations as well (not yet verified):

  • The user is probably unable to add files as resources, as we don't know which project to add the file to.

Some other component (AnyCode?) will need to provide an API to determine the project on the client side. This task tracks using that information in the designer to find the project and file (that is, the IVsHierarchy for the project, and the ItemID for the file in the hierarchy) on the server, and any other updates that need to be made.

@tmeschter tmeschter added the Feature-Codespaces Running Visual Studio in a cloud environment label Dec 20, 2019
@tmeschter tmeschter added this to the 16.5 milestone Dec 20, 2019
@tmeschter tmeschter self-assigned this Dec 20, 2019
@jjmew jjmew added the Triage-Approved Reviewed and prioritized label Dec 20, 2019
@tmeschter tmeschter modified the milestones: 16.5, 16.6 Jan 23, 2020
@tmeschter tmeschter modified the milestones: 16.6, 16.7 Mar 5, 2020
@tmeschter tmeschter modified the milestones: 16.7, 16.8 Jun 17, 2020
@tmeschter tmeschter added the Must-Have Items that must be delivered by the end of the assigned milestone label Jun 23, 2020
@ocallesp ocallesp added Nexus and removed Nexus labels Jul 10, 2020
@ocallesp
Copy link
Contributor

ocallesp commented Aug 7, 2020

The context is missing because on nexus client Editors receive IVsHierarchy from Miscellaneous Files Project which means that the itemID doesn't belong to any project. This is by design, so a lot of refactor is needed in ProjectSystem to handle nexus and non-nexus.

ProjectModelQueryableSpace from CPS can help us to fetch some information from the server.

In Nexus client, this is the list of APIs that are broken in Editor Resource Designer:

  • IVsProject

    GetItemContext()
    GetMkDocument()

  • Hierarchy
    GetProperty()
    GetGuidProperty()

  • Project
    DTE
    UniqueName
    Kind
    Name
    Properties
    CodeModel
    Object
    FullName
    ProjectItems

  • ProjectItem
    FileNames
    FileCount
    Properties
    ProjectItems
    Name
    Collection
    Kind
    ContainingProject
    Delete()
    Remove()

  • ProjectItems
    parent
    counts
    Item
    AddFromFile()
    AddFromDirectory()
    AddFolder()
    AddFromFileCopy()

  • IVsTrackProjectDocuments2
    AdviseTrackProjectDocumentsEvents()
    UnadviseTrackProjectDocumentsEvents()

  • IVsRefactorNotify
    OnBeforeGlobalSymbolRenamed()
    OnGlobalSymbolRenamed()
    OnBeforeAddParams()
    OnAddParams()
    OnBeforeReorderParams()
    OnReorderParams()
    OnBeforeRemoveParams()
    OnRemoveParams()

@tmeschter tmeschter removed their assignment Aug 20, 2020
@ocallesp
Copy link
Contributor

This work item AzDO will fix part of the context on the client
https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1178677

@jjmew jjmew added the Blocked This issue is blocked from making progress due to another issue. label Sep 16, 2020
@verelpode
Copy link

verelpode commented Dec 28, 2020

Using RESX without WinForms

Related to this .resx issue, it would be great if the .resx Designer/GUI could be updated/modernized to stop producing WinForms references when a .resx file is used in a non-WinForms .csproj targeting NETFW 5 (SDK-style .csproj). Note resx does not require WinForms, but currently the Designer/GUI for it is creating resx files that do contain references to "System.Windows.Forms.dll", although resx could also be used outside of WinForms.

Currently the resx Designer/GUI in VS 16.8.3 produces resx files that do contain references to WinForms like this example:

<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="DgmlGraph" type="System.Resources.ResXFileRef, System.Windows.Forms">
	<value>Resources\DgmlGraph.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>

Ideally the resx Designer/GUI should only produce WinForms references when it is for a project targeting WinForms, not when it is used in a Console project with SDK/NETFW/5.

resx is useful, especially for the purpose of performing culture/language localizations. It would be great to see an updated version of the resx Designer that is suited for non-WinForms .csproj's that use NETFW 5 (SDK-style .csproj), including Console projects and ASP.NET 5 projects etc.

See also my detailed resources notes in the later message in #4534 (comment)

@drewnoakes drewnoakes modified the milestones: 16.8, 17.x Nov 29, 2021
@kvenkatrajan kvenkatrajan added the Feature-Resource-Designer Specific to the resource file (RESX) editor. label Jul 19, 2022
@kvenkatrajan kvenkatrajan assigned drewnoakes and unassigned ocallesp Nov 16, 2022
@ocallesp
Copy link
Contributor

This work is not needed, since this is for the client-server architecture.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocked This issue is blocked from making progress due to another issue. Feature-Codespaces Running Visual Studio in a cloud environment Feature-Resource-Designer Specific to the resource file (RESX) editor. Must-Have Items that must be delivered by the end of the assigned milestone Triage-Approved Reviewed and prioritized
Projects
None yet
Development

No branches or pull requests

6 participants