This is probably a novice MS build query.
I have created an empty C# project called Database with only database sql scripts. The reason for doing this is to have the scripts output into the TFS build drop folder, since adding scripts as solution items were not output without changing templates/tweaking the XAML files.
However I noticed that the new project does not have a main entry point and hence compilation fails. So i went to Build Configuration manager and disabled both 'Build' and 'Deploy' which means I do not get the compilation error.
But the problem is that I am unable to find the scripts output anywhere in the TFS build drop folders. Please advise.
To resolve your compilation error:
Open the project properties.
Select the 'Application' area on the left (if it is not already selected)
Change the 'Output Type' from Console Application to Class Library
Once this is done you will be able to build and deploy without compilation errors even though you do not have a main() entry point.
This still will not resolve your concern about the 'Copy to Output Directory'. Visual Studio by default recognizes .sql files as having a build action of Content with an Output property of 'Do Not Copy'.
Related
I'm unable to debug a project. I'm getting the "The breakpoint will not currently be hit. No symbols have been loaded for this document" error. I've tried everything I could find online, but nothing has worked. I'm hoping someone out there will be a fresh pair of eyes to find the problem.
First of all, I inherited this project from a coworker who has left. He did development on his machine where he was able to debug it. He uploaded it to Subversion which is where I got it. Another coworker was able to download it and debug, but I cannot.
Second, I'm using Visual Studio 2015. The project is an asp MVC project. There are two projects in the solution: the main project with the views, controllers, models, etc. and the secondary project which is only the Telerik.OpenAccess code (the "data layer"). It's this secondary project that I can't debug.
* Update *
Following a suggestion on another board, I hit a break point in my main project and went to Debug-Windows-Modules where I can see the message "Binary was not built with debug information". I went to the folder shown and can see my pdb file was not made at the same time as my latest dll fill. My project is set to debug mode and build. What do I need to change to get the pdb file to be recreated along with my dll?
* End Update *
So here's the line in the main project I've got my breakpoint:
rep.UpdateWorkOrderVendorHeader(oaObj);
The breakpoint hits here. It's calling a function in the secondary project. When I try to step into that function, it skips to the next line in the main project. If I look in the secondary project, I see the "symbols not loaded error". I also have a breakpoint directly inside the secondary project and still it gets skipped:
I've found two stackoverflow streams that covered a variety of scenarios, but nothing has worked for me:
Fixing "The breakpoint will not currently be hit. No symbols have been loaded for this document."
The breakpoint will not currently be hit. No symbols have been loaded for this document in a Silverlight application
Here is everything I think I've tried so far, but I may have missed something:
Restarted Visual Studio
Deleted code and copied code from co-worker that could debug secondary project
Build - Clean and Rebuild & Clean and Build
Deleting bin and obj folders
Checked configuration set to debug and build
Checked debug and trace constants are checked in the project properties
Click Debug - Start new instance on secondary project
Selecting multiple startup project (threw error saying the secondary project could not be started directly)
Debugging in IE instead of Chrome
Checked the reference to the secondary project in the main project has the correct directory
Checked that Project - Properties - Build - Optimize code was unchecked
Checked that Project - Properties - Build - Advanced settings were the same for both projects
Checked that Project - Properties - Build - Advanced - Output was set to full
Adding to the secondary project's App.config
Making sure I was running Visual Studio as administrator
Checked that Project - Properties - Build - Output path was /bin
I'll include seem screenshots of the config and properties below. Below is also a description of my project tree with some of the relevant files. I'd appreciate any suggestions you can give me. Thank you!
Koorsen (main project)
References
Koorsen.OpenAccess (secondary project)
C:\inetpub\wwwroot\Koorsen\Koorsen.OpenAccess\bin\Debug\Koorsen.OpenAccess.dll
bin
Koorsen.dll
Koorsen.pdb
Koorsen.OpenAccess (secondary project)
bin
Debug
Koorsen.OpenAccess.dll.config
Koorsen.OpenAccess.pdb
Koorsen.OpenAccess.dll
Telerik.OpenAccess.35.Extensions.dll
Telerik.OpenAccess.35.Extensions.xml
Telerik.OpenAccess.dll
Telerik.OpenAccess.xml
Release
Koorsen.OpenAccess.dll
Koorsen.OpenAccess.dll.config
Koorsen.OpenAccess.pdb
Telerik.OpenAccess.35.Extensions.dll
Telerik.OpenAccess.35.Extensions.xml
Configuration Manager:
Build properties:
Advanced debug properties for main project:
Advanced debug properties for secondary project:
Didn't receive an answer, but I was able to figure this out over a couple of days of trial and error. Posting this here in case it helps someone. Here is what I ended up doing.
Put a break point in the main project and ran the solution. When it hit the break point, I went to Debug->Windows->Modules. Found the name of the dll for the secondary project and noted the folder it was trying to use. I my case it was in C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\vs\213421ba\66682af2\assembly\dl3\e121f20c\957624fe_d9ded101. The dll and pdb files did not have the same date. Rebuilt the project; the dll was updated, but not the pdb. Found a suggestion in another forum suggesting deleting the dll and pdb and rebuilding. This didn't work; the dll was recreated, but not the pdb. I deleted the entire vs folder.
Used NuGet package manager to uninstall and reinstall 2 Telerik Data Access packages to all projects.
Deleted the bin and obj folders in the secondary and main projects. May have been able to get away with just doing this in the secondary project.
At this point the secondary project compiled, but the main project did not.
Had to add some dll files back to the bin folder of the main project from third party extensions.
Still would not compile. Compared every reference, bin and obj file to those of a coworker who was having the same problem, but hadn't tried to fix being able to debug yet. Found 3 extra references. Removed them and the project worked again and I was able to debug the Telerik Open Access project.
I migrated a visual studio solution from using a "website" to a "ASP.net project" to be able to use Web.config transformation.
Now, after having migrated, Visual Studio completely ignores syntax erros when I clean/build/rebuild my solution.
Those syntax errors will be shown in my browser as soon as I open the web application - but seeing them during compile time would be helpful. They used to be shown in my error list - where I can now only see some uninteresting warnings.
I can still run my web application, and everything works well.
How can I configure my solution, so that compile errors will appear during compile time?
edit (in response to answers/comments):
As soon as I open the .cs file (by double clicking on it) the syntax errors are shown (inside the file and inside the error list view).
I'm using Microsoft Visual Studio Professional 2012 (Version 11.0.61030.00 Update 4) with .NET 4.5.50709 (german language version). I'm locally deploying to Visual Studio's IIS.
I'm not using NuGet, all my sources are in one single project
I'm actually only providing a REST-Backend using WCF. I only have c# sources. The syntax errors are in my c# classes.
The syntax errors are in my .cs files in my App_Code folder.
When I migrated my website to a project I manually edited my .csproj file (added missing "Content Include"s etc.). I hope that this did not break my solution...
I am not using the default "DEBUG" and "RELEASE" build configurations, but created my own server-specific configurations (named after the names of each server).
( #Guvante ) When I edit the build configurations, I see one line in the "project context table". The first and only line shows:
the name of my project
the configuration name in a dropdown
the plattform "Any CPU"
a checked checkmark "build"
the empty field "deploy"
My error list is filtered to "current project" and it won't show the syntax errors, no matter which item I select in my solution explorer.
Sometimes (can't tell when exactly) VS shows a warning, when starting debugging, telling my that my module was build with optimizations or without debugging information. Don't know, whether this warning is related to this issue.
Console output of successful build (though sources contain syntax error) is:
1>------ Erstellen gestartet: Projekt: MyProject, Konfiguration: localdev Any CPU ------
1> MyProject -> C:\path\MyProject\bin\MyProject.dll
========== Erstellen: 1 erfolgreich, 0 fehlerhaft, 0 aktuell, 0 übersprungen ==========
I saved, closed VS, rebooted machine, reopened VS, closed eyes, crossed fingers - #chief-two-pencils ;)
In the .csproj file you can change
<Content Include="C:\...\foo.cs" />
back to
<Compile Include="C:\...\foo.cs" />
More info on the MSDN documentation and this stackoverflow question.
You should change it to:
<Compile Include="....." />
The MSDN article on the build action property says:
Compile - The file is compiled into the build output. This setting is used for code files.
Content - The file is not compiled, but is included in the Content output group. For example, this setting is the default value for an .htm or other kind of Web file. Means that it is a deployable project item, it signals that the file needs to be copied to the target machine. Also note that Content will be included when using one-click deploy.
See more about build action here.
if you have Nuget packages run an update-package
try to unload the project and reload it into the solution
This worked for me
Ok, I know this has been asked a bunch of times...
I have tried to change the configuration and the outputPath, but still I have this issue.
I am setting up automated build and deployment for our product.
We have a single solution file and multiple projects within it.
Using VS2012 and the default build definition, I have set the "Items to build" to a single project - the one we wish to have build and deployment for.
Lets call this project "Forms".
When I run the build definition, it builds and says success. However, it gives a warning:
$/XXX/TRUNK/XXX/Forms.Web/Forms.Web.csproj - 0 error(s), 1 warning(s),
View Log File
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets
(610): The OutputPath property is not set for project
'Forms.Web.csproj'. Please check to make sure that you have specified
a valid combination of Configuration and Platform for this project.
Configuration='Release' Platform='Any CPU'. You may be seeing this
message because you are trying to build a project without a solution
file, and have specified a non-default Configuration or Platform that
doesn't exist for this project.
I have checked the .csproj file and there is a property group with the OutputPath specified.
I've also tried various combinations of configuration/platform, but the issue remains.
Does anyone have any idea what could cause this? It's driving me nuts. Without this fixed, no deployment is done... It seems to only build and doesn't even generate the .DLL files.
Try to delete the "Platform" environment variable.
(Visual Studio use this environment variable, which is possibly wrong.)
Then restart VS, and re-build the solution...
I have the following problem. There is a custom build process which is using the custom build activity. I've been opening this build some time ago, and everything was good. But, after some time, the custom build activity and build process has changed, got new arguments and some other changes. This activity has been updated on the server source control path, which is set in build controller settings. But, it seems that this activity doesn't want to be downloaded on my desktop, because when I open build definition, I'm getting error that my new custom type couldnot be resolved.
I've tried to build this activity by myself and place it to the folder, which contains devenv.exe, and this "solved" problem - my build process has been opened. But It is not normal.
What should I do to normally open my build definitions?
The contents of custom assembly folder defined for controller is downloaded to temp folder and loaded by studio once (im not sure if proper version increments for dlls would solve this - haven't tried) when opening the process tab on build definition. You either have dlls somewhere that overrides this (GAC, VS private assemblies) or your studio has been running for long time.
Remove the one you put along devenv, restart studio, check GAC and private assemblies, you can use Studio and attach debuger to other instance and review loaded modules this can help you pinpoint where the item is comming from.
To remove assembly run following from Visual Studio command line: gacutil /u "YourAssembly"
For studio assemblies i believe this is the folder: Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies
I'm having this problem last Friday when I'm trying to build my project to deploy it.
Whenever I build my project (Ctr+Shift+B or F6) I always encounter this kind of error.
When I'm trying to locate the file from my PC it looks like it reside in temporary folder and when building my project, this files automatically created.
Anyone encountered this kind of problem?
You have an unclosed #region statement (or perhaps some other syntax error) in the .aspx or .cshtml file that is generating that code.
check if everything matches...
then use project properties to set properties of output exe.
Then use build solution to build the project.
You Will fine output exe in debug>bin folder