Upgrading build server to Visual Studio 2013 has broken deployment process - c#

My build manager has been banging it's head on this for quite sometime.
We were using Visual Studio 2012 Professional with MSDeploy. Everything ran fine, we were able to do builds, Xml transforms, database deployments, web deployments, etc. to various environments.
We recently upgraded our build server to Visual Studio 2013 Professional and pretty much all hell has broken loose.
We get the following errors during our build process since upgrading:
Error Code: ERROR_EXCEPTION_WHILE_CREATING_OBJECT
More Information: Object of type 'manifest' and path 'C:\Builds\90\Code\Staging - Project\Binaries\Website Deployment\Project.Web.manifest' cannot be created. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_EXCEPTION_WHILE_CREATING_OBJECT.
Error: One or more entries in the manifest 'sitemanifest' are not valid.
Error Code: FileOrFolderNotFound
More Information: Could not find file 'C:\Builds\90\Code\Staging - Project\Binaries\Website Deployment\Project.Web'. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#FileOrFolderNotFound.
Error count: 1.
We have done everything possible to fix this issue. We have tried everything to get this building again. Even updating the project .prj file itself to point back to older .targets v10.0 from v12.0.
When we do "change" targets, it give us this new error:
C:\Builds\90\Code\Staging - Project\Sources\Project.Web\Project.Web.csproj (3290): The "TransformXml" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with in the project file, or in the *.tasks files located in the "C:\Windows\Microsoft.NET\Framework64\v4.0.30319" directory.
So it seems Visual Studio 2013 has modified something pretty significant in our environment to cause these errors during our Deployment process (the verbose log indicates that everything is building, just not deploying correctly).
Any help would be awesome!

I also recently upgraded to Visual Studio 2013 and found problems with deployment of a database project where the "Deploy" option didn't do anything and the publish didn't produce the differencing script I was expecting.
I installed the SQl Server Data Tools - Business Intelligence for VS 2013 and it resolved the problem for me. Perhaps it may help in your situation.

Related

Error during building application with Fody and Costura via VS 2019 : Binary is being used by another process

I have a C# Console application that was developed in different machines. In this application, we chose to use Fody, because it's the only thing we found that would embed all external resource dependencies (any extra class libraries) into a single executable for our application.
Environment Detsils:
Visual Studio Version: 16.9.2 (Professional 2019)
Type: Console application
Framework: .Net Framework 4.5
Fody Version: 4.2.1
Costura.Fody Version: 3.3.3
While this application worked without any issue in one machine, it starts giving trouble to another machine. We need to get this work on both machines as we need to cover lots of work. We have compared the two environments but couldn't figure out any difference.
the behavior of the issue is as below,
The first time when I clone and build a solution it goes in a
never-ending path and I have no other option other than end tasking
the visual studio.
And I observe that MSBUILD is occupied by something and I cannot end
task it
The second time when I start the solution and build it, I am getting
the following error.
Severity Code Description Project File Line Suppression State
Error CS2012 Cannot open '<<obj folder path>>\Debug\Binary.exe' for writing -- 'The
process cannot access the file '<<obj folder path>>\Debug\Binary.exe' because it is being
used by another process.' Binary.exe <<project path>>\CSC 1 Active
I had to restart the machine to remove the obj folder. And once it is removed Same above behavior repeats.
I found below a similar question below thread,
Error during building application with PropertyChanged.Fody
But it seems like this feature is obsolete in the latest Visual studio as per the below question.
Disabling Visual Studio hosting process on Visual Studio Community 2017
Further, I have tried to set the environment variable as explained in the below thread as I thought its somewhat relevant. However, it doesn't work as well.
https://github.com/Fody/Fody/issues/537
I must use these Nuget packages in my solution. Highly appreciate it if someone can share some thoughts to sort out this issue

Visual Studio ClickOnce Publish fails

I have created a C# 4.0 WinForms application using Visual Studio 2010 Premium SP1 on Windows 10.
Over the months I have modified and deployed this same App many times, using ClickOnce.
I have never had any difficulty until today.
I made one small modification to the code, which works successfully.
However, after building, and attempting to publish, 2-separate errors are thrown, as listed below.
#1) Cannot publish because a project failed to build.
#2) An error occurred while signing: The parameter is incorrect.
My application does contain a separate project, which is only a Splash Screen project.
If I go to Solution Explorer and attempt to build the 2nd project, it builds fine.
I have also tried to Build > Publish by using the menu in Solution Explorer, rather than from the Publish pane of VS.
Not only is it puzzling why a publish is failing suddenly now, but the error messages do not provide any clue as to where in the code a problem is arising, if indeed it's in the code.
Can anyone suggest how to correct this situation, as I am unable to publish my app any longer.
This error was puzzling, as I've used ClickOnce to deploy modified versions of my App many times. On a hunch, I decided to change the TimeStamp server from the following:
http://timestamp.globalsign.com/scripts/timstamp.dll
to this:
http://timestamp.globalsign.com/?signature=sha2
Since researching this error referenced the fact that Microsoft would no longer recognize SHA1, but needed the SHA2 cryptography, I tried using this latter server and after compiling, it allowed my app to do a successful publish.
If anyone else runs into this problem, the above solution may prove useful.

Why does my release build fail with error APPX0002: Task 'ValidateAppxManifest' failed?

I am trying to develop a UWP app for Windows desktop machines. Everything has been going well, but within the last few days I've lost the ability to build a release version (building a debug version still works fine).
I get the following error messages:
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\v16.0\AppxPackage\Microsoft.AppXPackage.Targets(2810,5): error APPX0002: Task 'ValidateAppxManifest' failed. Unspecified error
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\v16.0\AppxPackage\Microsoft.AppXPackage.Targets(2810,5): error APPX0002: [My App] violates pattern constraint of '\bms-resource:.{1,256}'.
I've tried a number of "fixes" that worked for people over the last few years. Some people report the problem fixed itself in the latest version of Visual Studio. Unfortunately, the versions they mention are older than the version I'm using, which is
Microsoft Visual Studio Community 2019
Version 16.6.3
Many fixes from the net are similar to the ones below, from the URL
https://social.msdn.microsoft.com/Forums/en-US/4cc2cbfb-fa0d-4f12-a0a1-9072d78e26d6/vs2019-error-task-validateappxmanifest-failed-unspecified-error-again-and-again?forum=msbuild
One fix was:
Clear nuget packages,
Clean solution
Close VS
Delete bin & obj folders of the main (startup) project
Open VS - solution
Restore solution nuget packages
Rebuild 'n go
Another fix was:
uninstalling vs & sdks,
removing every nuget folder,
clean the registry and restart the system,
the last step once more,
reinstall vs.
I have tried all of these (several times) except for "clean registry." I'm not sure what part of the registry we're talking about.
So, has anyone overcome this problem in a different way, or know what the registry idea is?
Oh, some other data is
Maybe my machine is too old (about 6 years old). I’m speculating that even if my machine seems to have the latest version of Windows an Visual Studio, maybe it doesn’t have exactly the latest code.
Things went bad while I was adding two new features. The first was to ask the user for a rating, via _storeContext.RequestRateAndReviewAppAsync(); The second was allowing the user to share some data via DataTransferManager.ShowShareUI();
I was thinking maybe these APIs might require some declarations in the manifest that I don't have, but I don't see from the documentation that they do.
Any ideas would be greatly appreciated. I’m out of ideas at the moment.
Dan
Here is the answer, for me. I’m not confident that this as the answer for all cases, but all is good now.
You may remember that I said I had the latest version of Windows, and I did. However, when I checked with Windows Update last night, it confirmed I was “up to date” but it offered me a “Feature update” to Windows 10, version 2004. I decided to go for it.
The update took hours to complete, and this morning it was still only 94% complete when Nico Zhu suggested to try using Visual Studio 2017. I figured I’d install VS 2017 after the update, but when it was finally complete, I decided to try VS 2019 one more time with my fresh new version of Windows. Amazingly, it worked the first time.
I should mention that my new procedure for making an app package now includes
close VS 2019
delete the project’s obj folder
delete the project’s bin folder (I used to just delete the obj folder, but after seeing others suggestions I’ve added this step)
launch VS 2019
create the App Package
I wanted to do another build/package so I fixed a couple of cosmetic bugs and tried again. On the second try I fell back into my old pattern and I did NOT delete the bin folder. Immediately VS 2019 popped up with an error message something like “Cannot complete build. Fix problem with your app manifest.” Rather than pouring over the manifest file as I’ve been doing for the last couple of days, I deleted both the obj and bin folders and tried again. The build/package process then worked perfectly.
So, I want to say that the app manifest file was not the culprit (in this case anyway) and I’m now a fan of deleting both the obj and bin folders, and having Win 10 version 2014, before attempting a release build with VS 2019.
Dan

TeamCity - Missing 'Microsoft.Web.Infrastructure'

I've been browsing around StackOverflow exploring possible solutions to my issue. For some reason TeamCity is unable to find 'Microsoft.Web.Infrastructure' but I have installed all the required .Net packages. However, I've ran all the tests locally and building the project within Visual Studio returns a successful build.
This is the error which I am experiencing:
App_Start\NinjectWebCommon.cs(9, 40): error CS0234: The type or namespace name 'DynamicModuleHelper' does not exist in the namespace 'Microsoft.Web.Infrastructure' (are you missing an assembly reference?)
Solutions I have tried
Within Visual Studio I was instructed by one StackOverflow thread to set the reference 'Microsoft.Web.Infrastructure' option 'Copy Local' to true. This returned the same result of the error above.
I've deleted all references of 'Microsoft.Web.Infrastructure' and performed a fresh install of this package, I'd had also reinstalled Ninject as well. I didn't specify a particular version. Again, building locally was successful remotely not so much - same error occurred.
Has anyone encountered such issue before? I had also done a fresh clone of the GIT Repository, restored all the NuGet Packages (Which TeamCity does as well) and it built completely fine.
After asking this question I'd continued my investigation. While my continuous integration server is running multiple windows virtual machines, and since TeamCity load balances the builds across these virtual machines some of their configurations were out of sync with the rest. Some of the team code purely in C++, so the version of Microsoft Visual Studio which was installed (Visual Studio Professional 2013) was the incorrect version for my C# project. After attempting to open the project with Visual Studio on one of the selected VM's, I found that Visual Studio didn't understand the csproj file extension.
I installed Visual Studio 2013 Ultimate - this is version I use on my workstation - and thankfully it complied. sometimes within my project, when I request a build it would use older files as TeamCity would cache the files locally. I found setting the to 'clean and re-download' within the VCS options also remedied this issue.

Error while trying to run the Program Visual Studio

Every time I create a new project in Visual Studio it gives me this error
Error while trying to run project:could not load file or assembly '[project_name_here]' one of its dependencies. The module was expected to contain an assembly manifest
I am not able to understand what is the problem with Visual Studio or .NET Framework, today I even tried to re-install the .NET Framework but still I don't get it to work.
It always keeps saying this message, even if I just Start the Build process as soon as Creating the project. This happens even if I create the project of (Empty) Console Application and run it, with just a Main method.
When I create the projects in C++, they run, but when I try to run the projects in C# they give me this error. I have tried almost all the methods provided on Stack Overflow, CodeProject, MSDN forums etc. But, nothing works.
What should I do or write to my application so that it would work.
I have, Visual Studio 2013 Ultimate update 2 running on Microsoft Windows 7 SP1 with no extensions or updates, just a pure Visual Studio from Microsoft.

Categories

Resources