MSBuild failing to build referenced projects when upgrading to VS2010 - asp.net

I have recently upgraded my .Net 3.5 solution containing some C# code projects and a ASP.net web site project to VS2010 (from VS2008). It is building and running fine inside VS, but I get some problems when trying to build it on my server with MSBuild 4.0 via TeamCity. It seems like the projects that are referenced from the web site are not built. This was all working fine before I upgraded to VS2010, MSbuild 4.0 and Windows SDK 7.1.
Inside the msbuild script that I use to build from teamcity I have defined project references for the web site like this:
<ProjectReference Include="..\src\trunk\DataAccess\DataAccess.csproj">
<Project>{C43242F4-7286-4BEC-9A27-001D6FC14860}</Project>
<Name>DataAccess</Name>
</ProjectReference>
When I try to run the build script I get an error message saying that it could not find the dll file when trying to copy it from the bin folder of the referenced project into the bin folder of the web site. This is happening because the referenced projects are in fact never built at all (No bin folder exists in the project dir).
Does anyone have a clue what may cause this? I am not very experienced with MSbuild, so I may have overlooked some important stuff. Is it not so that MSbuild will automatically try to build the referenced projects if no project output is existing?
Will be thankful for any help!

I would need some more info to guide you on this, but off the top of my head try adding
/toolsversion:3.5
to your msbuild call.

I found another post on this website describing your exact same problem. I also ran into this same problem too.
This blog on the MSDN Website describes the problem and the work-around. Basically it's a limitation of solution files which are not in an MSBuild format, but just a fancy text file. And the real thing is, that the dependencies need to be specified in the project files them selves not the solution file. ahhh... just read the link it explains it a hundred times better than my answer here.

Related

How do i use DocFX to generate c# documentation from source code without VS2017?

I am trying to follow the tutorial from the command line. I have generated the project and deployed the blank website then added a vs2012 project to the source folder maintaining the original heirarchy. I have edited the docfx.json file to include "src/.csproj" "src/.cs*" which i assume are searched recursively. The project was previously commented for use with SandCastle so there should be plenty to extract or generate metadata from. I currently have vs2012 msdn installed. My issue is that the metadata never builds and even when I'm using the sample seed project all the md files show up on the webhost but not the documentation from the source files.
There is no requirement to have the complete VS2017 installed, instead you can just install the build tools of VS2017. Download
Just start a developer prompt for VS2017 environment and do docfx from there, it should then be able to extract metadata. I had problems with VB.NET projects with docfx and older Visual Studio tooling for some reason.

Configuring existing ASP.NET project for DNVM, DNX environment on a Mac

I have an ASP.NET Web API project created on Windows using Visual Studio. How can I set this up for use with DNX/DNVM (on a Mac)?
Switching to Git solved the source control compatibility with TFS. But I wasn't able to find references to getting a project working across both these development environments.
I'm assuming as a first step the project will have to be migrated to ASP.NET 5/vNext but wondering other problems lurk around the corner with different project members using different environments.
I get an error when I run - git:(master):dnx . kestrel
As you mentioned yes you will have to migrate any namespace changes. I have a project that is developed across both. Also changing csproj files to xproj. Support is coming for some kind of interop between the different project types but its not here yet.
For build, publish, deploy from git without relying on VS publish capabilities or MSBuild you can follow my blog post here.
Basically you use DNU to publish and then kudu to deploy.

TFS build does not have the same output as file system web publish

I normally do a file system publish on my asp web applications before deploying in them on the web root of my web server myself and visual studio packages my aspx pages seperately along with my apis and libraries into DLLs nicely.
I was wondering how to achieve the same effects with Team Build. As of now, I'm able to run build definitions with the default template and the output I'd gotten are just the binaries DLLs without any aspx pages being generated at all
http://postimg.org/image/occoo03zh/
However I'm getting just the DLLs without web pages in Team Build
http://postimg.org/image/mat7co6vp/
I had tried passing various MSBuild Arguments in hopes that it would have changed the output, but no luck thus far. Anyone knows the exact reasons and ways that I can resolve this? Is this output from TFS build normal?
It hasn't been resolved yet, any insights is very much appreciated.
Asp pages are not compiled, your compiled dll's will be outputted to the binaries directory, but your asp pages will be left in the sources directory. you will need to add a post build activity to copy your asp structure into the drop folder.
Can you confirm this by looking in the build workspace (on build server) and seeing if the structure is correct in the sources directory and that the dll's were created in the bin folder. if so you can then copy that whole structure.
You need to pass MSbuild some arguments to get it to generate the published website as you would see it with a file system publish. See here for something similar done with Visual Studio Online.
/p:OutDir=$(build.stagingDirectory) /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true

ASP.net and devexpress scheduler, works local, does not work live

Hi guys I got some code here thats buggin me.
ive managed to create a page and get it working on local host, but when i publish this to go live and nav to the web page it comes up with this error.
Could not load file or assembly 'DevExpress.Web.v11.1,
Version=11.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a' or
one of its dependencies. The system cannot find the file specified.
(E:\web\shafteccom0\htdocs\Calendar\web.config line 44).
Ive tried adding all the references, and i mean all of the dev express ones, including ones i dont even need.
my project is a web project using visual studio 10, asp.net,C# & .Net version 3.5
ive also tried changing the .net version to 2.0, 3.0 and 4.0 but no luck.
If you need my code let me know and ill edit this.
Many thanks
That error means that the library that your application is looking for does not exist on the server you are deploying it to (or it cannot load it with the variables provided). Does the live server have the VS2010 references installed to it?
Just making sure: Are you sure your references set to "CopyLocal"?
I think DevEx installs it's assemblies in the GAC, so your local copy may be working but not when you deploy. Have you tried looking in the bin on the publish location to see if they are actually there?

system.web.extentions.dll not getting published!

I use the publish option of asp.net 2.0 to create a deployable copy of my web application. Lately I've noticed that the System.Web.Extensions.Design.dll and the System.Web.Extensions.dll does not get copied when using the publish option.
Has anyone any idea why this could have happened?
Couldn't google anything definite about this too...
Thanks.
They're part of the framework, so they are not published.
As others have pointed out they are part of the .NET framework and installed into the GAC which is why they aren't copied in a publish. Visual Studio expects them to be installed in the same location on the deployment target.
That said you can change this, right-click on the reference go to Properties and change the Copy Local to true. This will put a copy of the assembly in the local bin of the website and copy it when you publish.

Resources