Oxiegen 88 Basically an Occasional Poster Featured Poster

Glad to hear it. :)
If this was helpful, please mark this thread as solved.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Ok.
I tried this out myself.
Replace the SendKeys line with: Application.SendKeys "{DOWN}", True

Oxiegen 88 Basically an Occasional Poster Featured Poster

Have you tried searching the forum?
This question has been asked and answered many times.
Just replace any reference to SqlClient with MySqlClient.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Have you tried debugging?
Do you get any error messages?

Oxiegen 88 Basically an Occasional Poster Featured Poster

Ok. I didn't quite think that through. :)
Try this instead:

Imports System.Data.SqlClient
Imports System.Data
Imports MySql.Data.MySqlClient

Public Class MainForm
    Private Sub MainForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MainForm.Load
        Timer1.Stop()

        ReadValues()
        Label42.Text = Label1.Text
        Label41.Text = Label2.Text
        Label30.Text = Label3.Text
        Label29.Text = Label4.Text
        Label28.Text = Label5.Text
        Label27.Text = Label6.Text
        ' And so on

        Timer1.Start()
    End Sub

    Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        ReadValues()
        StoreValues()
    End Sub

    Private Sub ReadValues()
        Label1.Text = EthernetIPforSLCMicro1.ReadAny("F16:0")
        Label2.Text = EthernetIPforSLCMicro1.ReadAny("F16:2")
        Label13.Text = EthernetIPforSLCMicro1.ReadAny("F15:0")
        Label14.Text = EthernetIPforSLCMicro1.ReadAny("F15:1")
        Label15.Text = EthernetIPforSLCMicro1.ReadAny("F15:2")
        Label16.Text = EthernetIPforSLCMicro1.ReadAny("F15:3")
        Label17.Text = EthernetIPforSLCMicro1.ReadAny("B13/16")
        Label18.Text = EthernetIPforSLCMicro1.ReadAny("B13/17")
        Label19.Text = EthernetIPforSLCMicro1.ReadAny("B13/18")
        Label20.Text = EthernetIPforSLCMicro1.ReadAny("B13/19")
    End Sub

    Private Sub StoreValues()
        Try
            Dim SQLStr As String

            'SQL Staments
            If PercentIncrease(Label1.Text, Label42.Text, Label42.Text) Then
                'SQL query = myQuery = "SQL Statment"
                SQLStr = "INSERT into xxxxx(id, f16_0, t_stamp) VALUES(' ','" & Label1.Text & "','" & Now() & "')"
                UpdateDatabase(SQLStr)
                Label42.Text = Label1.Text
            End If
            If PercentIncrease(Label2.Text, Label41.Text, Label41.Text) Then
                'SQL query = myQuery = "SQL Statment"
                SQLStr = "INSERT into xxxxx(id, f16_2, t_stamp) VALUES(' ','" & Label2.Text & "','" & Now() & "')"
                UpdateDatabase(SQLStr)
                Label41.Text = Label2.Text
            End If
            If PercentIncrease(Label13.Text, Label30.Text, Label30.Text) Then
                'SQL query = myQuery = "SQL Statment"
                SQLStr = "INSERT into xxxxx(id, f16_2, t_stamp) VALUES(' ','" & Label13.Text & "','" & Now() & "')"
                UpdateDatabase(SQLStr)
                Label30.Text = Label3.Text
            End If
            If PercentIncrease(Label14.Text, Label29.Text, Label29.Text) Then
                'SQL query = myQuery = "SQL Statment"
                SQLStr = "INSERT into xxxxx(id, f16_2, t_stamp) VALUES(' ','" & Label14.Text …
Oxiegen 88 Basically an Occasional Poster Featured Poster

You need to embrace the word DOWN in braces: SendKeys("{DOWN}").
SendKeys Reference

Oxiegen 88 Basically an Occasional Poster Featured Poster

Oh.

You can do this.
When you first start the program, immediatly fetch the value from the device and store it in both label1 and Label42.
Then during the timer tick event, perform the comparison, and if the result is as wanted, update the database and copy Label1 to Label42 and wait for the next tick event.

Oxiegen 88 Basically an Occasional Poster Featured Poster

I compared all of your multiple methods.
And through them all, there was one constant value in the form of Label42.Text.
I figured that either
a) you made a typo when constructing the formula, or
b) you came up with your own solution
because that would make the formula come up with different answers every time, when compared to the formula I gave you a few days ago.

Also, if you examine the code in the StoreValues method, i call the method PercentIncrease with the various labels as arguments.
That's where value1 and value2 comes from.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Here's a better way.
There's really only need for one timer for the delay, if you set at high enough interval you also wont get any "cross calling" for the Tick event:

Imports System.Data.SqlClient
Imports System.Data
Imports MySql.Data.MySqlClient

Public Class MainForm
    Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        ReadValues()
        StoreValues()
    End Sub

    Private Sub ReadValues()
        Label1.Text = EthernetIPforSLCMicro1.ReadAny("F16:0")
        Label2.Text = EthernetIPforSLCMicro1.ReadAny("F16:2")
        Label13.Text = EthernetIPforSLCMicro1.ReadAny("F15:0")
        Label14.Text = EthernetIPforSLCMicro1.ReadAny("F15:1")
        Label15.Text = EthernetIPforSLCMicro1.ReadAny("F15:2")
        Label16.Text = EthernetIPforSLCMicro1.ReadAny("F15:3")
        Label17.Text = EthernetIPforSLCMicro1.ReadAny("B13/16")
        Label18.Text = EthernetIPforSLCMicro1.ReadAny("B13/17")
        Label19.Text = EthernetIPforSLCMicro1.ReadAny("B13/18")
        Label20.Text = EthernetIPforSLCMicro1.ReadAny("B13/19")
    End Sub

    Private Sub StoreValues()
        Dim MySQLConn As MySqlConnection = Nothing 'The SQL Connection
        Dim MySQLCmd As MySqlCommand = Nothing 'The SQL Command
        Try
            Dim connStr As String = "server=xxxx; user id=xxxx; password=xxxx; database=xxxx; pooling=false"
            Dim SQLStr As String

            'SQL Staments
            If PercentIncrease(Label1.Text, Label42.Text, Label42.Text) Then
                'SQL query = myQuery = "SQL Statment"
                SQLStr = "INSERT into xxxxx(id, f16_0, t_stamp) VALUES(' ','" & Label1.Text & "','" & Now() & "')"
            ElseIf PercentIncrease(Label2.Text, Label41.Text, Label42.Text) Then
                'SQL query = myQuery = "SQL Statment"
                SQLStr = "INSERT into xxxxx(id, f16_2, t_stamp) VALUES(' ','" & Label2.Text & "','" & Now() & "')"
            ElseIf PercentIncrease(Label13.Text, Label30.Text, Label42.Text) Then
                'SQL query = myQuery = "SQL Statment"
                SQLStr = "INSERT into xxxxx(id, f16_2, t_stamp) VALUES(' ','" & Label13.Text & "','" & Now() & "')"
            ElseIf PercentIncrease(Label14.Text, Label29.Text, Label42.Text) Then
                'SQL query = myQuery = "SQL Statment"
                SQLStr = "INSERT into xxxxx(id, f16_2, t_stamp) VALUES(' ','" & Label14.Text & "','" & Now() & "')"
            ElseIf …
Oxiegen 88 Basically an Occasional Poster Featured Poster

If this has been helpful, please mark this thread as solved.

Oxiegen 88 Basically an Occasional Poster Featured Poster

If this has been helpful, please mark this thread as solved.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Why do you need a timer?

Remove the line Timer.Start() in ElseIf (i = 2) Then and replace the line Timer.Stop() in ElseIf (i = 3) Then to say WebBrowser1.Navigate("http://blogger.com") instead, and do the same in the next two ElseIf statements as well but to navigate to Yahoo.com.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Control arrays is almost non-existant in .NET, so therefore I replaced the label array and the List control with a DataGridView.

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
   Dim path As String = Application.StartupPath & "\Test_data.csv"
   Dim stream As System.IO.FileStream = Nothing
   Dim reader As System.IO.TextReader = Nothing
   Dim dt As New DataTable
   Dim headers() As String

   Try
      If System.IO.File.Exists(path) Then
         stream = New System.IO.FileStream(path, FileMode.Open, FileAccess.Read)
         reader = New System.IO.StreamReader(stream)

         While reader.Peek > 0
            line = reader.ReadLine()
            If lineNumber = 0 Then
               headers = line.Split(",")
               For i As Integer = 0 To headers.Length -1
                  dt.Columns.Add(headers(i), GetType(String))
               Next
            Else
               dt.Rows.Add(line.Split(","))
            End If
            lineNumber += 1
         End While
         reader.Close()
         stream.Close()

         DataGridView1.DataSource = dt
      End If
   Catch ex As Exception
      reader = Nothing
      stream = Nothing
   End Try
End Sub

Good luck!

Oxiegen 88 Basically an Occasional Poster Featured Poster

If this was helpful, please mark this thread as solved.

Oxiegen 88 Basically an Occasional Poster Featured Poster

As I already stated. I managed to solve the problem, and it is now fully functional.
On Windows XP this is not an issue, but on Vista/7 it is.

Thank you for your tip, but it doesn't apply.
My app is completely done in .NET 2.0 from scratch, and my problem involed dragging files from the explorer onto the form itself, regardless of how many controls there are on it.

For others out there, here's the solution.
As a normal user on Vista/7, the standard functions in file management are working in the lowest security "settings".
So, when you create an application and decide to run it in an elevated "administrative" environment, then the difference in the standard lower security windows functions and your application will cause the UAC to get itself involved, in order to prevent whatever event it deems a security risk to trigger.
So, to fix this, just add this to the file app.manifest, and set the file as Embedded Resource:

<security>
   <requestedPrivileges>
      <requestedExecutionLevel level="asInvoker" />
   </requestedPrivileges>
</security>

NOW you can drag-and-drop between Windows and your application, because the program will be run as you, the normal user.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Here's a code snippet for calculating an increase in percent.
For example, an increase from 2 to 10 equals 400%.

Private Function PercentIncrease() As Boolean
   Dim value1 As Double   'Value from database
   Dim value2 As Double   'Value from device
   Dim calc As Double
   
   calc = ((value2 - value1) / value1 * 100)

   If calc > 5 Then
      Return True
   Else
      Return False
   End If
End Sub
Oxiegen 88 Basically an Occasional Poster Featured Poster

Try this:
After Call ChangeRes(1280, 1024) , add the line Me.WindowState = FormWindowState.Maximized .

Oxiegen 88 Basically an Occasional Poster Featured Poster

According to this article, the selection of a cell in the DataGridView has turned into an infinite loop, which promply causes the crash.

Probably because you are selecting a new cell from inside one of the cell selection events.

I have no solution for you though.

Oxiegen 88 Basically an Occasional Poster Featured Poster

What is the error message?

Oxiegen 88 Basically an Occasional Poster Featured Poster

I may be misunderstanding your question, but this is pretty much all there is to it to show data in a datagridview.
Just call the method from anywhere and it will display the data in the DataGridView.

Private Sub DisplayDataInDataGridView()
   yourDataGridView.DataSource = Nothing
   Dim con As New MySqlConnection(<your connectionstring>)
   Dim da As MySqlDataAdapter = Nothing
   Dim dt As New DataTable
   Dim SQL As String = ""

   Try
      SQL = "<your select query>"
      con.Open()
      da = New MySqlDataAdapter(SQL, con)
      da.Fill(dt)
      con.Close()
      yourDataGridView.DataSource = dt
   Catch ex As Exception
      If con.State = ConnectionState.Open Then
         con.Close()
      End If
   End Try
End Sub
Oxiegen 88 Basically an Occasional Poster Featured Poster

In all honestly, I have no experience with what you're attempting.
But I am fairly competent in using Google, and applying what I learn from there in my own projects.

Have you read this MS article? Getting WYSIWYG Print Results from a .NET RichTextBox

Oxiegen 88 Basically an Occasional Poster Featured Poster

It's not a very nice thing to do really.
What if the users monitor happens to not support that resolution?
It would be more beneficial to adjust your program to be more dynamic instead.

But if you insist: Here's how

Oxiegen 88 Basically an Occasional Poster Featured Poster

Try this:
msgbox(cbomodel.GetItemText(cbomodel.SelectedItem))

Oxiegen 88 Basically an Occasional Poster Featured Poster

You don't.
I didn't read your question fully and thus misunderstood.

Oxiegen 88 Basically an Occasional Poster Featured Poster

I managed to solve it.
Although I cannot debug this functionality, it still works when compiled.

If you add <requestExecutionLevel level="asInvoker" uiAccess="false" /> in your manifest file. It will work.

Oxiegen 88 Basically an Occasional Poster Featured Poster

My apologies. It was I that didn't read the entire question.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Correction.
If you want to know how many open forms you have:

Dim count As Integer = My.Application.OpenForms.Count

Every time you open a form, it will be added to the OpenForms collection.
And every time you close a form with the .Close() and/or .Dispose() methods, it will be removed from the OpenForms collection.
So, OpenForms will keep a running track of what forms are opened and how many.

GeekByChoiCe commented: i am sorry but he dont want the number of ALL open forms. he want the count of forms with a given name. +0
Oxiegen 88 Basically an Occasional Poster Featured Poster

The image is most likely stored as a byte stream in the database.
You have to read the image from the database into a byte array.
From there, you can read the byte array into a memory stream, which in turn is used to call: Image.FromStream(.....)

nick.crane commented: If you check the code this is clearly not the case! +0
Oxiegen 88 Basically an Occasional Poster Featured Poster

Have you tried .SetAttribute("checked","0")?

Oxiegen 88 Basically an Occasional Poster Featured Poster

Does anybody else have any ideas of how to solve this?

Oxiegen 88 Basically an Occasional Poster Featured Poster

Much appreciated. :)

Oxiegen 88 Basically an Occasional Poster Featured Poster

Yes. I saw that excellent article.
And it's practically identical to what I'm trying to achieve.
But alas, I still get that pesky little "Not Here" cursor.

I read another article shortly after posting this question, that this has something to do with differences in elevated securities. Especially on Vista and Windows 7.
On Windows XP, this is appearently not an issue.
So, I was kind of hoping for a solution on this. :)

Oxiegen 88 Basically an Occasional Poster Featured Poster

Hello.

I'm having a bit of difficulty implementing Drag and Drop.

The scenario is this.
I have a project with an MDI child where I want to drop documents from Windows Explorer.

The code is all in place (this is just for debugging purposes) and I have set AllowDrop to True for the form.

Private Sub Registrations_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles Me.DragEnter
            If e.Data.GetDataPresent(DataFormats.FileDrop) Then
                e.Effect = DragDropEffects.All
            End If
        End Sub

        Private Sub Registrations_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles Me.DragDrop
            If e.Data.GetDataPresent(DataFormats.FileDrop) Then
                Dim files() As String

                files = e.Data.GetData(DataFormats.FileDrop)
            End If
        End Sub

But whenever I grab onto a file and drag it onto the form, I get the "Not Here" cursor (you know, the circle with a slash through it), and thus cannot drop the file.

What am I missing?
I'm using Visual Studio 2008 Pro in Windows 7, if that has anything to do with it.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Perhaps one of these projects can be useful.
http://www.codeproject.com/KB/printing/

Oxiegen 88 Basically an Occasional Poster Featured Poster

What you're talking about is a form of nuking, and it's illegal.
And randomly creating multiple names for registration purposes is fraud, and it's illegal.

You just have to take your chances like everyone else.

Oxiegen 88 Basically an Occasional Poster Featured Poster

You're welcome.
Please mark the thread as solved.

Oxiegen 88 Basically an Occasional Poster Featured Poster

My bad.
I forgot to include the Software node. And I just read that registry settings for 32bit programs running on Windows x64 are stored in yet anothor subnode.

Try this path: Microsoft.Win32.RegistryKey rk = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("\\Software\\Microsoft\\Windows\\WOW6432node\\CurrentVersion\\Uninstall");

kvprajapati commented: Solved!!! +10
Oxiegen 88 Basically an Occasional Poster Featured Poster

An exception, of any type, is always thrown on the first encountered error.

Here's my take on it:
If you want to throw one single exception for all occuring errors, then you need to read the entire file into a string variable with a TextReader, and create a parser that scans the string for all possible reasons an error could occur.

Oxiegen 88 Basically an Occasional Poster Featured Poster

If the file you're trying to read is a textfile, then you can use the TextReader's ReadLine method.

Try this and see if it helps.

TextReader reader = New StreamReader("<file to read>");
string line = "";

int startReadingHere = <enter line number here>;
int lineIndex = 0;
int readLines = 0;

while (reader.Peek() != -1)
{
   if (lineIndex >= startReadingHere && readLines < 10)
   {
      line = reader.ReadLine();
      //Do something with the string
      readLines += 1;
   }
   lineIndex += 1;
}
Geekitygeek commented: my thoughts exactly :) +1
Oxiegen 88 Basically an Occasional Poster Featured Poster

Perhaps this thread could be of some use: http://www.daniweb.com/forums/thread141412.html.

And here's an opensource .NET SMS library: http://twit88.com/platform/projects/show/messagingtoolkit

Oxiegen 88 Basically an Occasional Poster Featured Poster

Perhaps it has something to do with margins in the printer itself?

Oxiegen 88 Basically an Occasional Poster Featured Poster

choitee.
You need to create your own thread.
Don't hijack someone else´s.

Oxiegen 88 Basically an Occasional Poster Featured Poster

I found this excerpt on MSDN.

Dim aw As XNamespace = "http://www.adventure-works.com"
Dim root As XElement = New XElement(aw + "Root", _
New XAttribute(XNamespace.Xmlns + "aw", "http://www.adventure-works.com"), _
New XElement(aw + "Child", "Child content"))

Which produces this output:

<aw:Root xmlns:aw="http://www.adventure-works.com">
   <aw:Child>Child content</aw:Child>
</aw:Root>

http://msdn.microsoft.com/en-us/library/bb387075.aspx

I hope it helps.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Appearently, Vista/Windows7 doesn't like running Click-Once deployed applications in an elevated UAC.
I found this workaround though, if this is something you might consider: http://www.geektieguy.com/2007/08/25/getting-vista-uac-elevation-to-work-for-web-deployed-clickonce-applications/

Oxiegen 88 Basically an Occasional Poster Featured Poster

My apologies.

Try this.
If it doesn't work. Please tell where/on what line the error occurs.
And what the error message says.

Dim fs As New FileStream(picPhoto.ImageLocation, FileMode.Open)
Dim picture As Byte() = New Byte(fs.Length) {}
fs.Read(picture, 0, fs.Length)
fs.Close()

CN.OpenConnection()
Dim CMD As New Odbc.OdbcCommand("SavePhoto", CN.DBConnection)
CMD.CommandType = CommandType.StoredProcedure

Dim pic As New Odbc.OdbcParameter("@Picture", Odbc.OdbcType.Image)
pic.Value = picture
CMD.Parameters.Add(pic)

Dim FileName_Renamed As New Odbc.OdbcParameter("@ID", Odbc.OdbcType.VarChar)
FileName_Renamed.Value = txtID.Text
CMD.Parameters.Add(FileName_Renamed)

CMD.ExecuteNonQuery()
CN.closeconnection()
USE [EarthMovers]
GO
/****** Object: StoredProcedure [dbo].[SavePhoto] Script Date: 06/29/2010 13:22:35 ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
-- =============================================
-- Author: Siddhartha Saha
-- Create date: 29/06/2010
-- Description: 
-- =============================================
ALTER PROCEDURE [dbo].[SavePhoto]
-- Add the parameters for the stored procedure here
(
@Picture image,
@ID varchar(60)
)
AS
UPDATE ItemDimension SET itmdmnPhoto=@Picture WHERE itmdmnID=@ID
Oxiegen 88 Basically an Occasional Poster Featured Poster

Add Environment.NewLine after each body line.
A better way would be to do this:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click
    Dim strSubject As String 'subject title
    Dim strBody As String 'Body of message

    strSubject = "Need Remote Pc Help" 'store subject in variable

    'store body in variable
    strBody = "Here is All the Information that you will need:" & Environment.NewLine
    strBody &= txtName.Text & Environment.NewLine
    strBody &= txtAddress.Text & Environment.NewLine
    strBody &= txtPhone.Text & Environment.NewLine
    strBody &= txtProblem.Text & Environment.NewLine
    strBody &= txtIP.Text

    Dim mail As New System.Text.StringBuilder
    strSubject = "?subject=" & strSubject

    mail.Append("mailto:backstback@hotmail.com") 'email address

    mail.Append(strSubject) 'subject
    mail.Append(strBody) 'body of message
    SendMail(mail.ToString)
End Sub
Oxiegen 88 Basically an Occasional Poster Featured Poster

Well. It depends.
Both Java and any language within the .NET framework can be used both for Windows and Web development.
But PHP is considered a strictly Web development language.

And in my opinion it's a matter of taste.
Java development doesn't have all that much to offer with regards to easy-to-use visual development tools where you can just drag 'n drop controls onto a form.
The .NET framework, provides multiple development languages: VB.NET, C#, J#.... and you can use Visual Studio for all those languages.

However, Java is a good introduction into Object Oriented Programming, but the drawback is that the differences in syntax can be confusing when switching to .NET.

If you have any experience with developing in, say C/C++, you can do both C# and PHP.
If you have any experience with developing in Java, you can do both Java and J#.
If you can do VB, then you can do both VB and VB.NET.
The basic syntaxes in these "newer" languages are practically the same as the "older" ones.

Oxiegen 88 Basically an Occasional Poster Featured Poster

See if this helps.

private string WampInstallPath()
{
    Microsoft.Win32.RegistryKey rk = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("\\\\Microsoft\\Windows\\CurrentVersion\\Uninstall");
    Microsoft.Win32.RegistryKey sk = null;
    string path = "";

    foreach (string subkey in rk.GetSubKeyNames())
    {
        if (subkey.ToLower().StartsWith("wamp"))
        {
            sk = rk.OpenSubKey(subkey);
            path = (string)sk.GetValue("InstallLocation");
            break;
        }
    }
    return path;
}
Oxiegen 88 Basically an Occasional Poster Featured Poster

So it's actually a CSV file.
Try this:

private void PopulateDataGridView()
{
    string filePath = "<path to dat file>";
    System.IO.TextReader reader = new System.IO.StreamReader(filePath);
    bool colAdded = false;
    DataTable table = new DataTable("data");

    try
    {
        while (reader.Peek() != -1)
        {
            string[] tokens = System.Text.RegularExpressions.Regex.Split(reader.ReadLine(), ",");
            if (!colAdded)
            {
                foreach (string token in tokens)
                {
                    table.Columns.Add(token);
                }
                colAdded = true;
            }
            else
            {
                DataRow row = table.NewRow();
                for (int i = 0; i < table.Columns.Count; i++)
                {
                    row[i] = tokens[i];
                }
                table.Rows.Add(row);
            }
        }

        dataGridView1.DataMember = "data";
        dataGridView1.DataSource = table;
    }
    finally
    {
        if (reader != null)
            reader.Close();
    }
}
Ketsuekiame commented: Well fed +0
Oxiegen 88 Basically an Occasional Poster Featured Poster

You need to change the projects manifest file a bit.

<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
    <security>
      <applicationRequestMinimum>
        <PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true" ID="Custom" SameSite="site" />
        <defaultAssemblyRequest permissionSetReference="Custom" />
      </applicationRequestMinimum>
      <!-- Add these lines if missing, else change level from 'AsInvoker' to 'requireAdministrator' -->
      <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v2">
        <!-- UAC Manifest Options -->
        <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
      </requestedPrivileges>
    </security>
  </trustInfo>
</asmv1:assembly>