Unable to build project after new windows install - c#

I recently bought a new computer. After getting everything setup, I installed visual studio community 2019 and gitkraken and cloned down my project(which was building and running fine prior to changing computers) and I'm running into an issue. It's a game dev project using MonoGame.
These are the errors that I'm receiving currently. I've tried multiple versions of MonoGame including 3.0, 3.5, and 3.7. I've attempted to reinstall redistributables, I've cloned into multiple directories, I've attempted building a different project(a fork of the same project that I've worked on more recently on my previous pc). I have a friend that works on the project with me, he was able to clone into a new directory and build immediately. I've attempted building the content package in the MGCB manually and am also running into an issue where it's not finding a specific font file(that i've verified is installed on my computer, and also tried dropping in the correct directory for building, but have had no luck there. However, I feel like this is a separate issue, but it may provide some insight to someone who is more experienced than I.)
Ideally, this project should clone down and build just fine on a fresh install. It always has before, but there's something going on here that I'm not sure about. I've tried several different things and have hit a wall. There isn't much online about this specific issue that I've seen, so if anyone has any ideas I'm all ears. Thanks.

I figured out the issue. It was something simple as usual, a product of my own stupidity. When I first downloaded the font, I extracted and right click > install. So the font was installed on the PC. I spent a couple days on this issue, and at some point when trying to reinstall the font there was a new option that hadn't been there before called 'Install for all users' with the shield icon next to it. Previously, I'd only had the option to 'Install' without the shield icon. Not sure exactly what the difference is between these two options showing up, but once I clicked 'Install for all users', the issue was solved. So I guess initially the font was only installed for my specific user account. I'm not sure why this is an issue or why the option to install for everyone wasn't available previously, but this is what solved the problem.

Change the Build Action on the "Content-> Content.mgcb" file to "none" or "ignore"(I can't remember which). This will allow the game to build successfully.
Here is a temporary work around to allow you to continue development:
If the XNB files are not properly building in the Pipeline tool, you can copy them(from an older build or compile them on another machine) into the output directory, Content directory under the directory containing the .exe file, manually.

Related

Visual Studio 15.8.5 suddenly not displaying errors in real time

Developing in C# and something changed - not sure what. Now errors do not show in real time in the error window. I have "Build + Intellisense" selected. If I type garbage in the code it does not recognize it until I build the app manually. When I switched to an old VB.net app it worked fine.
I tried updating in an effort to resolve the issue but the update fails.
Well...I tried a whole bunch of solutions. None of them worked. I uninstalled and reinstalled VS. That did not work. I started running into an error whenre a file could not install because of a account issue.
it turns out after a bunch of tech support from Microsoft Installation help that I had to reinstall Windows :(. The bottom line is that my accounts became messed up. I reset the password to the admin account on my computer. After that I couldn't log in to my account.
Well...sometimes it's just good to start over.
By the way, I had everything backed up using Unitrends on a virtual machine. I love that stuff. Even let me restore on a file level only to my new computer.
All is well now.

WPF application doesn't run on another computer

I created a new WPF project. I copied the built .exe file onto another computer and tried to run the application. But nothing happened. It was just loading. Nothing more.
All my WPF projects do this thing.
What am I doing wrong? Has anyone any idea?
Edit: For somebody in the future: the question might not be clear. What I meant was that I created a simple WPF application with nothing in it and tried to run the application on another computer. I wasn't able to make it run. Just nothing appeared. I figured out that the Avast Free Antivirus was causing this problem. When the antivirus is turned off, it runs as expected. Even though it is no solution, at least we know, what was causing the problem.
You are probably missing the dot net libraries on the target machine.
For quick fix, download the dot net framework distributable for the .net version you compiled against and install it on the target machine. Here is 4.5.1 for example.
For actual distribution, look at creating an installer that will ensure all dependencies are installed with the application. InstallShield has a limited edition which may be included with your edition of visual studio
Try publishing your application using click once. You can do this by right clicking on your project > Publish > Specify the location to publish your application > Finish. Copy the files inside the Published folder to another computer and try installing by click the setup.
Note: The instructions I said above only works if you only have basic functions on your app. If your application uses SQL Server, you need to install it first on the computer that you will be installing your application in.
For your reference. How to: Publish a ClickOnce Application using the Publish Wizard

How to deploy a compiled application without Visual Studio?

When I open a sample Blinky application in Visual Studio, compile and run it, it gets automatically deployed to the target configured WindowsIoT device. After that, on Windows 10 machine where I compile it, the application binaries are located in the bin sub-folder of the project folder as one would expect.
I would like to automate the deployment, so that I could run deployment code
without Visual Studio, specify target device and the binaries location and it would deploy it. I cannot find any API that allows
to deploy apps to Windows IoT, how do I do that?
This shiny Windows IoT stuff is a new area, and there is not a lot of info available apart from the samples and the getting started page. Any pointers are appreciated.
Update: As noted in comments, once one start thinking of mass production, they will probably need to conciser ICD. This, is not, however the problem I'm trying to solve currently. I would like to figure out how I can provide Over-the-Air updates to my UWP application running on Raspberry Pi and Windows IoT. I also would you like to know how I can automate build / deployment in general, but that may be automatically solved if I have a proper OTA solution.
There is a set of instructions on how to do it, which can be found in the same github repo you are linking in your question, but in a different folder. Note, that you need an appx for these instructions to work, and it's not created by the solution build by default.
This page provide (non IoT specific) instructions on using VS to build the appx. And this blog post talks about the command line tool that can be used for making appx.
Note, that the last two links are also talking about publishing an application to app store, so you'll need to make some mental adjustments around that.

VS 2013 hangs when publishing website to Azure cloud service

I have a website in C# Visual Studio 2013, which was developed by another developer and is hosted on Azure cloud service. Whenever I make any changes and try to publish, Visual Studio hangs and I can't publish it. It is not showing any error message. Besides that I can successfully deploy it by building it, but as it's taking too much time and also costs money to client (as VS Team Services only provides monthly 60 minutes of free build, after that clients get charged for extra minutes). I am using following steps for publishing and it's works fine but after publishing starts Visual Studio hangs and is unresponsive.
The steps to publish the website are as follows:
1) Open the solution in visual studio.
2) Right click on the azure project in the solution explorer, and select publish.
3) The first step in the wizard is to sign in, make sure to select your credentials.
4) The next step is settings, make sure environment is set to production and build configuration is set to release, then click next.
5) The final step is a summary, simply click the publish button.
I am very new to Azure so let me know if I need to make any setting during set up my project.
I hit the same problem after installing the 2.8 SDK and tools. After checking out these answers I still had the problem, but found a solution.
Right click the Azure project in the VS2013 solution explorer, open project properties. Go to the application tab, and there's an "Upgrade" button to upgrade the project to the latest SDK. That did the trick for me.
It sounds like you are doing the right steps to deploy using the wizard. However I don't have enough information to know what would cause this to hang. There are some documentation details about the wizard that might help? https://msdn.microsoft.com/en-us/library/azure/hh535756.aspx
There are other ways to deploy to Azure, which may solve the issue. You can for example download a publish settings profile, and use this to deploy instead of the wizard. Details here: http://blogs.msdn.com/b/avkashchauhan/archive/2012/05/10/downloading-windows-azure-publish-settings-subscription-configuration-file.aspx
Or you can deploy continuously from Git - https://azure.microsoft.com/en-us/documentation/articles/web-sites-publish-source-control/#Step75
Both solutions will require some tinkering in the Azure portal or getting in with PowerShell but there's a lot of ways to deploy.
Doing these two things fixed it for me, not sure which:
Clean build
Server Explorer > (Had to re-enter Azure credentials)
VS2013 update 5.
A related post found here..
https://social.technet.microsoft.com/Forums/virtualization/en-US/4e51b1f0-91c3-4ce9-9a15-a8d10f912c5b/publish-cloud-service-causes-visual-studio-2013-to-hang-crash?forum=windowsazuredevelopment
One user was able to get past the publish freezing by doing the following..
So I did a line-by-line comparison between all of the files in that
new project and everything in my existing one and found only two
possible things wrong:
1) The version stamps (dates, really) in my
files were not upgraded to reflect the latest version of the Azure
tools. I manually changed those in my existing project to match the
garbage test project's date stamps.
2) My XML files had some empty
sections that did not exist in the new project's files, so I simply
removed those empty sections.
3) Beyond that, I also deleted my *.user
file.
Specifically, I was able to remove schemaVersion="2014-06.2.4" from my ServiceConfiguration and ServiceDefinition files and it fixed the issue.
My guess is that your installed sdk version is different than the specified schemaversion.
I tried all above methods none worked for me. So this is for people who already tried above and still couldn't make it work.
=> Publish in Release mode :-)
Yes I was trying to publish in Debug mode which was causing it to hang till death ;-)

Publish Web Site (Precompilation) stalls/hangs in Visual Studio

I'm working on an ASP.NET Web Forms application (.NET 4.0 VS 2010). Lately we've been experiencing problems which have halted our release process.
Specifically, we have found ourselves unable to publish our website (to precompile it). Across all of our developer environments (3 developers), the build process appears to be stalling/hanging - without any report of error. Sometimes, it appears to succeed but only a couple of the compiled DLL's and .compiled files appear (less than 10 out of ~350 files).
I've loaded in various revisions of our projects from our source repository, both latest and very old versions which previously worked. The fact that it's happening across developer environments suggested that the problem was due to some change we committed, but the fact that the problem is occurring across latest and old revisions of the application perhaps suggest otherwise.
Internet searches for this issue reveal nothing significant. Things I've tried include the following:
Building and rebuilding
Clean solution
Deleting the .suo files for the solution
Deleting the contents of the ASP.NET Temporary Files solution and deleting the target location folder prior to publishing
Tried selecting the 'Allow this precompiled site to be updateable' option (produces an object reference error without a file or line number)
Restarting Visual Studio and PC
On examination of CPU usage during the build, the CPU usage for the devenv.exe process is in the sub 0.10% area for most of it (a few spikes at the beginning just).
I appreciate any assistance anyone can provide with this
UPDATE: We have found that eventually, the publish succeeds, but sometimes we get a long series of failures before it succeeds. There's no consistency at all... it seems random.
I had this same issue with Visual Studio 2015 on Server 2016. The issue was partially resolved by running VS as administrator. However the apparent root cause was virus scan - in this case ESET- installed not as a File Security but as workstation. This I discovered when every entry of the license codes for ESET appeared to work - then ESET reported it still required verification. Uninstalled the badly chosen ESET and reinstalled the correct license product and, presto, with or without pre-completion, the publish works! Thanks to the previous virus scan tip!
The issue seems to have been caused by the McAfee virus-scanning software that we have installed.
Only with admin privileges, we were able to temporarily disable the real-time scanning, and as soon as we done that the ASP.NET Publish would complete successfully almost instantly.
For anyone else in this situation, it was McAfee's anti-virus software that was causing the problem. I checked the logs for the anti-virus software and there was no evidence that the software was blocking anything related to the Visual Studio processes or the folders that are manipulated during the build and publish processes (e.g. The ASP.NET temporary files folder).
Specifically, the csc.exe (C# compiler) and devenv.exe (Visual Studio) processes were having problems with McAfee. These processes were added as 'Low-Risk Processes' to the 'On-Access Scanner' to resolve the problem.
McAffee removes any changes to it's settings every 15 minutes, meaning that the action of adding these processes to the McAfee exception list (low-risk processes) has to be repeated every 15 minutes when you are building your code. This could happen a lot during a working day.
I see you do not have Allow this precompiled site to be updatable checked, so your Publish may be attempting to update what it thinks has changed.
Try deleting all the files (copy existing files to a new location or rename the folder, if you want), and try your Publish again.

Categories