MAUI .Net 7 VS22 cannot see Window Machine screen after build/deploy - visual-studio-2022

.net 6 works perfectly for me , but when I create a new project and set .net 7 as a target, I cannot see anything on the screen when I run the project, here is the log :
Creating a new clean layout...
Copying files: Total 105 mb to layout...
Checking whether required frameworks are installed...
Registering the application to run from layout...
Deployment complete (0:00:04.411). Full package name: "8cc8c370-e3bb-40df-a37b-e1408483996c_1.0.0.1_x64__9zz4h110yvjzm"
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Elapsed 00:24.190 ==========
========== Deploy: 1 succeeded, 0 failed, 0 skipped ==========
========== Elapsed 00:24.192 ==========

First, I think you could restart and update Visual Studio and create a new project to see if it works.
If it doesn't works, I also find a similar issue on Github : MAUI apps crash on launch on Windows after Visual Studio update . You could follow this issue.
The following workaround was mentioned in this issue,
1.Dayjay comments suggests to run app just build as Admin;
2.Redth comments also concludes four ways to solve this issue;
Hope it works for you.

Related

console application is not building in vs 2019

I am constantly this error in debug mode.
Severity Code Description Project File Line Suppression State Error MSB3027 Could not copy "C:\Users\N3617\Source\Repos\Core\CoreData\ConsoleApp1\obj\Debug\netcoreapp3.1\ConsoleApp1.exe" to "bin\Debug\netcoreapp3.1\ConsoleApp1.exe". Exceeded retry count of 10. Failed. The file is locked by: "ConsoleApp1 (1080)" ConsoleApp1 C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets 4643
I had to restart system to get rid off this error. Can anyone tell why is this happening?
It seems an old problem that your project is locked by some other process due to some reasons. You can see this similar issue.
It is complex to explain that but you can try the following steps if you faced them next time:
Suggestion
1) open Task Manager--> shut down ConsoleApp1.exe process, any dotnet process, NET Core Host process or similar process every time when you faced this issue and then build your project again.
2) close VS, delete .vs hidden folder under solution folder, bin and obj folder and then restart VS
3) enter Tools-->Options-->Projects and Solutions-->Build and Run-->set maximum numbers of parallel project builds to 1.
4) uncheck option Use Managed Compatibility Mode under Tools-->Options-->Debugging-->General

TFS build server creates no test results

Is there any way to activate a test related log at our TFS build server?
If a tests fails, I can't find any information about it (besides the name of the test).
I checked:
The drop folder. There is the normal log, but this log ends after the compilation, so before the tests are checked
The compilation folder at the build server (C:\Builds\8...). There is a folder "Test Results" next to the "bin" and the "src" folder, but the "Test Results" folder is always empty.
The build definition. Couldn't find any option to activate a log regarding tests.
When i check the build in the web view, all I see is:
x/y test(s) passed, z failed, 0 inconclusive
No Code Coverage Results
Other Errors and Warnings
z+1 error(s), 0 warning(s)
Failed z1
Failed z2
...
Failed zn
Test Run Failed.
How can I find further information, why the tests are failing?
We are using:
TFS 2012 + a TFS 2012 build server
Rolling builds
Visual Studio 2013 + Resharper at our local machines
NUnit + MOQ
Rolling builds (no more than 30 minutes) build definition
We got rid of the problem after we upgraded to TFS 2015.
Now I just have to check the web interface, if a build is broken because of a unit test I click at the specific build to open the detail view of it. At the right side there is an area named Test result, where I can click at a link to get to the Test Run page. Under Attachments (1) I got a file of the type Visual Studio Test Results File, which shows me exactly what the problem was.

Visual Studio One-Click Deployment "succeeds", but no files publish

Here is the output after the build/web.config transformation:
Copying all files to temporary location below for package/publish:
obj\Release\Package\PackageTmp.
Publishing folder /...
Site was published successfully path_goes_here
========== Build: 0 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
========== Publish: 1 succeeded, 0 failed, 0 skipped ==========
yet when it loads the root folder, nothing is there. Going to the site gives a Server Error of
401 - unauthorized: access is denied due to invalid credentials
understandable considering nothing is in that directory, I believe. If possibly misleading.
To work around this issue, I copied and pasted the release of the deployment server to the production server. I didn't have access issues doing this so I don't believe it was preventing me from deploying due to permissions.
How do I troubleshoot this particular scenario?
I tried the following which had worked for other people, hopefully one may work for you:
Publish as release, then go back and publish as debug again.
Publish as web deploy package then go back and publish to filesystem.
Reinstalling VS2012=0 worked until an update upgraded my Publish dialog.
None worked for me though, so the workaround I came up with is to publish as web deploy package - which actually contains the files that would be in the file system folder - get the files (from the PackageTmp folder) and deploy as before.
I found that a DLL reference was missing from one of the projects but I fixed that by adding it, unused, to the start up project, which causes it to be recognised and published.
Hope this helps.
I have tried it with /A:Basic, worked for me
/A:
Specifies the type of authentication to be used. The possible values are NTLM and Basic. If the wmsvc provider setting is specified, the default authentication type is Basic; otherwise, the default authentication type is NTLM.

Visual Studio 2010 post build event completely ignored

I was looking on stackoverflow for anything similiar to my issue but without results.
It seems that my VS started to completely ignore post-build events.
Post-build events are not triggered in any project or solution I open
or create using my VS 2010.
I don't know why and from when, but previously (a couple of weeks ago) it was working fine. And I haven't changed project configuration nor VS installation on my own. There were a couple of windows update though, but since I dont know from when it is not working, I can not specify them. I want post-build event to be triggered, but it never is, no matter how simple it is. The project configuration is fine, since it is working for my team mates (on their machines).
Trying to figure out what is happening, I did:
created test project
disabled all plugins (CodeMaid, VSAssistX, etc.)
created pre-build, pre-link and post-build events that simply echo something (and ofcourse enabled them in project properties (Use in build -> Yes)).
The result is that I see echos and VS messages about pre-build and pre-link build event, but nothing about post-build event (btw I'm using Qt add-in):
1>------ Rebuild All started: Project: Test, Configuration: Debug Win32 ------
1>Build started 2013-02-07 11:03:54.
1>_PrepareForClean:
1> Deleting file "Debug\Test.lastbuildstate".
1>InitializeBuildStatus:
1> Creating "Debug\Test.unsuccessfulbuild" because "AlwaysCreate" was specified.
1>PreBuildEvent:
1> prebuild
1>CustomBuild:
1> Moc'ing Test.hpp...
1> Uic'ing Test.ui...
1> Rcc'ing Test.qrc...
1>RCC : warning : No resources in 'C:\Projects\BuildEvents\Test\Test\Test.qrc'.
1>
1>ClCompile:
1> moc_Test.cpp
1> main.cpp
1> Test.cpp
1> Generating Code...
1> qrc_Test.cpp
1>PreLinkEvent:
1> prelink
1>qtmaind.lib(qtmain_win.obj) : warning LNK4099: PDB 'vc100.pdb' was not found with 'qtmaind.lib(qtmain_win.obj)' or at 'C:\Projects\BuildEvents\Test\vc100.pdb'; linking object as if no debug info
1> Test.vcxproj -> C:\Projects\BuildEvents\Test\Test.exe
1>FinalizeBuildStatus:
1> Deleting file "Debug\Test.unsuccessfulbuild".
1> Touching "Debug\Test.lastbuildstate".
1>
1>Build succeeded.
1>
1>Time Elapsed 00:00:02.80
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
I suspect that problem is with Visual Studio itself, but maybe you have any better ideas what might be causing that and how to solve it?
Finally I just created script that I run manually after each build. This is stupid solution, because when any of my teammates will do some changes that require changes in post-build, I will need to change my script too.

help building castle dynamic proxy

So I pulled the source from https://svn.castleproject.org/svn/castle/DynamicProxy/trunk/
Open it up in vs.net 2008
problems:
vs.net can't open the assembly.cs
assembly signing failed
What am I doing, rather NOT doing?
Update
So I downloaded nant, setup the .bat file in my PATH so it works in cmd prompt.
I ran:
nant default.build
Getting this error:
build failed, \buildscripts\common-project.xml (48,3)
invalid element . Unknown task or datatype.
How exactly do I build the dynamicProxy project now?
update
This is what I did, see screenshot:
oh and my nant is:
#echo off
"E:\dev\tools\nant-bin\nant-0.86-nightly-2009-05-05\bin\Nant.exe" %*
http://img697.imageshack.us/img697/5623/castlebuildscreenshot.png http://img697.imageshack.us/img697/5623/castlebuildscreenshot.png
You can read the FM (how to build.txt). :)
You need to run the build script first using NAnt (http://nant.sf.net). This will generate the assembly.cs file. Take a look at the .build files in the tree to see what they are doing.
As for the assembly signing failing, check the project settings to get rid of references to CastleKey.snk. It should sign it using DynProxy.snk (in theory).
UPDATE:
The issue with NUnit is now fixed. Do a clean check out. I really have no idea why you're getting that error. Which version of NAnt are you using? Make sure you have the latest (earlier do not have support for .NET 3.5)
You should be able to just pull the source from the trunk, and build with nant (I just did that and it worked). Ok, I lied, looks like the reference to NUnit is wrong, so the unit test project will not build correctly:
BUILD FAILED - 0 non-fatal error(s), 1 warning(s)
D:\OLD\DynamicProxy\buildscripts\common-project.xml(295,5):
'nunit-console.exe' failed to start.
The system cannot find the file specified
Total time: 1.2 seconds.
BUILD FAILED
Nested build failed. Refer to build
log for exact reason.
Total time: 3.4 seconds.
However the important stuff (assemblyinfo generation) will succeed and you should be able to just open Castle.DynamicProxy2-vs2008.sln, fix the reference to the NUnit assembly hit F5 and build the code with no issues.
I just did it on a clean check out, and it worked.
Generally if you're planning to do modifications in DP codebase, it is advised to go to the Castle user group first, and discuss it there.