LNK1181 cannot open input file. space error? - c#

I am having an compile error while trying to build my Windows Forms Project.
My solution contains:
2 c# projects (one that creates a binary & one that is just a class with functions)
2 C++ projects (imported from another solution)
After import I had to re-reference the "Include Directorys" in the (project)Settings->VC++ Directories
These 2 solutions work but Im trying to have one solution instead of 2 ( them toghether. After import I had to re-reference the "Include Directorys" in the (project)Settings->VC++ Directories
And now I am getting this error:
Error: LNK1181 cannot open input file
"C:\SDK\Bin\x64 Release\\VS2017-PC.lib"
There are 3 problems with this link:
It contains a double backslach
It has a folder that is missing (C:\PC)
There is the name "Release" instead of debug
The path should look like this:
'C:\PC\SDK\bin\x64 debug\VS2017-PC.lib'
I think it is because my folder "x64 debug" contains a space and is creating this error. But I dont know how to rename and refresh the paths correctly inside the solution and I dont even know if that would really fix this error.
Image of project Property Pages

The solution was to create the missing folder.
For some reason Visual studio didnt create "x64 debug" in the right directory.

Related

Can not change original file name,Compiler Error Message: CS0433:

It's a little bit complicated.I got a .net class library project form someone else and added it in my solution referenced by a asp.net mvc project. For some reason I changed the project name form "abc" to "xyz" and also Assembly name, Default namespace name in project properties page. I could build the solution and get the xyz.dll in the bin folder.
The problem is I can't run the web application because of the error "Compiler Error Message: CS0433:". I looked into the folder "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\" and found out the abc.dll still there and I checked the file detail information on properties page. The file description and product name are the same xyz, but the original filename is still abc.dll. I really don't know what's going on here.
I wish some could help me out,Thanks in advance.
You have to delete abc.dll from the root directory and then recheck it. Because IIS configure with this file and after changing it will not rebuild with this files as well.
Did you rename it in a file explorer or using Visual studio? Check the .csproj file and the .sln file and make sure all references in there reflect the new names. Also, check your dependencies and references to make sure they point at the new dll, and not the old one
You probably have figure it out but for other peoples who might search for the solution.
Right click on your solution or project file -> Click on properties -> And then there is first tab with name application Click on that. You will find two text box one for Assembly Name (Change this to xyz).
see attached image.properties dialogue box

C# can't find properties file, how do I repair this?

I had a Properties file called RecentFileList within my Visual Studio 2012 project and I removed it. I believe it was a .settings file. Now when I run my setup project, it is trying to copy files that it shouldn't care about and it's bombing out as a result. I get 3 errors (-1007 -6271 and -6103), all related to the same missing file.
-6103: Could not find file "C:\Users\Charles\Documents\Visual Studio 2012\Projects\RallyCourses\RallyCourseDesigner\bin\Debug\Properties\RecentFileList.Designer.cs
What file do I need to edit to get rid of the reference to this file? I tried searching for RecentFileList.Designer.cs, but can't find it.
The offending files in my situation were trying to be installed by the installer, but I had removed them from the main project. Within the SetUp project, there is a section Specify Application Data -> Files. I found the files in the Properties section there, removed them, and things are working now...

Visual studio linked files with TFS - automated build does not work

I have two Visual Studio solutions, one for WebApi and one for WP7 development, I am linking some dto files from WP7 solution to WebApi solution, this works great.
I just added the solutions to Team Foundation Service preview, and tried to get it to build. Since the linked files doesnt get added to source control, I cant build the project, because it cant find the linked files.
I tried adding the WP7 solution to the same directory in TFS, but no luck.
Edit- More information:
I get: CSC: Source file '....\TennisTracker.Client.Ui\TennisTracker.Client.Core\Models\GameDto.cs' could not be found
Then I add the client solution under "Edit build definition - Process - 1. Required - Items to build. I get this: C:\a\src\TennisTracker.Client\TennisTracker.Client.Ui\TennisTracker.Client.Ui.csproj (140): The imported project "C:\Program Files (x86)\MSBuild\Microsoft\Silverlight for Phone\v4.0\Microsoft.Silverlight.WindowsPhone71.Overrides.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.
In the error console, in visual studio, it gives me this error: Error: API restriction: The assembly 'file:///C:\Users\markka\AppData\Local\Temp\VSTFSBuild\ae65cc1a-850e-4112-8c34-96674d8c79f3\2052550994\nunit.core.interfaces.dll' has already loaded from a different location. It cannot be loaded from a new location within the same appdomain.
The workspace is set to the entire directory, containing both solutions
Under the build definition you can define the workspaces which you can point / setup paths to the other project.
Best thing to do is post up the build error output and I can then hopefully let you know the exact path you need to setup

Could not find file 'obj\Debug\OldProjectName.csproj.FileListAbsolute.txt

I'm trying to publish project (tools vs2010), but cannot all the time getting the error below.
I paste to my projects files from another project and then I changed namespace (OldProjectName) to the parent project (NewProjectName). But it still getting information from somewhere about old project.
I cleaned solution, builded, rebuilded. Closed and reopened again and all the time the same error.
I'm able to build project but publish it.
Any ideas what can cause the problem?
Error 1 Copying file
obj\Debug\OldProjectName.csproj.FileListAbsolute.txt to
obj\Debug\Package\PackageTmp\obj\Debug\OldProjectName.csproj.FileListAbsolute.txt
failed. Could not find file
'obj\Debug\OldProjectName.csproj.FileListAbsolute.txt'. 0 0 NewProjectName
Open your .csproj file in notepad
Find "obj\Debug\OldProjectName.csproj.FileListAbsolute.txt"
Remove that line and save it
Open your project and try to publish it and this time you will be succeeded.
Note: if you are getting any more file like .pdb remove that as well.
Hope it will help you
Make sure the obj folder is not read only, if so change read only property of this folder to false. this worked for me.
Check the permissions to the folder obj\Debug\ if you give it write permissions, the error would go away.
Check if the folders "bin" and "obj" are checked-in to source control, if so delete those two folders in source control. There is no need to check-in these two folders to source folders. Also make sure that these folders "obj" and "bin" are deleted from your hard disk, they will be created again after a build.
Hope this will fix your issue.
It is your responsibility to make copies so you can go back to one.
Open your project file (vb/cs)proj with a notepad, and search for the missing files.
In my case I got this error when I tried to publish the project and certain files were not found.
Each publish attempt I got another file name, after checking that the file actually didn't exist in the project, I removed it from the project file, manually.
Then publish succeeded.
Delete the obj folder and build again.
Ref: http://forums.asp.net/t/1402005.aspx
Like many others these files were read only and needed to be deleted or actually able to be overwritten by VS. However, as may be the case for many others, the problem was because these files were checked in to source control. Your bin and obj folders should not be in source control. Mark them for delete and submit the changelist.
One exception to the rule is for the bin folder could be dll files that are not .Net compatible. Such as a C/C++ dll that you are using through a .Net wrapper dll. I mark them as content so that they get published and check them into source control.
I too had this problem. I resolved this by deleting files inside project bin folder (.dll and .pdb) and closed and re-opened VS .
The file named FileListAbsolute.txt was deleted from the folder obj/debug. Visual Studio can automatically recreate the file and others in the obj/debug for you.
For VS to recreate it, set the configuration of the solution and the project to debug mode. Then rebuild your solution.
To change the configuration mode to debug, from the solution explorer, right-click on the solution name and select Properties.
Select Configuration under Configuration Properties. Then select Debug from the dropdown list.
Click Apply and OK. Ensure that in Configuration Manager, the configuration mode is also a debug mode.
Then rebuild your solution.
For me using solution here: Certain Razor views not publishing
Excluding the views folder and re-including fixed it for me. So it's possible for anyone else experiencing this it may be as simple as excluding and then including the file/folder in question of your project.
I encountered this bug using VS2017 with a solution stored in OneDrive.I suspected OneDrive's sync mechanism to be the root cause of this.
When I tried to reproduce using VS2019 however it did not reappear. Looks solved in between these versions.

Post build copy config file to another project

I have a solution which contains a website and various class libraries. The exists on the file system like so:
C:\Projects \MyWebsite\dev\MyWebsite.sln
C:\Projects\Core\MyClassLibrary1.csproj
C:\Projects\Core\MyClassLibrary2.csproj
I want to move the App.config file from MyClassLibrary1 project to the bin of the MyClassLibrary2. I want to do this on post build in VS or MSBuild using relative paths if possible. This way anybody checking out the projects will not have to modify any paths if they choose to locate the project in a different location.
I have already tried the following approaches but to no avail.
copy /Y "$(ProjectDir)App.config"
$(ProjectDir)\..\ MyClassLibrary2\$(OutDir)\ MyClassLibrary2.dll.config"
Any ideas?
Thanks
Consider adding the App.config file in your second class library using Visual Studio Add As Link.
Add -> Existing Item -> Add As Link
The Add As Link command is shown if you click the dropdown next to regular Add button in Visual Studio. This way you can reuse the file in multiple projects.
Try some other common MSBuild properties, although João has a better suggestion I think.

Categories