I have a WPF project that I am ready to deploy using Visual Studio 2012 but I'm running into missing file issues. I've searched for hours to find nothing but incorrect information about VS2k12 not even having ClickOnce support to it being a bug in VS that was claimed to be fixed in an update but people still complain the update didn't fix it.
If I Start the project in VS it runs fine and my test button works as expected.
When I Publish the project, the publish succeeds, running setup.exe installs successfully and program starts to main window fine.
Clicking test button crashes the application on a FileNotFoundException.
Line that causes crash:
streamReader = new StreamReader("ReceiptTemplates/templates.xml");
FileNotFoundException:
Could not find file
C:\Users\dirt\AppData\Local\Apps\2.0\GEDD6PQW.N72\8M9ONPGG.TVB\prof..tion_40c30d08e677b188_0001.0000_985901e6c8ad767f\ ReceiptTemplates\templates.xml'.
Exists:
C:\MyProject\bin\MyMode\ReceiptTemplates\templates.xml
Confirmed Does Not Exist: C:\Users\dirt\AppData\Local\Apps\2.0\GEDD6PQW.N72\8M9ONPGG.TVB\prof..tion_40c30d08e677b188_0001.0000_985901e6c8ad767f\ReceiptTemplates\ReceiptTemplates\templates.xml
The templates.xml file has a Build Action of Content.
Note: There are other folders/files in the ReceiptTemplates folder that are present such as folder/item.html and picture.bmp, just not the templates.xml file that I can tell...
What am I missing?
Thanks to #drch for this:
In my case the ReceiptTemplates/templates.xml file was set to be a "Data File" and not "Include".
Solution:
Right click Project -> Properties -> Publish -> Application Files
Find file causing issue and change it to Include
If it says 'Data File' its in the data folder
If it says 'Include' its in the bin folder
Check in C:\Users\dirt\AppData\Local\Apps\2.0\Data for it ;)
Related
I am getting this error for various DLL's which are outputs of projects in my solution.
Things I have tried:
Restarting PC multiple times
Closing visual studio
Turning off all visual studio extensions
Deleting the files manually in the explorer. I get the error "The action can't be completed because the file is open in another program"
Using ProcessExplorer to find processes that are using the DLL's. It does not find any processes
I have tried using ResourceMonitor and WhoLockMe as well, to no avail
I have killed the explorer.exe process and that didn't work either
From command line I ran 'git reset --hard HEAD' to revert to the last commit (which was a stable build)
Any other ideas how I might be able to unlock these files?
Update: Turns out that some of the DLL's in every solution that I opened with Visual Studio yesterday are permanently locked
I do not have Visual Studio Achievments installed and I have disabled all extensions. Closing open documents did not help.
Somehow the issue solved itself after I did the following:
Clone the project into a different folder
Build and run the cloned project with Visual Studio
A few hours of programming later I tried to delete the files and they were no longer locked
I have a web application developed in ASP.NET that compiles correctly, however it gives the following error when trying to publish it.
Copying file obj\Debug\CoreCompileInputs.cache to obj\Release\AspnetCompileMerge\Source\obj\Debug\CoreCompileInputs.cache failed. Could not find file 'obj\Debug\CoreCompileInputs.cache'.
Screenshot 1
We use three computers to publish this application (generate the Web Deploy Package). In one of these PCs the problem seems to be solved by following this steps:
Close all Visual Studio tabs
Clean Solution
Close Visual Studio
Open Visual Studio
Recompile
Publish
But on the other two computers the following error continues to appear:
Error reading resource 'ProjectCycle.obj.Debug.ProjectCycle.Migrations.ModelsMerge.resources' -- 'Could not find file 'C:\Users\Chiappa\Documents\GitHub\ProjectCycle\ProjectCycle\ProjectCycle\obj\Debug\ProjectCycle.Migrations.ModelsMerge.resources'.' ProjectCycle C:\Users\Chiappa\Documents\GitHub\ProjectCycle\ProjectCycle\ProjectCycle\CSC
Screenshot 2
Any idea why this might be happening?
Suggestions on how to correct this problem?
Summary:
I have an ASP.NET web application that compiles correctly but fails when trying to generate the Web Deploy Package.
I solved the problem by excluding the "obj" folder from the Visual Studio project.
Right clic on the "obj" folder in the Solution Explorer, Exclude From Project.
As simple as that!
You could try going to the properties of the file and force the copy to the output directory.
Select the file on Solution Explorer
Press F4 OR Right-click and go to "Properties"
Change the value of "Copy to Output Directory" to "Copy Always"
Also, your Version Control may be locking the output directory (the "bin" folder), try deleting it manually.
I'm running my .NET 4.0 (C#) project in debug mode after I start VS2013. It runs just fine.
The second time I start it from VS, I get the Dialog box that says "Error while trying to run project: Unable to start program C:\path\to\file.exe"
The process is still alive in the Taskmanager when I dismiss the dialog box.
From Windows Explorer, I can run the program just fine. And after closing it, the process is gone too from the Task Manager.
A rebuild doesn't help.
Is this a common problem with a known solution?
I had an issue similar to this and I had to clear the component cache instruction can be found Here.
Hope this helps.
For my case, it cause by Platform target, you could force choose it to x86 or x64 which your project is:
Each Project's Properties > Build > Platform target
As I pointed out also here, the only solution that worked for me was to disable the ConEmu integration:
ConEmu → Settings → Integration → Default term → disable Force ConEmu as default terminal for console applications
Some users reported that it was enough for them to disable the Aggressive mode in that same settings tab; that wasn't the case for me though.
The topic is old, but this might help someone else.
So in my case I made a file in Visual Studio with .cp extension (accidentally deleted the last 'p') this made visual studio just "include" the the file and not mark it as a compilation unit, thus not compiling it, I looked the *.vcxproj file in a text editor and found out about this, so if you open the project file in a notepad or something just find your file at the bottom usually and change from <Item .../> to <ClCompile .../>
I was getting similar errors. I just had to restart visual studio. Sometime couple times a day.
I had a similar error and resolved it by cleaning the solution. Right-click the solution name in Solution Explorer and choose Clean Solution.
I found a solution here:
Please check "Use Managed Compatibility Mode" under Tools|->Options->Debugging->General.
I'm Brazilian, I don't speak English very well. I did this translation on google translator.
I know the topic is old, but it can still help someone.
I had this same problem in the following situation, I have a dual boot computer (linux debian 11 and windows 10). Inside debian, on my NTFS D disk, I created a folder to perform programming tests. After accessing that same folder with windows, I created a new project in visual studio inside that same folder that I had created in linux. The creation of the project went without problems, however when I tried to run the project (F5), I received the same error from this topic. I tried all the solutions I found on the internet, and nothing worked. I gave all permissions to my admin user and it still didn't work. Then I realized that even going straight to the folder where the application's executable was and clicking directly on it, I still received the access denied error message. So, I took the project out of the folder I had created in linux, and it worked. So, what I could conclude, is that because the folder where my project was was created in linux, for some reason, my windows didn't trust this folder, so it didn't allow running executables from inside that folder, even this one executable having been created by visual studio from within windows.
Just simply create a folder name as "projects" in c drive and copy paste the newly created project in it. Run the project by doing clean & Build or Rebuild method . It will work
open the folder which contains the solution in visual studio.
again, open your *.sln file by double clicking it inside the solution explore once opened try running the solution or rebuild the solution. once rebuild gets completed, it will open without error from next time.
My way of solving the error : error while trying to load project : Unable to start program and c:\Path\to\file.exe was simply by
First restart Visual Studio
Click the build icon
Select the rebuild option
Run the Program or Debug the Program
This was a weird one. Going to put what happened to me here because it might happen to someone else. Everything was fine with the app until suddenly after some fairly insignificant code changes I suddenly started getting this error. Visual Studio was compiling the executable just fine. But, the moment I tried to run it (either from Visual Studio or directly) the executable file would be automatically deleted right out of the Debug folder. Super odd--never seen anything like it. I began to get suspicious that perhaps an anti-virus or the OS was somehow identifying a checksum or some signature in the executable as "dangerous". Or perhaps some obscure compilation bug was corrupting the executable. So on a hunch I made another innocuous change (added a couple of lines of code to color code some text in a rich text box) and the problem went away.
I created a C# Website using Visual studio 2015 in my laptop, i copied the same folder to my desktop system and open in Visual studio 2015, when i try to run the application its suddenly gives following error.
The operation could not be completed. The system cannot find the path specified
Anybody feel same error in your latest Visual Studio 2015? I updated all the latest patches.
following trial are done
Re created the soluition file(.sln)
Deleted Web.config and added new one
Still the error exists, so i cant able to debug or run the application.
(1) Run VS as an admin (or elevated access) and open the solution.
(2) Set up a project as Start up Project (if you have multiple proj)
(3) Set up page as start up page.
this should help you run it
Create manually (Windows Explorer if necessary) a folder with name "Service References". Even if the folder does not appear in the Solution Explorer, is there.
Try adding the wsdl (xml) file again.
I had the same problem, resolved by creating a Connected Services folder in my project.
So juste create a Connected Services folder or a Service References folder in your project
I experienced this error. When I shorten the file path of the solution, the error disappear. I think you may put your solution to a folder with too long path name or your solution have some file with too long name.
I got a more specific project-load error message when I removed the project from the solution and tried to re-add it. In my case, it was because the URL/address of the application had changed in my local IIS. When I updated the tag in the .vbproj (or .csproj) file to the new value, then the project loaded successfully.
When I run my application on VS2015 I get a window saying that csc.exe has stopped working like below:
After I click to close the program I get another error in the browser saying:
Server Error in '/' Application.
Detailed Compiler output looks like below:
C:\Program Files (x86)\IIS Express>D:_myURL\bin\roslyn\csc.exe
/t:library /utf8output /nostdlib+
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.dll"
What could be the issue?
I faced the same issue and I would suggest to follow the steps described here:
Close all instances of Visual Studio 2015 and if they don't do it automatically disappear, end tasks for all the VBCSCompiler processes.
In your Visual Studio project under Bin folder you will see a roslyn folder (new for VS 2015)
Delete the roslyn folder and all contents within.
Restart Visual Studio 2015
Re Build your project and all should be well again.
I too faced the same issue.After I delete files in the bin folder and run the application.The issue is fixed.
-532462766 according to my efforts to help you, is an error that occurs when an unhandled exception is thrown.
I am sorry, i cannot help you much. My suggestion is to start debugging your program, by either using a debugger, or by wrapping some bits of your code in try-catch blocks, like in the example below:
try {
// Your code here
} catch (Exception e) {
System.Console.WriteLine("Error caught");
}
And your details are very vague. I can only help If you show the line/group of code causing the error.
However, the fact that csc.exe stops responding is intriguing, You can try to uninstall .NET Framework and reinstall it, you can find the downloads here: https://www.microsoft.com/net/download And if reinstalling it doesn't help, I am terribly sorry.
For this kind of errors, I always go to Event Viewer eventvwr. Please expand Windows Logs and click Application.
If you cannot see your entry, you can easily filter it out - right click on
Application and choose Filter Current Log. Check Critical, Warning and error and push OK. After that, you'll see detailed information in main view.
Below steps are what i did and worked for me.
1. Remove virtual directory from the IIS.
Open IIS (Start -> Run -> inetmgr -> enter)
Find your project virtual directory (expand hostname -> Sites -> Default Web Site -> MyProjectName)
Delete the virtual directory (Right click -> Remove)
2. Create virtual directory again via the VS 2015
Switch to Visual Studio
Open project properties ( Right click to MyProjectName on the Solution Explorer -> Properties)
Open the Web tab from the left menu
Click Create Virtual Directory button Under the Servers section.
Run the project again and It's done.
Hopefully it helps to someone else.
]I found I had to end task "VBCSCompiler.exe" in TaskManager. There after I could successfully clean the solution /bin directory and the error disappeared.