T O P I C R E V I E W |
Mathetis |
Posted - Mar 20 2019 : 9:12:57 PM Hey, within .NET standard projects, VAX fails to see new files or pulled files in the project directory. This means that it cannot look up the file, and it will fail to find references.
Is this the expected level of compatibility with .NET standard projects? |
7 L A T E S T R E P L I E S (Newest First) |
feline |
Posted - Mar 25 2019 : 07:15:50 AM Strange, it does sound like we are doing the same thing, but clearly seeing different results.
Along with the sample project, can you please export your VA and IDE settings and send all of them to me:
VA Options -> Performance -> Export Settings IDE tools menu -> Import and Export Settings -> Export selected environment settings
this way I can import your settings here, so I can try the same settings and solution, and see if I get the same behaviour here.
Please email the files to:
[email protected]
including this thread ID or URL in the description, so we can match it up. |
Mathetis |
Posted - Mar 23 2019 : 10:16:03 PM Hey, I understand.
I am renaming exactly as you are.
I tried creating a solution from scratch with a single .NET standard C# project. It comes with a default Class1.cs. I added a few files, including one in a subdirectory. After renaming the files via F2, VAX does not register the rename.
The files can be in subdirectories or in the root of the project.
Interestingly, I can confirm this happens on two different machines.
I can send you the sample solution. You could see if you see the same behavior on your side. |
feline |
Posted - Mar 23 2019 : 10:44:16 AM Turning off "Show only files in the current solution" stops VA looking for and listing files in other directories, which can be a bit overwhelming.
How did you rename the file? Perhaps the method matters. I tested this by selecting the file in the Solution Explorer window, pressed F2 to edit the filename in place, in the Solution Explorer window, and then changed the name. Enter to accept. I then opened VA's Open File dialog, and the new filename is listed.
Is the file you are renaming in the same directory as the A.cs file, the "main" file for this solution?
I am looking for a difference between what you are doing and what I am doing, to help explain why we are seeing different things. |
Mathetis |
Posted - Mar 23 2019 : 09:47:43 AM Hey, thanks for the suggestions.
I don't see a difference with "Show only files in the current solution"; however, the "Include all files in Solution Directories" does cause it to appear in the list with the correct name.
However, it is a partial workaround. The old file name remains in the list. And the new one is listed as a "Solution file," not under the project.
So it looks like this after renaming A.cs to Anew.cs:
File | Project
A.cs proj Anew.cs [Solution]
|
feline |
Posted - Mar 23 2019 : 07:42:57 AM That's interesting. I was not aware that a C# class library behaved like this.
Can you please go to the VA Open File in Solution dialog. First turn On the check box "Show only files in the current solution"
Now right click in the list of files to get the context menu, and turn On "Include all files in solution directories", which can also be toggled with Ctrl-D.
For me this makes sure all of the files are being listed in the dialog. Renaming a file via Solution Explorer is also being picked up when I next open this window.
How many of the problems you are seeing do changing these settings fix? It would be nice if this was a complete solution, but it might not be. |
Mathetis |
Posted - Mar 22 2019 : 1:45:50 PM Hi,
I think there is a confusion--a .NET Standard project is not the same as a C# Windows Forms App project. I see no issues with .NET Framework projects.
I am running 10.9.2302; However, this has been the only behavior I have seen, so I don't think it is a regression.
Edit: Running VS 2017 15.9.0 on Windows 10.
You could try to create a Class Library (.NET Standard) project.
In my case, files are only added via Add->Class, or sometimes by Team Explorer pulling a new file. The solution always knows about them. In other words, they are only ever added via supported "Microsoft approved" methods :). No custom plugins, etc.
It is worth noting that C# .NET Standard project files do not list ANY files in the project file itself. They appear in the project in solution explorer though. These projects do some kind of wildcard inclusion on the tree, and I think they must use file monitoring too. I could reasonably see that the VSX API would report them a little differently, but I have not looked at that specifically.
Often, VAX will see the SYMBOL for a class even when it does not see the FILE for the class. That is, if you go, VAssistX -> Open File in Solution, the file is not there, even with the "Show only files in this solution" unchecked. However, if you go to VAssistX -> Find Symbol, the symbol is present.
I suggest the following. Try renaming a file in a .NET standard project through the IDE and see if VAX detects the change. For me, it keeps the stale file reference in the Open File In Solution, which of course does not work. It does not pick up the file name change.
Thanks.
|
feline |
Posted - Mar 22 2019 : 08:20:13 AM Which IDE and version of VA are you using?
VA should be aware of new files that are added to your solution. To check this I have used VS2017, VA 2324 running under Windows 10. I have created a new, default C# Windows Forms App (.NET Framework) solution, using framework version 4.6.1
To add a file I used right click in the Solution Explorer window, on the project name, and used "Add -> Class...", and added a new C# class to the solution. I closed the newly created .cs file, so it was not open in the IDE, and then looked in VA's Open File dialog. The new file is listed and can be opened normally.
How does this compare to your experience? It is possible the method you are using to add new files to the project is a factor.
Are the new files actually part of the solution? Or are new files being added to the directory while the IDE is open, but the IDE knows nothing about these new files? If the new files are not part of the solution, then why would you expect VA to know about them? |
|
|