Visual Studio creates gibberish folder - c#

I'm using Visual Studio 2019 to develop with C#.
Sometimes Visual Studio creates a folder with a gibberish name when I build a solution, like
C:\FNTJ1nkhh1X4r0gk3geH5yIYY8=
This folder only contains the subfolder sqlite3\v1 which in turn contains the following files
db.lock
storage.ide
storage.ide-shm
storage.ide-wal
If such a folder is created, it is created for one certain solution, other solutions don't show that behaviour. Deleting the folder or recreating the solution doesn't help.
To rule them out I already disabled all extensions in Visual Studio but the problem remains.
I've also compared the affected solution file with an unaffected one but didn't find something suspicious.
Has anyone else experienced this and what could be the reason?

After #HansPassant's comment I dug a bit furhter and found that the folder should be located under
%LOCALAPPDATA%\Microsoft\VisualStudio\Roslyn\Cache\RemoteWorkspace
Searching for this location led me to this forum post which confirms this to be a bug in Visual Studio which should be fixed in Visual Studio 2019 version 16.8 preview 3.

Related

Visual Studio Rebuilds unmodified projects sometimes after a PC reboot

I've a Visual Studio 2013 solution with about 50 C# projects. Normally if I select build (F6) it just builds the projects which have changed. But sometimes after a I shut down and restart my PC it rebuilds all when I select build (F6). Why?
This doesn't happen all the time when I restart my PC. Most of the times it says that all projects are up to date after a reboot. But sometimes it rebuilds all.
I took a look at the following question Visual Studio Rebuilds unmodified projects and its answers.
The next step I did was to set the build output verbosity to diagnostic.
I'm getting the following output when Visual Studio rebuilds all after a PC restart:
1>Project 'Project1' is not up to date. Missing input file
...
There much more lines (more than 1000). I took a look at them but I still don't understand why Visual Studio rebuilds the project.
Update
Why does Visual Studio needs the following file?
1>Project 'Project1' is not up to date. Missing input file
'c:\users\wo\appdata\local\temp\.netframework,version=v4.5.assemblyattributes.cs'.
...
For future travelers, I think it's also just a bug in current versions of Visual Studio 2019, 16.6 and newer.
This problem happens for me with Visual Studio 2019 versions 16.6.0 and 16.6.1. I have cross-version aware C# projects that do not have this issue for 2010, 2015, 2017, or 2019 16.5 and older, on the same machine and same user, with the same project in the same folder and solution.
With the recent 2019 versions (in the last month or so, May and June 1st 2020) I get similar message:
1>Project 'Banana' is not up to date. Missing input file 'c:\users\banana\appdata\local\temp.netframework,version=v4.7.2.assemblyattributes.cs'.
If I clean then build, then its normal. If I run a successive build I get the error.
This happens with or without reboot, and after cleaning temp folders even, or if I run Visual Studio with admin or not. The path its trying to find really exists, and pops up if paste in explorer.
I've completely cleaned all but the code files with fresh folders and have the same issue. For me it's only with C# projects. So I think it's a 16.6 bug.
See recent changes:
KirillOsenkov commented on Jan 4 2020
#livarcocc would it be possible to prioritize this? This is an impactful issue that's very easy to fix and has been open for three years now. Seems like low-hanging fruit.
bording commented on Feb 12 2020
With the fix for this being merged into master now, which release will it be a part of? I see that this issue is on the 16.5 milestone, so does that mean it will be in that release, or does the fix also need to be ported to another branch?
tmat commented on Feb 12 2020
#bording I updated the milestone to 16.6 as I believe master is 16.6.
https://github.com/microsoft/msbuild/issues/1479
Visual Studio Rebuilds unmodified projects sometimes after a PC reboot
One possibility that caused this issue is that the building account lost permission to the temp folder. To resolve this issue, you can try to grant permissions read/write/execute to the temp folder, or maybe try running visual studio as administrator to see if it is permissions related.
As we know, if we Open/Build a project in visual studio, .NETFramework,Version=v4.x.AssemblyAttributes.cs appears in temp folder automatically. If you lost permission to the temp folder after restart PC or not running visual studio as administrator, we could not access the temp folder, then Visual Studio will report that it can not find the file version=v4.5.assemblyattributes.cs in the temp folder.
Alternatively, you can also generate this file into the Intermediate directory (usually called obj) by adding following property to the project file:
<PropertyGroup>
<TargetFrameworkMonikerAssemblyAttributesPath>$([System.IO.Path]::Combine('$(IntermediateOutputPath)','$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)'))</TargetFrameworkMonikerAssemblyAttributesPath>
</PropertyGroup>
Credentials: MSBuild: unnecessary rebuilds because of generated AssemblyAttributes.cs
Hope this helps.

Is it possible to work on a ASP.NET application on Visual Studio 2015 and VS Code? [duplicate]

How do I open I a Visual Studio Code folder in Visual Studio 2015?
If I open it as a "Web Site", it tries to treat the node_modules directory as part of the project's normal JavaScript files and hits an error when the path exceed the maximum path length.
But I can't open it as any other project type unless I first create a project of that type and then move all the VS Code files into that folder.
Should I be trying to open it as a web site?
Or should I create a new project and then copy the files + folders into it?
Is there any advantage to having it as a project?
If I do create a project, it makes it difficult to work together with someone who is just using VS Code?
And if I use a project, which project type should I select?
Finally folder view has arrived in VS 2017 :)
You can find more details in here.
Currently there is no way to open a folder directly with Visual Studio.
Why? Because Visual Studio and Visual Studio Code only shared their name, not the idea behind it. To extend Jenny O'Reilly answer:
Visual Studio Code is a folder oriented editor
This means VSC has the same Point-of-View to your Project as the File Explorer.
Visual Studio (not Code) is a solution oriented integrated development environment (short IDE)
Instead every Project in Visual Studio needs a *.sln Solution-File as Root Component. From this point Visual Studio looks at your Project. An example would, if you copy File in your Project Folder, they wouldn't be recognized from Visual Studio. You have to add them first to your sln File, to see them. It also allows the developer to combine multiple projects (*.csproj,..) into one single Solution to build.
This means the idea behind these two editors is completely different.
Visual Studio (not code) Project-types for Web
There are Node.js Tools for Visual Studio
This will provide Node.js built-in project templates
Visual Studio 2015 comes with TypeScript templates
Workaround 1
A workaround would be a Blank Solution in which you set up your Visual Studio Code Project.
Workaround 2
Another trick would be the answer to this question. You can open your Project Folder as a Website Project.
File -> Open Website -> File System and choose the folder
Update
As you mentioned, there will be errors because Visual Studio tries to build the solutions. For the next few readers of this response, the work around for this (as John Pankowicz writes in the comment) is:
Right-click Web Site in Solution Explorer -> Property Pages -> Build -> Uncheck "Build Web Site as part of solution"
Update 2
(Thanks to JC1001 for this update)
The next version of Visual Studio (Visual Studio "15") will support opening a folder. This is mentioned in the Visual Studio Blog.
Also like in Visual Studio Code, there will be a prompt command for opening Folders. Right now you can use this in the preview version:
devenv /command “file.openfolder FOLDER_PATH”
In the future you will be able to use:
devenv FOLDER_PATH
Opinion
Personally I wouldn't recommend Visual Studio (not code) for HTML/Website projects without server-side-development, because I don't see any features. Even the intellisense suggests to me sometimes bad HTML Code (it's not the IDE's fault).
After all web projects are still text files. You can easily control group projects like this with Version Control. Visual Studio Code even provides an integrated Git support.
Visual Studio Code does not create "project files" that you can open in Visual Studio 2015. Basically, when you open up a Node website in Visual Studio, you need to re-create the folder structure in VS2015 and create a "project file".
I haven't seen any better ways of doing this, but will be happy when we can open a folder just as easilly as we can with VSCode
I'm sure it's not the best way but..
Open an existing .sln with notepad, change the names, save as [name of your project].sln.
Open with Visual Studio.

How to stop visual studio 2013 to change .sln version

i have a C# project that i work on using visual studion 2013, the project was created with visual studio 2010, and the entire project is located on a local server and i am using Team Explorer to access it.
the problem is that if i make changes to the project and check-in the Solution (.sln) to the server, and my co workers, that use visual studio 2010, try to open the solution they get an error that the solution was created with a newer version of visual studio.
is there any way to force visual studio 2013 to not change the version number in the solution file? so even though i make changes to the solution the version will not change?
thanks for the help guys, i just ended up creating a copy of the solution file so i'll have 2 .sln files, one for each version.
not the best solution i hoped for but it'll have to do.
thanks.

Visual Studio 2013 reporting erroneous "does not contain a definition for" error for recent extension methods

Visual Studio 2013 (vs) compiles a solution fine when manually building (i.e., it reports "Build succeeded", there are no errors in the error list, and running a program shows the latest changes). However, when vs starts building in the background (for Intellisense?), then errors start to come up for recently added extension methods. The extension methods are underlined in red, and right-clicking on them to "go to definition" results in an error that says "Cannot navigate to [method name]".
Extension methods that were created (in the same classes as the methods listed in the erroneous error messages) previous to when this started happening do not show up in the error messages.
I have done a build clean, to no avail.
I do not have resharper installed.
How do I reset the intelisense cache in Visual Studio 2013? I see instructions for Visual Studio 2008, but not for Visual Studio 2013.
For Visual Studio 2015, my solution didn't have an .sdf file, and restarting didn't help. However, the following steps fixed my problem:
Close Visual Studio (important)
Go to [solution folder]\.vs\[solution name]\v14
Delete the .suo file
Start Visual Studio
It turns out that closing all open files, then shutting down Visual Studio, and restarting fixed the issue. pff!
I had a similar problem that I resolved by deleting *.sdf file in the solution directory. VS2013 will re-create it.
UPDATE This is what I know now: https://stackoverflow.com/a/38708050/90475
After testing all above mentioned solutions simply clean and build worked for me.
In VS2010, the only thing that worked for me was removing and adding the reference again.
Very old question, but it happened to me also with VS2019. I have multiple projects in my solution: right-click on the project -> "Unload Project" for each one, and then reload them. This worked for me.
Clean + Build, or
Close all the files + restart VS + clean
Those didn't work (for me).

Visual Studio Extensibility Package 2010 and 2012. Is there a way to have one package for both?

A while ago I created a Visual Studio Package/Add-In for Visual Studio 2010 (for those curious: http://visualstudiogallery.msdn.microsoft.com/ea23f9a7-a942-45b2-87e6-5df6ff0444ff). If I try to download that and install it in Visual Studio 2012, it doesn't work, I get a version error.
So my first thought was to see what happens if I try to port it to 2012. I downloaded and installed the VS2012 RC SDK, and basically recreated the whole thing in a separate solution and it all works. What I noticed was that many of the assemblies I had to reference (Microsoft.VisualStudio.*) were now version 11 as opposed to version 10 (for obvious reasons). After copying and pasting all the code over, I got it to work correctly in Visual Studio 2012.
My question now is this: Is it possible to have one .vsix file for multiple versions of Visual Studio (I'm guessing no.) If not, what's the correct approach to take as far as uploading the different versions? Can I upload two versions of a .vsix? Will the Add-In manager in visual studio pick the correct one automatically? Do I need to create a new package e.g. "Visual Pastie 2012"? Just looking for some guidance.
Rename the VSIX package to give it a ZIP extension and open it up. You'll find a file called extension.vsixmanifest. Inside this XML file you'll find an element called SupportedProducts which should look like the following to work in VS2012.
<SupportedProducts>
<VisualStudio Version="11.0">
<Edition>Pro</Edition>
</VisualStudio>
</SupportedProducts>
HTH

Categories

Resources