Background:
I am trying to use my office machine, where I have some limited rights, from home. All products are installed through when I was connected with my network drives, where my profile exists.
Now, I am at home where I don't have an access to these network drives.
Problem:
Whenever I am trying to create a project in visual studio I am getting the following errors:
---------------------------
Microsoft Visual Studio
---------------------------
Package 'ProviderPackage' failed to load.
---------------------------
Finding:
After doing some research I found that it is due to IISExpress. I have ensured that from Tools > options > Web project that IIS express is not enabled for all new web project.
I also got an error as:
---------------------------
Microsoft Visual Studio
---------------------------
Configuring IIS Express failed with the following error:
Filename: redirection.config
Error: Cannot read configuration file
---------------------------
Then I realized that may be it is not able to instantiate with IIS. Then I have tried to run an IIS express from the command prompt and I got this error:
C:\Program Files\IIS Express>iisexpress.exe
An error occurred while reading configuration information. Make sure
that the configuration file
\NAUNSW001\MalhAm\IISExpress\config\applicationhost.config exi sts,
it is accessible, and contains valid configuration information.
I don't have an access to the registry where this path might be picked by the IISexpress.
I have tried to execute the IISexpress /path: c:\vs\ it worked.
However, even then also when I am trying to create a new project I got an error as:
---------------------------
Microsoft Visual Studio
---------------------------
Configuring IIS Express failed with the following error:
Filename: redirection.config
Error: Cannot read configuration file
Alright - I am able to find the workaround.
If you find this error coming then probably it is to do with the IISExpress or IIS configuration that you may not be able to control from home.
The workaround that I have found is that:
Create Project,
System will not be able to attach the project, however it has been created. Then browse to that directory where the project has been created, and open the project file in the notepad or any editor.
Make sure that <UseIISExpress>false</UseIISExpress>
Before modifying further in the project file, Create a virtual directory in your IIS and point to the project path.
find <WebProjectProperties> in your project file config.
Define the virtual directory path under IISUrl.
Your config file should look something like this:
<WebProjectProperties>
<UseIIS>True</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>0</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost/YourAppAlias/</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
Please use the following path :
Go to MyComputer>Documents>IISExpress>config>applicationhost.config
Right click on applicationhost.config and go to "Properties" option.
Now click advanced button and uncheck Encrypt contain security data.
Hope this will solve your problem...!!! :)
I had the similar issue could not even start a web project in vs 2013.
None of solutions suggested worked
So i tried the following
Gave read & write permission to following folder
C:\Program Files (x86)\IIS Express\config(default installation iisexpress8)
made sure both subfolders schema and template have read & write access
Then went in to schema folder and renamed asp net_schema.xml and ran iisexpress.exe from command prompt.
It started iis express and successfully registered url "xxxx" for site "webisite1" application
After that i quit iisexpress and renamed the schema file again to the old name.
After that i had no issues starting a web project
I found this it in a strange manner!
look for the IIS config file in my case it was.
C:\Users\\OneDrive\Documents\IISExpress
But accidentally my One Drive was paused. So it was able to access that files in the folder below.
C:\Users\\OneDrive\Documents\IISExpress\config
So just make sure IIS has access to configuration files.
open C:\Program Files (x86)\IIS Express\config.
open schema folder and rename ASPNET_schema (e.g ASPNET_schema1)
copy in run and hit enter "C:\Program Files (x86)\IIS Express\iisexpress.exe" /userhome:c:\temp\iisexpress
and you are all done. enjoy
Related
I am trying to create new file in visual studio 2012
fileStream = new FileStream("google_com.txt", FileMode.CreateNew);
But i keep getting this error
Access to the path 'C:\Program Files (x86)\IIS Express\google_com.txt' is denied.
Plz help to fix this poblem.
Solutions:
Put a specific location for google_com.txt file. like C:\google_com.txt. Actually it is not allowing to create the file in default location(inside program files) as it might not have the proper privilege.
If you want to create the file in default location(inside program files) run Visual Studio as Administrator.(R-Click-> Run as Administrator).
Run Visual Studio as Administrator
You can't write to the Program Files folders on Windows Vista or later unless you're running elevated/as an administrator.
You should be writing to the application's App_Data folder if you need to write anywhere. Look into using Server.MapPath().
If this is in a web app, the file will be created in the application's root, which in this case is your iis express directory. Run Visual Studio as Administrator, or change the location of the file by specifying an explicit path.
Official Microsoft response:
Issue occurs because of missing permissions on a local resource that
the ASP.NET application tries to access If you are unable to get a
clear description of the problem because of a custom error message,
run FileMon and reproduce the problem. Stop and save the capture as
FileMon.xls and open the file in Microsoft Excel. On the Data menu,
click Filter, and then click AutoFilter to use the filtering
capabilities of Excel. Now select the drop-down list in column F and
look for "ACCESS DENIED" errors.
A sample FileMon output is shown below. 10381 1:01:11 PM w3wp.exe:2320
OPEN C:\winnt\microsoft.net\framework\v1.1.4322\Temporary ASP.NET
Files\sessiontest\8832e585\275ec327\global.asax.xml ACCESS DENIED NT
AUTHORITY\NETWORK SERVICE As you can see from the filtered results,
we have narrowed down the cause of the problem. FileMon shows that the
NT AUTHORITY\NETWORK SERVICE account is missing NTFS permissions on
the C:\Winnt\Microsoft.net\Framework\v1.1.4322\Temporary ASP.NET Files
folder. This should be straight forward to fix. For more information
about using FileMon to troubleshoot ASP.NET, click the following
article number to view the article in the Microsoft Knowledge Base
https://support.microsoft.com/es-ve/help/910449/troubleshooting-common-permissions-and-security-related-issues-in-asp
Try this:
Server.MapPath("~/ FolderName / google_com.txt ")
I try to publish a site to: http://lolacyclingclub.org/ , but I get this error:
Error 2 Copying file bin\DotNetOpenAuth.AspNet.xml to obj\Release\Package\PackageTmp\bin\DotNetOpenAuth.AspNet.xml failed. Could not find file 'bin\DotNetOpenAuth.AspNet.xml'. 0 0 Lolabike
What exactly you have to do?
I found something that I have to delete the bin folder? Is that correct because it seems strange?
I see now this error:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator to inform of the time the error occurred and of anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Web Server at lolacyclingclub.org
I dont know this error. has it to do read/write permissions? Or something like that?
I had similar problem. I referenced some libraries (which had reference to another libraries) in my ASP.NET web application. Unfortunately after project rebuild dll's which were previously copied to bin folder were deleted. This caused publish problem very similar to your problem. Solution was to copy all needed files to bin folder. I guess you need to put your files back to bin folder and it will publish successfully.
Deleting bin folder is not an option - these files are needed;)
I recently switched computers and copied all my projects over to my new local drive. I reformatted the computer I'm on now so it was pretty much a clean machine. Everything seemed to be working fine, but when I opened one of my projects that I had been running from my old machine, it would no longer compile, and I get the following error message:
Could not write to output file 'c:\Users\user\Documents\Projects\RegressionWeb\OnetouchUpload\obj\debug\OneTouchUpload.dll' -- 'Access is denied.'
I'm getting an error like that for each project I have in my solution. I'm also getting this error:
Unexpected error creating debug information file 'c:\Users\user\documents\projects\RegressionWeb\RegressionWeb\obj\Debug\RegressionWeb.PDB' Access is denied
I've searched high and low, and the only similar issues I could find online related specifically to ASP.NET and IIS, neither of which has anything to do with my project (My projects are class libraries of mostly NUnit tests with some support classes).
I am the administrator on my local machine. I have already taken ownership of every file in the project using takeown /f .\RegressionWeb /r /d y and also tried to ensure that nothing had a status of Read-only, but the following file threw an error when I tried changing the read-only property of it's parent folder:
An error occurred applying attributes to the file:
C:...\Regressionweb.sln.DotSettings.user
Access is denied
Basically this project was working perfectly and had no errors from my old computer. After copying over everything, this DotSettings.user file will not be modified, and Visual Studio can't write to any of the dll files. I'm sure the answer must lie in a Visual Studio setting somewhere. Any and all suggestions would be greatly appreciated.
I think Karl has it right. I had a similar situation once, and what I did was delete the file in question, clean the solution, and then rebuild. If the project needs that file it should recreate it; in my case it didn't need it because it never recreated it, but the project ran just fine.
One other thing I would recommend; you may be selecting the read-only attribute of the parent folder off and selecting this setting to recurse through all sub-folders and files, but that doesn't mean that's what's happening. For all your sub-folders and files (especially the ones that are cropping up as errors) inspect each one individually and make sure the read-only attribute is off.
My money is on your files are read-only. Verify they are read-only and change them or add your files to a source control system and let them get handled by that.
I was able to get this working by closing Visual Studio and then opening it again, but being careful to run Visual Studio "As Administrator". To do this, from the Start menu, right click on Visual Studio and choose "Run as Administrator".
it seems that the same error is sometimes displayed when the app pool user doesn't have access to the %TMP%/%TEMP% folder.
You'll need to grant IIS_IUSRS read and modify access over the temp folder of the user the app pool is running as.
This could either be the temp folder in the app pool user's profile, e.g. c:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp, or the system temp folder at c:\windows\temp.
See if it is related to this:Could not write to output file - Access is denied
. That would be a bit of a bugger to track down. In this case the project is self-referencing the dll and preventing access to the file.
This has a very simple solution, you just have to make sure that your directory name(folder name) is not the same as your file name. I created a folder by the name Pointers, my code was in a file pointers.cpp. When I compiled the code it kept showing the same error. I just had to change the directory or folder name to L1_pointers. You can change it to anything you want and it worked.
I have a WPF application . While building it I am getting the following error:
Could not load file or assembly or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
Application is trying to load the assembly from virtual drive (as debug Folder)
Ex: [subst r: c:[my Assembly bin pth]
Earlier I was mounting c:\bin as a netwwork drive and was getting te following error.
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.
Edit:
I am not able to find the Unblock button in properties window by the way.
Clear out the temporary framework files for your project in:
For Windows 7, the path is:
C:\Users\[username]\AppData\Local\Temp\Temporary ASP.NET Files\
For 64 bit systems with 'Framework' in the path the full path is:
C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\
http://www.solutioncottage.com/ShowSolution.aspx?solID=59
Removing all temp files from the path below still works, it saved my development site hosted on a web server from (HRESULT: 0x80070057 (E_INVALIDARG))
C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET
Files\
On Visual Studio 2019 I was able to fix this manually deleting the ".vs" folder into the solution directory.
Thanks
this happened to me when i got a blue screen while building.
i had to delete my packages and bin folders, and get then from TFS
at that time i had nothing in the following location...
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files
to resolve i set Visual Studio in debug mode and then monitored the above directory. i deleted the files as they appeared and then the app started working again.
time to start looking for a new Dev machine.
For the Error which you were getting when you were mounting is due to blocking for Assemblies/DLL. Right click on what ever DLL's you have downloaded and you will get an option to unblock it .
For the Could not load file or assembly or one of its dependencies error, put a breakpoint in the constructor of the starting class and check it is failing due to what.
I was encountering this problem after a windows 8 blue screen error while building my wcf service. I tried all suggestions above.. but it didn't solve the problem.
Lastly, I removed and recreated the new application from IIS on the same wcf project.
Then every thing works fine.
Quoting this SO answer:
This can happen while referencing COM wrapper dlls.
Go in your Visual Studio Project, under References, select the referenced COM wrapper assemblies, right click, preferences, and make sure that Embed Interop Types and Specific Version are both set to False.
#Ernest 's answer worked for me on Visual Studio 2022
On Visual Studio 2019 I was able to fix this manually deleting the ".vs" folder into the solution directory.
I am getting below mention error in VS 2010. After getting this, Just restarting my machine and its working fine. But while hosting my application in windows server 2008 + IIS 7.0 its not working. Could you please suggest.
Error 107 Unable to copy file "C:\Inetpub\wwwroot\solution\Data.dll" to "bin\Debug\Data.dll". The process cannot access the file 'bin\Debug\Data.dll' because it is being used by another process.Services
Error 106 Unable to copy file "C:\Inetpub\wwwroot\source\Business.dll" to "bin\Debug\Business.dll". The process cannot access the file 'bin\Debug\Business.dll' because it is being used by another process.Services
You are compiling the application while it is running and IIS is using the DLLs.
The result is that the compiled DLLs cannot be copied because IIS is using them.
Reset IIS (or at least recycle the relevant application pool) before compiling.
You may want to reconsider setting the IIS web application folder to the project output folder.
Please check your Build Configurations under (VS2010) Build->Configuration Manager.
All projects should be in Debug or Release mode, and also check that the project Build check box is checked correctly.
Command prompt
copy source destination give full path of destination
copy C:\Inetpub\wwwroot\solution\Data.dll" "bin\Debug\Data.dll"
this is for copying file on the the same computer