Error cs2001 source file could not be found

hello there, i've had this problem with visual.
  • Remove From My Forums
  • Question

  • hello there, i’ve had this problem with visual.

    i’ve posted it here before: http://social.msdn.microsoft.com/Forums/vstudio/en-US/78dae818-4bd4-4f36-b61d-d2cfde2afb49/error-while-debugging-csc-error-cs2001-source-file-could-not-be-found?forum=vsdebug

    but as you can read it’s better to post it here with the suggestions awnsered:

    i tried building the project and got exactly the same error


    1>------ Build started: Project: ZakumMS, Configuration: Debug Any CPU ------
    1>Build started 31-10-2013 17:02:23.
    1>CoreResGen:
    1>  No resources are out of date with respect to their source files. Skipping resource generation.
    1>CoreCompile:
    1>  C:WindowsMicrosoft.NETFrameworkv4.0.30319Csc.exe /noconfig /nowarn:1701,1702,2008 /nostdlib+ /platform:AnyCPU /errorreport:prompt /warn:4 /define:DEBUG;TRACE /errorendlocation /preferreduilang:en-US /highentropyva- /reference:C:UsersRubenDesktoptest1ZakumMSlibDotRas.dll /reference:C:WindowsMicrosoft.NETFrameworkv2.0.50727mscorlib.dll /reference:C:WindowsMicrosoft.NETFrameworkv2.0.50727System.dll /reference:C:WindowsMicrosoft.NETFrameworkv2.0.50727System.Drawing.dll /reference:C:WindowsMicrosoft.NETFrameworkv2.0.50727System.Windows.Forms.dll /debug+ /debug:full /optimize- /out:objDebugZakumMS.exe /resource:objDebugaR3nbf8dQp2feLmk31.lSfgApatkdxsVcGcrktoFd.resources /resource:objDebugaR3nbf8dQp2feLmk31.rFohpatkdxsVcxLfJKhM7.resources /resource:objDebugDotRas.Samples.CreateAndDialVpnEntry.MainForm.resources /resource:objDebugZakumMS.Properties.Resources.resources /resource:f1baea93-8f01-45d3-80f6-63b47e7d5106,f1baea93-8f01-45d3-80f6-63b47e7d5106 /target:winexe /utf8output "CSC : error CS2001: Source file '' could not be found
    1>
    1>Build FAILED.
    1>
    1>Time Elapsed 00:00:02.75
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    things that might be usefull:

    i have framework, and actually i have a lot of them:

    http://prntscr.com/20zr3r all my versions of framework :

    in C:WindowsMicrosoft.NET there is also a folder called framework64, i think thats a 64 bit version? http://prntscr.com/20zqvj

    anything else i need to tell? i can possibly provide more information but i just don’t know if it’s usefull.

    all help appreciated

    • Edited by

      Thursday, October 31, 2013 4:23 PM

Answers

  • Hi,

    Welcome to MSDN.

    In order to narrow this issue, would you mind sharing more information with us?

    1. What is the type of your application and which language do you use? 
    C# or VB.net?

    2. If you build the project, does it has any errors?

    If so, it may be relate to your project, you could post it in these forums to get dedicated support:

    If you are using C#:
    http://social.msdn.microsoft.com/Forums/en-US/home?forum=csharpgeneral

    If you are using VB.Net:
    http://social.msdn.microsoft.com/Forums/en-US/home?forum=vbgeneral

    If you are using Asp.Net: http://forums.asp.net/

    If possible, please update each result of these suggestions which is quite helpful for us to troubleshoot this issue.

    Certainly, if there’s any other information that you think may be helpful, we’d appreciate getting that, as well.

    In addition, you could check whether it is relate to the permissions on the windows temp folder like this

    thread and
    this one. You could also have a try suggestions in
    this thread.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

    Click
    HERE to participate the survey.

    • Marked as answer by
      Caillen
      Tuesday, November 12, 2013 7:08 AM

  • The command line has no source files listed that I can see, just references and resources.  There is nothing to compile.  Ensure that your .cs files all have a Build Action of Compile.

    Michael Taylor
    http://msmvps.com/blogs/p3net

    • Marked as answer by
      Caillen
      Tuesday, November 12, 2013 7:08 AM

Содержание

  1. Error CS2001: Source file ‘.cs’ could not be found [closed]
  2. 4 Answers 4
  3. Linked
  4. Related
  5. Hot Network Questions
  6. MSBuild error «CSC : error CS2001: Source File ‘x’ could not be found» with Linked Files after upgrading to Visual Studio 2012
  7. Source file ‘PropertiesAssemblyInfo.cs’ could not be found
  8. 7 Answers 7
  9. MSBuild error CS2001 source file could not be found
  10. 2 Answers 2
  11. Error cs2001 source file
  12. Answered by:
  13. Question
  14. Answers

Error CS2001: Source file ‘.cs’ could not be found [closed]

Closed 5 years ago .

I am getting the following error on a project of mine when I try to build. Error CS2001: Source file ‘.cs’ could not be found. I took the two files that are causing this error out on purpose because they conflict with other files and cannot be in there. How can I resolve this error without putting the 2 files back in the solution?

4 Answers 4

They are likely still referenced by the project file. Make sure they are deleted using the Solution Explorer in Visual Studio — it should show them as being missing (with an exclamation mark).

I open the project,.csproj, using a notepad and delete that missing file reference.

I had this problem, too.

Possible causes in my case: I had deleted a duplicated view twice and a view model. I reverted one of the deletes and then the InitializeComponent error appeared. I took these steps.

  1. I checked all of the solutions mentioned on this question. The class name and build action were correct.
  2. I Cleaned my Solution and rebuilt. Another error appeared. «Error CS2001: Source file ‘.cs’ could not be found»
  3. I found this answer and followed the steps.
  4. I reloaded the project and cleaned/rebuilt again.
  5. My solution builds without errors and my application works now.

In my case, I add file as Link from another project and then rename file in source project that cause problem in destination project. I delete linked file in destination and add again with new name.

Linked

Hot Network Questions

Site design / logo © 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA . rev 2023.1.14.43159

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.

Источник

MSBuild error «CSC : error CS2001: Source File ‘x’ could not be found» with Linked Files after upgrading to Visual Studio 2012

After automatically upgrading the project file for a .Net 4.0 web application to work with Visual Studio 2012 everything worked ok at first however when compiling I got lots of errors like this:

Description : Source File ‘……….File Path’ could not be found

And when trying to build using MSBuild (passing just the project full path, with no additional parameters) in the «Developer Command Prompt for VS2012» I got basically the same errors:

«CSC : error CS2001: Source File ‘x’ could not be found»

All errors refer to Linked Files (aspx,cs,etc) located in other web applications projects located at a different deep in our code Branch (that’s why all the ‘. ’ at the beginning of the paths)

To me it looks like a problem with the file Length, I had the same problem a while ago when building the projects on our CI server using MSBuild, I was able to manage it by manipulating the project files before building them using a custom script without the need to move the branch around or reduce the deep of the projects, I didn’t have to move anything, the important thing at the time it was that developers using Visual Studio 2010 could compile everything without problems. I learned by this that compiling/Building with MSBuild was different that with DevEnv/VS, and for example MSBuild didn’t support building Setup projects and DevEnv did.

Since this is happening now with VS 2012/DevEnv 2012 , plus that VS 2012 doesn’t support setup projects anymore (like msbuild), plus VS/DevEnv have the same problem with the file length, it looks like VS 2012 its finally using msbuild under the hood or are more tightly integrated, however I didn’t find any article to confirm this.

Changing the branch structure/changing the deep of the projects it’s not an option right now due to several reasons (large code base, high number of projects, risk, timing, effort, etc.).

Does someone have an alternative solution or a fix for this issue in Visual Studio 2012?

Источник

Source file ‘PropertiesAssemblyInfo.cs’ could not be found

I’m running VS2010. When I open my web solution & attempt to build, the build fails with the error «CSC(0,0): error CS2001: Source file ‘PropertiesAssemblyInfo.cs’ could not be found».

I have created Windows applications, but in different solutions.

I cannot find any reference to this file in the web solution/project.

Any help is appreciated.

7 Answers 7

This rings a bell. I came across a similar problem in the past,

  • if you expand Properties folder of the project can you see ‘AssemblyInfo.cs’ if not that is where the problem is. An assembly info file consists of all of the build options for the project, including version, company name, GUID, compilers options. etc

You can generate an assemblyInfo.cs by right clicking the project and chosing properties. In the application tab fill in the details and press save, this will generate the assemblyInfo.cs file for you. If you build your project after that, it should work.

Update 2016-07-08:

For Visual Studio 2010 through the most recent version (2015 at time of writing), LandedGently’s comment still applies:

After you select project Properties and the Application tab as @Tarun mentioned, there is a button «Assembly Information. » which opens another dialog. You need to at least fill in the Title here. VS will add the GUID and versions, but if the title is empty, it will not create the AssemblyInfo.cs file.

delete the assemeblyinfo.cs file from project under properties menu and rebulid it.

Excluding the obj folder from the project (in Visual Studio), that contains the Debug & Release folders will also fix the issue.

Источник

MSBuild error CS2001 source file could not be found

I’m trying to do a command line build on one of my projects using MSbuild. The solution and project builds fine in VS2012, but when I execute a batch file containing

It fails. There are so many errors I cant even scroll up past them. They are all the same error, for different files, all from other projects in the solution:

I have found other questions talking about file name lengths. I tried removing every layer in the path that I could, to no avail. I find it odd that the source file path is not relative, even though the files it can’t find are, indeed, from other projects. i’m at a bit of a loss here. Why does my build fail?

2 Answers 2

Alright, while this may not actually be the same problem others are seeing, I solved my specific problem:

The project in question is an MVC 4 project. MVC has an option you can enable in the project file that builds the razor views as part of the compilation process, ostensibly so you can catch what would normally be run time errors at build time.

This feature has not been particularly well supported, and when you build from command line, it starts looking for things in weird places as it is doing these intermediate builds. The views get built in temp directories, then it attempts to copy it from the project directories, then everything falls apart.

In addition, we need to know the solution dir for some post build events, but that will be irrelevant to most people. We also build to a package, then deploy directly to make it easier to copy stuff out to the various places it needs to go. Building as a package also properly resolves all the solution references the project may have, for more complex projects. I included it here for completions sake.

Here is the line that has it all working properly:

and the simple version that really fixed the problem:

Источник

Error cs2001 source file

Answered by:

Question

I created one team build definition for a project and could successfully execute it. Later on I added one more web form page to the project and executed the same Build but got below error.

CSC : error CS2001: Source file ‘WebForm1.aspx.cs’ could not be found
CSC : error CS2001: Source file ‘WebForm1.aspx.designer.cs’ could not be found

Same error is thrown if I add xml file in the project.

Please let me know the solution as early as possible.

Answers

There are two possible causes.

1. Somehow the files did not get added to source control. To fix this, you can manually add them using Source Control Explorer in Visual Studio.

2. The files were added, but do not show up in the same place on the build machine as they did on the dev machine that added them. To verify this is the problem, check how the files are referenced in the project file by opening in notepad or with the Visual Studio XML editor. Make sure the path to the files is similar to the one that works.

Источник

  • Remove From My Forums
  • Вопрос

  • After installing and configuring RS June CTP, when attempting to deploy a new report or when browsing http://localhost/reports

    I’m getting error:

    Error 1 Server was unable to process request. —> Unable to generate a temporary class (result=1). error CS2001: Source file ‘C:WINDOWSTEMP9a1mhqzb.0.cs’ could not be found error CS2008: No inputs specified

Ответы

  • You’re right this is caused by the permissions on the windows temp folder.  You should only need to grant Read, Write, Modify, and Delete, rather than full control.

    -Lukasz

Понравилась статья? Поделить с друзьями:
  • Error cs1955 non invocable member vector3 cannot be used like a method
  • Error cs1955 non invocable member vector2 cannot be used like a method
  • Error cs1955 non invocable member transform position cannot be used like a method
  • Error cs1729 vector3 does not contain a constructor that takes 1 arguments
  • Error cs1656 cannot assign to translate because it is a method group