Problem Unblocking Assemblies in Windows 7 Home Premium - visual-studio-2010

I am getting the following error trying to load a basic project template:
Error 12 Could not load the assembly file://\\psf\home\documents\visual studio 2010\Projects\WindowsPhonePivotApplication1\WindowsPhonePivotApplication1\obj\Debug\WindowsPhonePivotApplication1.dll. This assembly may have been downloaded from the Web. If an assembly has been downloaded from the Web, it is flagged by Windows as being a Web file, even if it resides on the local computer. This may prevent it from being used in your project. You can change this designation by changing the file properties. Only unblock assemblies that you trust. See http://go.microsoft.com/fwlink/?LinkId=179545 for more information. WindowsPhonePivotApplication1
I don't have the Security tab when I try and modify the DLL to unblock the assembly. Any advice?

Did you try copying this assembly locally? Currently it seems to be loaded from a network share. You will need to trust that network location if you want to work this way.
Drive:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\caspol.exe -m -ag 1 -url "file:////\computername\sharename*" FullTrust -exclusive on
Check this KB for details... http://support.microsoft.com/kb/320268/

I just ran into this very same problem - trying to compile a Silverlight application inside Parallels Desktop 8 virtual machine on a Mac - where the SL output directory was located on the emulated drive (appears in Windows as a network drive).
Very simple fix. You can open up devenv.exe.config located in C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE and add this line inside the <Runtime> node:
<loadFromRemoteSources enabled="true"/>
e.g.
<?xml version ="1.0"?>
<configuration>
<configSections>
<section name="msbuildToolsets" type="Microsoft.Build.BuildEngine.ToolsetConfigurationSection, Microsoft.Build.Engine, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</configSections>
...
<runtime>
<loadFromRemoteSources enabled="true"/>
...
To edit the devenv.exe.config file you will also need to open NotePad as administrator. After doing the above I can compile my SL application inside Parallels Virtual Machine, but the above also applies to Silverlight applications hosted on a network drive.

I ran into this. These were the steps I took:
Downloaded a file, WP7PiChartsFromDBSOUP.dll, to my downloads folder (everything locally).
Copied this file to c:/Program Files/ referenced it and attempted to build.
Got this error message.
Removed the reference, and followed the steps to unblock.
Referenced and attempted to build: still same error.
Went back to c:/Program files and noted that the file was still blocked. Somehow my attempt to block didn't take. So I tried to unblock, closed the properties dialog, then reopened. Somehow my attempt to unblock didn't appear to be working.
Went to the downloads folder and unblocked the file that was downloaded to this location, tried to unblock, and it seemed to work. So I felt like I was out of the woods. I copied this file over the file in c:/Program Files and reference it in VS2010, closing and reopening VS2010.
Same error message. I rebooted the machine and tried again. Same error message. And I know this is gonna sound crazy, but I renamed the dll from that long name to PieChart.dll.
And it finally worked.
So, either there was a problem with the name, or maybe changing the name somehow caused the change in blocked status to kick in.

I had the same problem trying to build an application on parallels.
I just copied the whole project in a folder under c:/ and works
it seems that parallels shares certain folders (i.e. desktop, documents) between the OS running on the vm and your mac user home folder. because of that windows treats these folders as network shared folder and forbids you to access them.

It's on the General tab in file properties from explorer. Either via the DLL in question, or you can do it on the zip file before you extract if it was a download, there will be an unblock button at the bottom right.
Make sure it's from a trusted source.

I've tried many solutions also with coping file to external usb drive with FAT32 file format, and some other ideas. But finally I've found post by caliban here: Topic about this problem. He links to a program called Streams which helped solving this problem :)
caliban:
Run this line in the command line
streams -s -d directory
download Streams exe

Add to the project a text file named ServiceReferences.ClientConfig having the following contents:
<configuration>
<runtime>
<loadFromRemoteSources enabled="true"/>
</runtime>
</configuration>
Re-build the project.

If you still didn't get your answer, I just found the solution. You are saving the application into the network hardrive. So while creating the application, change the location to something like your local disk e.g.,
C:/Projects
Then you will be able to run it.

I had the same problem over VMWare using a mac to load windows 7, if you see the path it starts like a network path, that's why VS gives out about the security.
Take the entire folder project and put it in a physical path starting with C://program files... , then open and compile, it will work.

Right click on the dll and select properties. You should see a button to unblock the assembly.

Related

"msadox28.tlb File is under windows system file protection" error while attempting to build an installer

I am trying to build an installer for my project. The problem is that i am unable to successfully build the installer with the following error:
ERROR: 'msadox28.tlb' should be excluded because its source file
'C:\Program Files (x86)\Common Files\System\ado\msadox28.tlb' is under
Windows System File Protection.
From what i can gather, this file has to do with ADOX and ADODB that i use to create, read and write data from a local access database. Excluding this file causes the program to not work at all when it has been installed, because it attempts to create a fresh database from scratch at first launch.
The program works fine and there is no errors with it, but i want to build an installer so that i can send the program to a few users to test it and the database component is the most important part of my project.
Can somebody please assist me with solving this problem?

Error when saving to a mapped drive in Sublime only: cannot save a file with a user-mapped section open

When I try to save a file in sublime from a mapped network drive I get an error:
Unable to save Y:\MySite\index.html
Error: The requested operation cannot be performed on a file with a user-mapped section
This error does not happen in Notepad, and is coming from Sublime Text rather than windows, which makes me think Sublime is trying to do something funky during the save process.
What I've tried:
The file is open somewhere else. No, I can save the file in Notepad.
There may be an issue with user permissions Maybe, however I'm not sure how to fix it.
The linked post is not specific. I shared the folder by
Right-Click > Properties > Sharing > Share, added "Everyone", and gave them "Read/Write" permission.
Could it be that "Everyone" doesn't cover the Sublime user? (Note: I have tried to run sublime as admin, to no avail)
More Details:
Environment:
My local computer ("The Host") hosts a Windows 7 Virtual Machine ("The Guest"), which is running Jetty
Jetty serves folders from webapps as web servers
I set up webapps to be shared with Everyone
On the host I mapped webapps so I can edit files locally.
Here's a pic of my Network Folder setup:
The Issue:
When I locally edit a webapps file in Sublime, and Jetty is running in the guest, I get this error when I try to save it:
However, if I edit the same file in Notepad it works fine.
This seems like a Sublime error rather than a windows error, meaning it's perhaps trying to do something funky with the file rather than saving it. Has anyone else experienced this?
Thanks to Joakim Erdfelt's answer to my other question I got this figured out!
This is an issue with windows' memory buffering, but you can fix it in a Jetty config file. See the docs for more info. Here's what I did:
Find your webdefault.xml file.
Mine was in C:\Place_where_Jetty_was_installed\Jetty\etc\
Open it and search for UseFileMappedBuffer. Look for this:
<init-param>
<param-name>useFileMappedBuffer</param-name>
<param-value>true</param-value>
</init-param>
Set param-value to false
<param-value>false</param-value>

The specified task executable "cmd.exe" could not be run.The specified executable is not a valid application for this OS platform

I am getting this weird error on Windows 10 when I try to build any project. The projects are working fine if I build them on other OS.
The specified task executable "cmd.exe" could not be run. The
specified executable is not a valid application for this OS
platform.
When I tried to check the log I got to the following code in Nuget.targets file inside .nuget folder, I commented the code and the project builds fine now. I don't understand why the error. Any new projects that I create are working fine...
I am using Visual Studio 2013 on Windows 8, Windows Server 2008 and Visual Studio 2015 on Windows 10.
Code:
<Exec Command="$(RestoreCommand)"
LogStandardErrorAsError="true"
Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" />
What is the reason for this error ?
Is it because of OS or because of Visual Studio ?
How do I resolve it? I don't think commenting the code is the way to do it...
I got the same error, and repairing the corrupted files solved my issue. Try this:
In administrator command prompt, run sfc /scannow
It should emit log file in %windir%\Logs\CBS\CBS.log. Confirm that it repaired cmd.exe. For me I saw something like this Repairing corrupted file [ml:48{24},l:46{23}]"\??\C:\WINDOWS\SysWOW64"\[l:14{7}]"cmd.exe" from store
If that doesn't help you can try DISM /Online /Cleanup-Image /RestoreHealth
See more here
It happened to me when building my project on Windows 10. The problem was that the path of one file was very long (longer than 260 characters). So, by making it shorter, the problem solved for me.
I had the same problem with VS c++ OpenFrameWorks. I tried your suggestion but could not solve the problem. I solved it differently as under.
Soln:
Project Properties ->
Build Events ->Post-Build Event -> Command line
"robocopy "$(OF_ROOT)/export/vs/$(Platform_Actual)/" "$(ProjectDir)bin/" "*.dll" /njs /njh /np /fp /bytes if errorlevel 1 exit 0 else exit %errorlevel%"
Removed Above line from command-line.
OK, Solved.
If you started to face this error after deleting some files :
Unload your project
Edit Your csprok
Delete any reference for the your deleted files
Reload your project and Build
I faced the same issue when building a .NetCore App using a template that includes an Angular app with it, and i tried to delete the ClientApp folder. I had to remove multiple Target and ItemGroup tags from within the csproj.
To those who have landed here:
If you get this message I suggest that you do not, as #Hans Passant suggested, first assume that your machine or Windows has been corrupted.
Instead, I recommend that you suspect that your anti-virus or Carbon Black installation is to blame.
This was the case for me.
Someone from my IT Department disabled a certain Carbon Black policy and everything magically worked again.

Run a batch file during installation

I want to run a batch file – say driver.bat – after the application installation is completed. This has to be done using the Visual Studio setup and deployment while creating package. This question has been asked before, but the solution is giving me a problem: once the installation is done, it’s throwing an error message like:
'cmd.exe' should be excluded because its source file is under Windows File Protection
This issue comes when the file is marked as a protected file on the Windows operating system. You need to exclude the file from this protection to execute successfully. The following link would help you do so -
http://msdn.microsoft.com/en-us/library/x97ae5d9(v=vs.80).aspx

How to prevent Dart from using my home directory?

I'd like to use Dart on a Windows machine where my home directory is configured to be on a network share. I have no control over this configuration.
Initially, I couldn't get the Dart Editor to run at all as the default location for its configuration folder is defined in DartEditor.ini as #user.home/DartEditor. This prevented me from creating new projects at all. I have edited this file so that my Dart Editor configuration folder is now located at c:\DartEditor which seems to solve that problem.
However, when creating a new project, Pub tries to install libraries to my home directory and Dartium tries to save its configuration there as well. This causes Pub to just fail (so I can't build any projects) and Dartium to warn me that storing it's configuration on a network share will cause it to slow down.
How can I prevent Dart Editor (and any associated tools like Pub and Dartium) from using my home directory and instead use a directory on my local drive?
What about to download Dart and unzip it to:
C:\DartHome
I also recommend to change the DartEditor.ini file on the second line to:
C:\DartHome\DartEditor

Resources