I am using Jenkins as a Windows Service with MSBuild to try and build an ASP project, but I get the following error after Jenkins have fetched all the source files from TFS:
MSBUILD : error MSB1003: Specify a project or solution file. The
current working directory does not contain a project or solution
file.
I have 3 projects in my solution. One that is ASP, one that is C# only and one that is a Database project. I have already set in my Solution that the ASP project should be the startup one but I guess I need to include the information somewhere else?
I don't quite understand where it wants me to set the project or solution file to make this work ._.
I have other projects from Colleagues at work as well whose projects are compiled and analyzed just fine. One of them is a heavy ASP.NET and Sharepoint project so not sure what gives.
Related
So here is my ASP.NET Core MVC project, which is working fine locally but not when I am trying to publish my target project TSEventApp.Web to a target folder:
The project is getting published successfully but it just publishes weird folders with just .dll files instead of folders like views, bin, etc. Can anyone just please guide me through what exactly am I doing wrong? Thank you in advance.
According to your publish settings, I found you used the Framework-dependent, it you use this format, it will not generate the related runtime dll and it will complie all the view or else inside the one dll.
If you choose self-contained, it will genreate the runtime related dll inside the folder .
So I made a .net core web api project and pushed it to a git repo. After pulling down the repo and attempting to run the IIS express server locally, I'm getting the error
Unable to run your project. The "RunCommand" property is not defined.
If I create a new web api project on this computer, it works fine. So it's only the project that I've pulled from git that won't work. Is there some command I need to run to make it...I don't know, update for this computer?
I've done almost nothing to this project. I added one new controller and that's it. Everything else is the default project settings.
The exact project is:
Templates -> .NET Core -> ASP.Net Core Web Application
.NET Framework 4.5.2
Edit: I've compared the new project I created with the one I cloned and everything looks the same. So I'm baffled.
Make sure that the OutputType of the project is set to Exe and that the project file starts with <Project Sdk="Microsoft.NET.Sdk.Web">.
Both are important to give VS:
The command to run when executing the project
Turn on the capabilities to generate and use a Properties/launchSettings.json file.
If your app doesn't launch, i suggest deleting a Web.config file (if exists) and Properties/launchSettings.json, then re-open the solution.
I needed to delete the
bin, obj, and .vs directories.
I just need to ignore those directories with gitignore and I won't have this issue anymore.
I have a big solution with 30 projects of which 2 are web projects (MVC and WebAPI) with a bunch of background class library projects.
I have visual studio set up to host the web projects in IIS.
If I do a clean build, followed by a full build of the entire solution, then accessing both projects via a browser works fine. (they are in diff folders and hosted on diff 'domains' in iis)
If I make NO code changes, simply rebuild one of the 2 web projects, the OTHER one stops working.
To be clear, rebuilding the WebAPI project causes the MVC project to have errors. And vice versa.
The error I get is saying that System.Web.Http.Formatter is not found. The detail says that the located assembly version is different from the reference version. Checking the bin folder shows that that is not the case.
Make sure that all the solution's resources are up to date. If you use Nuget, update all packages in all projects (back up first!). It sounds like you have a version mismatch, where functionality is missing in DLLs copied to the output directory for the solution. It may involve changing some entries in the Web.config of each project, but without access to the code, it's hard to know for sure.
Report back once you've updated every library, and made sure the versions match across all projects in the solution.
In addition to Apache's and Steve's suggestions, I'd also recommend deleting the files in your Temporary ASP.NET Files directory. If you're curious here's a good write-up of what the contents of that folder are for.
I have a solution, Asp.Net web application and inside the solution I have two projects. One contains VB code that handles the UI. forms etc. and the other one C# that basically uses Linq-to-Entity to handle my data. When I run the project from my local computer it works good. Now, to publish, I notice only when the UI Project is selected, the publish option is enabled. Why is that? If I publish this, would the other project not be published? Another question, I have XML files created in app_data folder, when I publish it, will I be able to access it?
Publishing only applies to web projects. If you've included a reference to the other project in your web project, it will be compiled and the DLL will be published along with your web project. Your XML files should be published along with your web project, if they aren't check their properties and make sure they are set to be published with the project (build action set to Content and Copy Always or Copy if newer is selected).
You have two projects inside your solution. One is web project and the next will be a Class Library project. All the codes related to Entity framework, LINQ queries, Database transactions, etc should be in the class library project. while building the class library it will automatically generate the DLL files. then you need only add a reference to the web project file. Then you will get all the classes, methods etc from the class library. there is no need for publishing the class library project. Because you have add the dll reference to your webproject. all the code file inside your App_Code folder shuold be converted to dll while publishing the web project. so dont worry about the files inside the App_code folder data.
Thank you
You dont need to publish reference projects individually or even the whole solution. It works simply by referencing the dll of your other project.
Both projects need to be compiled if not already
If your UI project has reference to dll from data layer project it will be published with your UI project.
You can publish it locally in another folder and test using iis express or your local iis and then publish it online with database. Update connection string and it should work if setup correct.
I have a Visual Studio solution (C#) which represents the core of our application. We build this and it comprises about 10 or so DLLs with corresponding PDBs.
I have several other VS solutions each of which is used for a customer of ours. These VS solutions use the core DLLs and add their own bits as required. The "core" has the main .exe so we do the following in customer specific solution
Post build step in the a project to copy the EXE/DLLs/PDBs into the $(TargetDir)
Set project debug settings to "Start External Program" pointing to the .exe
This all works, tho seems a bit clumsy.
My questions are:
When running via the customer specific solution, how can I
Have the code for the core project open automatically when I step into it
Be able to open a core file and set a breakpoint
I'm used to Java where you reference the compiled and source jars/directories from the Java IDE and that's pretty much it. How can do the same in visual studio (DLLs and PDBs)?
(I would prefer to avoid the GAC if possible because we sometimes have several local builds of the core around at the same time working on different projects)
Mike, if you open an "higher in stack" solution which references a core solution, you can open the source file of the core solution and put a breakpoint in it, then when you debug the current solution Visual Studio is smart enough to step into and trigger your breakpoint if the .pdb files are available in the bin folder.
TO automatically have the debugging control traverse into the core source files, make sure to refer the core dlls from locally build core solution and make sure that have access to it.
Another way is after having the core dlls refered, just open the CS file in which you want to put a break point and debug.