VS2013 : Publish not using web.config transformations from command line - visual-studio-2013

Here is the problem I'm having...
First off - everything works fine if I manually publish from the VS2013 IDE.
However, the solution has 3 publishable projects, so you have to do each one separately, and inevitably someone makes a mistake, and one of the projects that wasn't touched for this update doesn't get published, and so stuff is missing, bad things happen, etc.
So to eliminate human error, I'm creating a script to publish.
After researching various things ( especially on this site ), I've tried the following:
msbuild C:\Development\Isis\Isis.sln /p:DeployOnBuild=true /p:PublishProfile=ProdXport /p:UseWPP_CopyWebApplication=True
I've also tried it as:
msbuild C:\Development\Isis\Isis.sln /p:DeployOnBuild=true;PublishProfile=ProdXport;UseWPP_CopyWebApplication=True
which also doesn't work...
And when I say doesn't work, it doesn't do the web.config transformation that the IDE publish does.
Now what I find odd as well is when I do it through the IDE, the Web.config file that is created has the same datetime stamp as all the other files ( as it was just created ). However, when I do it via the command line, the time portion of the stamp for the Web.config file is 12:38 PM (Nor is that the time on any of the web.config tranform files). No matter when I do this ( not a detailed example, but I ran the file creating at 4:20 PM, and it said 12:38 PM... ran it again at 4:42 PM, and it said 12:38 PM )
I've seen lots of examples for Visual Studio 2010 and 2012 - but nothing explicit to 2013, and while I wouldn't have thought there was that big of a difference, none of the stuff I've seen from those examples is working for me...
Hopefully someone else has come across this and figured out what I'm doing wrong/different!

Related

The "GetMinimumOSVersion" task was not given a value for the required parameter "SdkVersion"

I am trying to run msbuild command line, but, I am getting in the last step of it, the error below (it is in portuguese, but is the same error in the title.
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.Shared.targets(227,3): erro
r MSB4044: A tarefa "GetMinimumOSVersion" não recebeu um valor para o parâmetro obrigatório "SdkVersion". [E:\2-PROJETO
S\_ALGORIX\Projetos\ACCORD\SOLUTION\AppAlgorix\AppAlgorix.iOS\AppAlgorix.iOS.csproj]
My msbuild command is:
msbuild AppAlgorix.sln /p:Configuration=AppStore;Platform=iPhone /p:CFBundleVersion=1 /p:CFBundleShortVersionString=2.3.1 /p:ServerAddress={mac ip address} /p:ServerUser={mac user} /p:ServerPassword={mac pwd} /p:BuildIpa=true /p:IpaPackageDir="E:\8-IPAS\ACCORD" /t:Clean;Build /p:ArchiveOnBuild=false /p:IsAppDistribution=false /p:CodesignKey="{App ID identifier}" /p:CodesignProvision="{App Provisioning Profile}"
All the {} data are confidential, so I cropped them.
This command was working one day, but I don´t know when, but after some VS 2019 update, the command, stops working.
I have found some articles about it, but I can´t find a way to resolve this problem.
Onw of those articles is this:
https://www.gitmemory.com/issue/xamarin/xamarin-macios/10109/729614745
My VS 2019 is updated in version 16.8.4.
I have here, about 40 apps to build and get the ipa. I was running a dosbat to resolve it, and get those ipas, more quickly. Not having this msbuild command line working, will take me to a big problem, cause I almost every week have some updates in my apps, and build one by one, will not be a great idea.
And one more thing is.. I can build inside VS 2019, without any problem. The problem happens only via msbuild command line.
I used the post Visual Studio update (16.8.1) lead to CI build failures to resolve the error.
"This has reared it's head again in Visual Studio 2019 version 16.8.3.
Looks like they've moved the problem to: \MSBuild\Xamarin\iOS\Xamarin.Messaging.targets I was able to get
my builds running again by removing the _SayGoodbye dependency on line
52 for the _DisconnectAfterClean target."
Although I have resolved the error, now I cant generate the ios.ipa package. Now, I get only the file projectName.iOS.exe, instead of projectName.iOS.ipa.
I dont know if this workaround is the final solution for this bug, yet.
We resolved this by running the build twice in-a-row. (continue on error - ignore the failed first build)
The first time always fails with the error in the question title, but it must somehow sets things up so that the second build has what it needs to succeed. The IPA is generated, etc.
IMPORTANT: DO NOT CLEAN BETWEEN THE TWO BUILDS
I know this solution is a hack workaround, but I prefer it to manually making changes to the .targets files as I have seen suggested elsewhere (those suggestions did not work in our case anyway). Making changes like that without knowing the internals of the build process intimately could result in unintended side-effects.
NOTE: As this solution involves an expected failed partial first build, it does add to the build time, but it was only about a minute or two longer per build, and at least it works reliably.
Hope this is helpful to someone! 🤗

Visual C++ - Successful build but exe file is not created

I am using Visual Studio Community 2017 (C++) with default configuration on Windows 10 (64 bit).
I have a single CPP file and I am trying to compile it.
The problem is that the "build" works fine, it says success, but the expected exe file is just not created.
I spent a few hours now trying all the available options - release/debug, 64bit/32bit, empty project/console app and many settings changes as was advised on various forums - no luck.
Does anybody know what could be the problem? I just can't find a solution for this.
I found my executable in my projects folder called "Release" (for x32) and "x64/Release".
Although I didn't see them either the first time going through the folders looking for it.
Alternatively I found this site with standalone build tools:
http://landinghub.visualstudio.com/visual-cpp-build-tools
ps: for the pros, I am still a big noob, so I can't tell if that site and tools is of going to be of any use, or even right, to the person asking the question.
So atleast I have added it and is for him/her to decide if so. ;p
regards,
E Karaagacli

Visual Studio Solution/Project Path issues when remapping workspaces

This issue is quite hard to explain, so I may need to add more details based on questions you may have.
I'm using TFS and Visual Studio 2013 for dev.
I have the following branches:
Development Branches
- $/ProjectName/Development/Development
- $/ProjectName/Development/201406 June
- $/ProjectName/Development/201407 July
- $/ProjectName/Development/201408 August
I have the following workspace mapping:
$/ -> C:\Projects
When a new month starts, I create a branch in dev, e.g. 201408 August, and set up the following mapping (in addition to the above top level mapping)
$/ProjectName/Development/201408 August -> C:\Projects\ProjectName\Development\Development
This helps me easily change my work spaces and pick which branch I want to use without having to change a LOT of references and things in IIS. That all always point to C:\Projects\ProjectName\Development\Development no matter what branch I work on.
Now once I'm done with my development for the month, I make sure all work is checked in (I always check in AT LEAST once a day). I then remove the work space mapping, so that everything is mapped only by the top level mapping again. I then merge Development/2014 August to Development/Development.
Once I'm happy with any merging I need to do, I check in Development/Development and the job is done.
All this is exactly how I'd like it to work, but there is a snag.
For some reason, VS remembers that the projects resided in Development/201408 August, so when I open the Development/Development solution file, the project points to Development/201408 August.
I then remove the project(s), and add it from the correct location (Development/Development). If you then look at the properties, it's changed it again to Development/201408 August again, DOH!
I found someone with a similar issue, and they said to:
Remove the offending project(s)
Save the solution
Close Visual Studio
Delete the *.suo file next to your solution
Re-open VS
Re-Add the project(s)
Save the solution
And the it would be fixed. This is true, it sorts out the problem, but I'm hoping somebody can tell me why this happens, because I have over 35 projects in my solution, and I sure as hell can't do this every month, it takes forever and is extremely annoying.
I do make sure to get latest versions again after the work space mapping changes. I also tried Get specific with overwriting all files. Nothing seems to work...
Any ideas?
EDIT
Forgot to mention, openening the sln file as XML, the path to the project is actually CORRECT, but when viewing the properties on the project from within VS, it's incorrect.

Corrupt VB.Net VS2010 project recovery

In the last year I've worked on two relatively large .NET projects and both of them have ended up with project/code generation strangeness that I just haven't figured out how to fix..
The first project generates some bad code for forms that causes the VB.Net build to fail. I actually had to make a search/replace macro that fixes the 5 problems by adding a Global. to the beginning of a few references.
I chalked that up to a random act of unkindness against me and went on my way since the macro takes about 2 seconds to run...
So now 6 months later and new project is cranking along and I get a similar-ish problem. I have a bunch of form controls that store state in a settings file using the built in capabilities of .Net. I had about 20 controls that were configured automatically this way. Works great until today when for reasons I don't understand in the designer.vb file gets corrupted. At least one other person on the planet has had this problem here:
http://social.msdn.microsoft.com/Forums/en-US/winformsdesigner/thread/9bd20b56-7264-4a1f-a379-ad66b372ddd3
but the proposed solution didn't change the behavior.
So now I've had two projects (larger ones) that have project file issues that I can't resolve (I've had several smaller projects that are just fine).
What tools are available to fix projects, migrate projects, lint projects ... anything to recover projects to a reasonable state? Any successful recovery procedures beyond a roll-back/merge?
i had a corrupted reference issue linked to my use of mercurial and VS getting lost in file save time... if this may help...
If you open it in notepad and its corrupted - then its probably corrupted and the only way to restore it would be to go to a backup.
--> go to backup
-->click your project name
-->and then find your fire thats are corrupt

visual studio 2010 last successful build

I made some changes to my website, then had to reformat my server, and over two weeks I tried to undo what I did (it was a stupid forum thingy). Obviously I missed something, becuase now I have the dreaded Build Failed With No Error problem.
This is my home server, so no I am not running source control.
After staring at it for a few days, I decided to try somehting. Today I allowed VS to run the last successful build, and it still works.
QUESTION: How can I go back to the last successful build? I don't care about any changes made since it worked. That's really all I need.
THANKS
Have you checked to see if you have Previous Versions available?
It sounds like you won't likely be able to recover the source files / project config, though you could certainly attempt to recover the "source" by using tools like ILSpy or .NET Reflector. You can use them to examine the output assemblies, and reconstruct your code if necessary.
As a lesson learned, both Mercurial and Git work wonderfully for versioning home projects - I'd give a slight nod to Mercurial in your case as it works just a tad bit easier on the Windows platform.

Resources