Reputation: 8815
I recently added some of my Visual Studio 2010 projects to a solution, and now every time I reopen the program they stop compiling. They complain "Unable to open module file C:\Users[USERNAME]\AppData\Local\Temp\1.NETFramework,Version=v4.0.AssemblyAttributes.vb. System cannot find the file specified." I've checked, the file exists and is accessible from the VS Editor itself!
All the information about this error I've found recommends using rebuild to work around the issue. That works for me, but I would rather not have to run a rebuild the first time I open every one of my solutions! Is there someway to avoid this error?
Upvotes: 43
Views: 77348
Reputation: 3057
Make sure that your drive have enough free space. I have experienced the same issue, resolved after allocating more free space in the drive
Upvotes: 0
Reputation: 1247
I deleted the AssemblyAttributes.vb file and it magically got recereated. that's how I solved.
Upvotes: 2
Reputation: 3120
Another option is to create the desired files at the desired location. That would be:
"C:\Users\user\appdata\local\temp\1.NETFramework,Version=v4.0,Profile=Client.AssemblyAttributes.cs" with the following content:
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.0,Profile=Client", FrameworkDisplayName = ".NET Framework 4 Client Profile")]
"C:\Users\user\appdata\local\temp\1.NETFramework,Version=v4.0.AssemblyAttributes.cs" with the following content:
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.0", FrameworkDisplayName = ".NET Framework 4")]
"C:\Users\user\appdata\local\temp\1.NETFramework,Version=v4.0.AssemblyAttributes.vb" with the following content:
Option Strict Off
Option Explicit On
Imports System
Imports System.Reflection
<Assembly: Global.System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.0", FrameworkDisplayName:=".NET Framework 4")>
for other version of .NET, just change the version in the file contents e.g.
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.5", FrameworkDisplayName = ".NET Framework 4.5")]
Upvotes: 3
Reputation: 1110
In my case VS couldn't access to users TEMP folder. After changing permissions to allow all users (my computer has one user - me) full control over this folder, everything was fixed.
Hope this will help.
Upvotes: 3
Reputation: 31
It is a bug in the Visual Studio 2010. Clean and build works for me.
Upvotes: 3
Reputation: 6354
Yes, this is a problem caused by Remote Desktop Connections. RDC is (by default) setup to use create a new directory each time you log in remotely. Also, it's setup (separate setting) to delete that directory once you log off. The real solution is to remove these two settings so that it will just use your standard Temp folder, not deleting the files at logout.
There are also two workarounds to this problem:
Note: Setting up RDC can really only be done if you're logged on as an administrator on the box, thus, the two workarounds.
Upvotes: 73
Reputation: 11
Do not open the solution directly from the visual studio 2010. open the solution by clicking the project solution file from the folder where the project has been saved.
its resolved my problem...
Upvotes: 1
Reputation: 8815
Like vcsjones said, it looks like a problem with RDC. It fixed itself after I closed my RDC session and reset the terminal server.
Upvotes: 0