Project\Properties\PublishProfiles\FolderProfile.pubxml
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>\\yourpath</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<_TargetId>Folder</_TargetId>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
<SelfContained>true</SelfContained>
<PublishSingleFile>True</PublishSingleFile>
</PropertyGroup>
</Project>
---------------------
Essential
RuntimeIdentifier
SelfContained ----- true is framework include
PublishSingleFile
Prerequirement (how to set unpackaged proejct)
Method 1
(menu)build - publish
Method 2
(Soultion Explorer)project : right click - publish
Method 3 (.NET CLI / Example)
dotnet publish -c Release -r win10-your_version --self-contained false /p:PublishSingleFile=true /p:PublishProfile=win10-your_version
Build Option
project_folder\Properties\PublishProfiles\win10-your_version.pubxml
<PublishDir>bin\\YOUR_FOLDER</PublishDir>
<SelfContained>false</SelfContained> <!--true includes framework, false does not.-->
<PublishSingleFile>true</PublishSingleFile> <!--Essential for single exe creation.-->
<PublishReadyToRun Condition="'$(Configuration)' == 'Debug'">False</PublishReadyToRun>
<PublishReadyToRun Condition="'$(Configuration)' != 'Debug'">true</PublishReadyToRun>
<Configuration>Release</Configuration>
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework> <!--Your windows version-->
Comment
Without framework, it's around 60MB.
with framework, it jumps to about 120MB.
winui 3 net8 unpackaged 프로젝트 환경 설정 하기 (4) | 2024.01.04 |
---|
요약
.csproj 의 PropertyGroup를 아래와 같이 수정, 추가 해준다.
그 후 project\Properties\PublishProfiles\ 경로의 각 pubxml파일에도 RuntimeIdentifiers를 수정해준다.
마지막으로 nuget package를 winui 최신 sdk버전으로 업데이트 해준다.
수정 필요 코드
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
추가 필요 코드 // packaged 로 msix로 만드려면 이 두개를 추가하지 않는다.
<WindowsPackageType>None</WindowsPackageType>
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
csproj PropertyGroup 부분 종합
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<RootNamespace>App10</RootNamespace>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Platforms>x86;x64;ARM64</Platforms>
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
<PublishProfile>win10-$(Platform).pubxml</PublishProfile>
<UseWinUI>true</UseWinUI>
<EnableMsixTooling>true</EnableMsixTooling>
<WindowsPackageType>None</WindowsPackageType>
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
</PropertyGroup>
===
ERROR CASE1
XamlCheckProcessRequirements(); 부분에서 아래 에러가 발생한 경우
System.DllNotFoundException: 'Unable to load DLL 'Microsoft.ui.xaml.dll' or one of its dependencies: 지정된 모듈을 찾을 수 없습니다. (0x8007007E)'
아래 구문이 추가되어있지 않은 경우
<WindowsPackageType>None</WindowsPackageType>
===
ERROR CASE2
예외 발생: 'System.DllNotFoundException'(Microsoft.WindowsAppRuntime.Bootstrap.Net.dll)
아래 이 구문이 추가가 되어있지 않거나, windows app sdk 가 알맞은 버전이 설치되어있지 않은 경우.
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
===
ERROR CASE3
디버깅하려면 먼저 프로젝트를 배포해야 합니다. Configuration Manager 배포를 사용하도록 설정하세요.
위 오류가 출력될 경우 바로 아래 구문을 주석처리 해보자.
<!--<WindowsPackageType>None</WindowsPackageType>-->
DEP1560: 매니페스트 파일 "C:\Users\choejaeho\source\repos\App10\App10\bin\ARM64\Release\net8.0-windows10.0.22621.0\win-arm64\AppxManifest.xml"을(를) 읽지 못했습니다. 이 파일을 다시 생성해야 할 수 있습니다. 오류를 수정하려면 솔루션 다시 빌드 명령을 실행하세요. FileNotFoundException - 'C:\Users\choejaeho\source\repos\App10\App10\bin\ARM64\Release\net8.0-windows10.0.22621.0\win-arm64\AppxManifest.xml' 파일을 찾을 수 없습니다. [0x80070002] - C:\Users\choejaeho\source\repos\App10\App10\bin\ARM64\Release\net8.0-windows10.0.22621.0\win-arm64\AppxManifest.xml
DEP1700: 조리법 파일 "C:\Users\choejaeho\source\repos\App10\App10\bin\x86\Release\net8.0-windows10.0.22621.0\win-x86\App10.build.appxrecipe"이(가) 없습니다. 프로젝트를 빌드해야 할 수도 있습니다.
이 DEP 오류 들의 경우에도 위 패키지 타입을 주석처리하거나 본인의 빌드 환경에 알맞은 x86 x64 arm 을 선택하여 빌드한다.
winui 3 create single exe (2) | 2024.01.08 |
---|
윈도우폼 텍스트박스 컨트롤 a 안될 때
program.cs 에서
Application.EnableVisualStyles(); 를 넣어주거나
textbox를 richtextbox로 변경하여 사용한다.
다른 방법이 있다면, 댓글 부탁드립니다.
===
240103 추가
해당 기능은 MFA라고도 하며, Multi-Factor Authentication 의 줄임말이다.
Two-Factor Authentication 이라고도 불리는 것으로 보인다.
MauiProgrma.cs 에 아래(#if winodws 부터)를 추가한다.
FullScreen 은 창이 화면을 꽉 채우게 되어 최소화 최대화 버튼이 보이지 않는 상태이고
Maximize 는 전체 화면으로 최소화 최대화 버튼 등이 보인다.
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});
#if WINDOWS
builder.ConfigureLifecycleEvents(events =>
{
events.AddWindows(wndLifeCycleBuilder =>
{
wndLifeCycleBuilder.OnWindowCreated(window =>
{
window.ExtendsContentIntoTitleBar = false;
IntPtr hWnd = WinRT.Interop.WindowNative.GetWindowHandle(window);
Microsoft.UI.WindowId myWndId = Microsoft.UI.Win32Interop.GetWindowIdFromWindow(hWnd);
var _appWindow = Microsoft.UI.Windowing.AppWindow.GetFromWindowId(myWndId);
//_appWindow.SetPresenter(Microsoft.UI.Windowing.AppWindowPresenterKind.FullScreen);
//if you want to full screen, you can use this line
(_appWindow.Presenter as Microsoft.UI.Windowing.OverlappedPresenter).Maximize();
//if you want to Maximize the window, you can use this line
});
});
});
#endif
혹은
MainPage.cs 에서 동일한 내용을
OnHandlerChanged() 에 추가해서도 사용 가능하다.
protected override void OnHandlerChanged()
{
base.OnHandlerChanged();
#if WINDOWS
var window = App.Current.Windows.FirstOrDefault().Handler.PlatformView as Microsoft.UI.Xaml.Window;
IntPtr windowHandle = WinRT.Interop.WindowNative.GetWindowHandle(window);
Microsoft.UI.WindowId windowId = Microsoft.UI.Win32Interop.GetWindowIdFromWindow(windowHandle);
Microsoft.UI.Windowing.AppWindow appWindow = Microsoft.UI.Windowing.AppWindow.GetFromWindowId(windowId);
appWindow.SetPresenter(Microsoft.UI.Windowing.AppWindowPresenterKind.FullScreen);
// (appWindow.Presenter as Microsoft.UI.Windowing.OverlappedPresenter).Maximize();
// this line can maximize the window
#endif
}
Maui windows admin 권한 얻기 (0) | 2022.08.14 |
---|
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList
위 경로에서 관련된 계정의 폴더를 삭제한다.
또한 C의 User 경로의 계정과 관련된 폴더를 삭제 후 재부팅한다.
그 후 AD 계정에서 빠져나왔다가 다시 join한다.
(만약 위 오류 대상이 도메인 컨트롤러라면 무작정 지우지말고 신중하게 진행...)
mac AD 계정 오프라인으로 로그인 안될 때. (0) | 2023.03.19 |
---|---|
AD DNS 포트포워딩 시 주의 사항 (0) | 2022.10.22 |