.NET Programming

133K

Solutions

39K

Contributors

The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.

Share tech news, updates, or what's on your mind.

Sign up to Post

Need help to uninstall .net 4.7.2 on my Windows 2016 Server.

I installed .net 4.7.2 for my Exchange 2016 CU9 running on Windows 2016 Data Center.

After getting a million errors on my Exchange Servers I was asked to remove .net 4.7.2 and revert back to .net 4.7.1

I found no way on the Server to remove .net except for 4.6 3.5 and 2.0   4.7 does not show.

I did find this but not sure which is correct.
Open an admin command prompt and paste this script:
%windir%\microsoft.net\Framework64\v4.0.30319\SetupCache\v4.7.02558\setup.exe /uninstall /x86 /x64 /passive /norestart
If you have 4.7.1 as the latest version, this will run the removal tool. Reboot, and it will be removed.


What would the proper method of removing .net 4.7.2 be?

Can I use the above command? What changes would I need to make it work?

Thank  you,
1
Amazon Web Services
LVL 12
Amazon Web Services

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

Hello Experts,

This issue is concerning an ASP.NET webpage that's currently used in our contact center.
It's a personalized launch page for users, with links they need to do their jobs.
But recently some of the tools used by our colleagues have changed.

The problem is, some links now work faster in IE and some faster in chrome.
And the difference in speed is rather dramatic in some cases.

I need a way to force the individual links to open in the fastest browser.

Many Thanks!
Maurice
1
Hello Experts,
I have a Onclick event attached to button which should open a window (on Javascript), which is working just fine.  But, when I click on another URL same window opens up, which is not related to the URL at all.  Any idea what could be going on?  Please try to help.  Thank you in advance.

Note:  Due to company's restrictions I will not be able to post the code here.

Thank you!
0
Hello Experts,
In a web page, when I click on a link, it fails.  Upon doing further research I found that I pass Line 1, but it changes to Line 2 automatically at the Run Time.  Any idea what is going on?  Please try to help.  Thank you very much in advance.

Line 1: http://abc.com/DataSources/APP DB/IDocument?AutoLogoutOnClose=True&AppName=TKT_DET&TktId=333333
Line 2: http://abc.com/DataSources/APP%20DB/IDocument?AutoLogoutOnClose=True&AppName=TKT_DET&TktId=333333

Thank you!
0
Avoid Empty Catch Blocks
It’s a very bad habit to leave catch blocks empty, as when the exception is caught by the empty catch block, the program fails in silence, which makes debugging harder. Consider the following program which calculates sum of two numbers from command-line arguments:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
public class Sum {
    public static void main(String[] args) {
        int a = 0;
        int b = 0;
 
        try {
            a = Integer.parseInt(args[0]);
            b = Integer.parseInt(args[1]);
 
        } catch (NumberFormatException ex) {
        }
 
        int sum = a + b;
 
        System.out.println("Sum = " + sum);
    }
}
Note that the catch block is empty. If we run this program by the following command line:
1
java Sum 123 456y
It will fail silently:
1
Sum = 123

Open in new window


when i tried above example i am getting different error as below istead of getting 123


public class Sum {
    public static void main(String[] args) {
        int a = 0;
        int b = 0;
 
        try {
            a = Integer.parseInt(args[0]);
            b = Integer.parseInt(args[1]);
 
        } catch (NumberFormatException ex) {
        }
 
        int sum = a + b;
 
        System.out.println("Sum = " + sum);
    }
}

Open in new window


Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
      at Sum.main(Sum.java:7)

https://www.codejava.net/coding/10-java-core-best-practices-every-java-programmer-should-know

even below good catch block example also gives same error
public class SumFixed {
    public static void main(String[] args) {
        int a = 0;
        int b = 0;
 
        try {
            a = Integer.parseInt(args[0]);
            b = Integer.parseInt(args[1]);
 
        } catch (NumberFormatException ex) {
            System.out.println("One of the arguments are not number." +
                               "Program exits.");
            return;
        }
 
        int sum = a + b;
 
        System.out.println("Sum = " + sum);
    }
}

Open in new window

Please advise
0
Hi,
How do I add a autonumber  column to the datatable.
example:
Id ColName
1   abc
2   gfg
3   grg
4 ggg

ID should be autoincrementing column.

Thanks
0
If a user launches my application from a shortcut how do I get the path of the shortcut that was used to execute the application? It's easy enough to get the directory of the application itself. All of the following provide useful information:
Directory.GetCurrentDirectory();
Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().CodeBase);
Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
Path.GetDirectoryName(Environment.GetCommandLineArgs()[0]);

Open in new window

However, let's say that my executable is on a share, let's say the path is \\MyServer\D\SharedFolders\MyApplication\MyExe.exe. Now, let's say the user creates a shortcut in C:\Users\[username]\Documents\My Shortcuts\MyExe - Shortcut. If the user double clicks the shortcut all of the above will return the UNC path. Is there a way I can get the path of the actual shortcut that was used to launch the executable?
0
Hi Experts.

I have a problem like this: i have a DLL file without source code from the previous programmer who build our business system.

How can I de-compile this DLL file to source code, I have use dotPeek and get the defined variables, but the function is unable to de-compile with the message:

// ISSUE: unable to decompile the method.

Is there anyway to solve this problem?

Thanks for reading this.
0
Advantages of Tensorflow.JS?

What are the benefits of using Tensorflow.JS in comparison to other Javascript frameworks?

Does it transpile like Angular?

What other frameworks are similar?

Is there any benefit to using Tensorflow.JS with a .NET back-end?

Thanks
0
From the following extract from a source input stream, i need to use c# regex to extract a match collection of each matching block of code between the ##if WORD ## and the matching ##endif WORD ##

##if textbox ##
		<tr>
			<td>Textbox description here, could be anything:</td>
			<td>##textbox##</td>
		</tr>
##endif textbox ##
		<tr>
			<td>multilinetextbox</td>
			<td>##multilinetextbox##</td>
		</tr>
##if staticdropdown ##
		<tr>
			<td>staticdropdown description here, could be anything or nothing or something else alltogether:</td>
			<td>##staticdropdown##</td>
		</tr>
##endif staticdropdown ##

Open in new window


The returned match should include the ##if and end ##endif blocks as below...

Match 1:
##if textbox ##
		<tr>
			<td>Textbox description here, could be anything:</td>
			<td>##textbox##</td>
		</tr>
##endif textbox ##

Open in new window


Match 2:
##if staticdropdown ##
		<tr>
			<td>staticdropdown description here, could be anything or nothing or something else alltogether:</td>
			<td>##staticdropdown##</td>
		</tr>
##endif staticdropdown ##

Open in new window


I have been testing various online regex testing sites to see I I can get what I need but always end up with the match being from the very first ## if WORD ## to the very last ##endif OTHERWORD ## construct

Any help gladly accepted :D
0
Exploring ASP.NET Core: Fundamentals
LVL 12
Exploring ASP.NET Core: Fundamentals

Learn to build web apps and services, IoT apps, and mobile backends by covering the fundamentals of ASP.NET Core and  exploring the core foundations for app libraries.

Hi,

  I have this DataTemplate :

    <DataTemplate x:Key="CommandsTemplate">
        <ItemsControl IsTabStop="False" ItemsSource="{Binding}" Margin="6,2">
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <Button Margin="4 0 0 0" Style="{StaticResource LinkButton}" Command="{Binding Path=Command}">
                        <StackPanel Orientation="Horizontal">
                            <Image Source="{Binding Path=DisplayImage}" VerticalAlignment="Bottom" />
                            <TextBlock Margin="4 0 0 0" FontSize="14" Text="{mvvm:DynamicResourceBinding DisplayName}"/>
                        </StackPanel>
                    </Button>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>
    </DataTemplate>

I need to have a second DataTemplate that is exactly the same, except it adds a "CommandParameter" to the button's command. Like this :

    <DataTemplate x:Key="CommandsTemplate2">
        <ItemsControl IsTabStop="False" ItemsSource="{Binding}" Margin="6,2">
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <Button Margin="4 0 0 0" Style="{StaticResource LinkButton}" Command="{Binding Path=Command}" CommandParameter="{...blablabla...}">
                        <StackPanel Orientation="Horizontal">
                            <Image Source="{Binding Path=DisplayImage}" VerticalAlignment="Bottom" />
    …
0
Hi Guys,

I can retrieve ClaimsIdentity in by .net  core 2.0 app in development mode but I cannot do so in production: My code:

            var identity = (ClaimsIdentity)User.Identity;
            IEnumerable<Claim> claims = identity.Claims;


            var claimType = "PID";
            var claim = identity.FindFirst(claimType);
            var pgl = claim == null ? string.Empty : claim.Value;

Open in new window


Not sure what the reason might be but I found a link in stackoverflow but the solution is unclear:

https://stackoverflow.com/questions/49294917/claimidentity-not-working-on-production-asp-net-core-2-0

Could someone please kndly help me?
0
As an experiment, I want to create a c#/.Net DLL that I can reference from MS Access VBA.  So far, I have used two examples - but each one gives me the following error when I try to add it as a refernce:

"Can't add a reference to the specified file".

Here is one of the examples that I used: http://www.geeksengine.com/article/create-dll.html

Adding the reference would be ideal, but I could also use late binding.  However, I just need to find a starting point and figure out what I'm doing wrong.

Any help would be greatly appreciated.
0
I have an asp.net web application, with master pages , aspx pages and also user control (ascx ) pages. sample code below

I have a function in menu.ascx , user control page, which needs to fire a function in default.aspx page.
is there a way to do this ?

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site1.master.cs" Inherits="masterpage.Site1" %>  
<%@Register Src=~/menu.ascx” TagName=”menu” TagPrefix=”uc1” %>
<!DOCTYPE html>  
<html xmlns="http://www.w3.org/1999/xhtml">  
<head runat="server">  
    <asp:ContentPlaceHolder ID="head" runat="server">  
    </asp:ContentPlaceHolder>  
</head>  

<body>  
    <div id="navigaion">
         <uc1:menu ID=”menuControl” runat=”server” />
    </div>
    <div id="maincontent">  
        <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">   </asp:ContentPlaceHolder>  
    </div>  
</body>  
</html>
0
I have a .Net Framework (4.6.1) class library project (call it A).
Then I have a UWP app (call it B), and I want to use the code in A by referencing to A from B. But that is not possible. UWP apps are .Net Core and not compatible with .Net Framework.

So I created a .Netstandard 2.0.3 class library project (call it C), to be a proxy between A and B. I now reference from A (the UWP app) to C (the .Netstandard class library), and then from C to B (the .Net framework class library).

Everything compiles now, but when I run/debug the UWP app in Visual Studio I get the following error originating from the code in A:

System.IO.FileNotFoundException: 'Could not load file or assembly 'System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.'

System.Web.ApplicationServices is a .Net Framework reference in A, and is not compatible with B. I was hoping to get around this by using .Net standard and C as a proxy between A and B.

Any suggestions on how to fix this?

Code examples won't help here, the code works fine, but not the integration between the various technologies.
0
In the below example code using ASP .NET Core 2.1, I am dynamically adding a table row when the add button is clicked. The row contains 3 input boxes and one button (a minus symbol which removes the row when clicked). I'm struggling to find the best way to handle the deletion since I want to preserve model-binding when the form is posted. The rows in this table should populate List<People> when the form is submitted.

Is there a more elegant way to handle this besides re-indexing each row every time a delete happens? Any examples I can review will be much appreciated.


Initial view from HttpGet controller
<div>
	<table class="table table-condensed" id="people-list">
		<thead>
		<tr>
			<th>First Name</th>
			<th>Last Name</th>
			<th>Email Address</th>
		</tr>
		</thead>
		<tbody>
		@for (var i = 0; i < Model.PeopleList.Count; i++)
		{
			<tr>
				<td>
					@Html.HiddenFor(m => Model.PeopleList[i].FirstName)
					@Html.TextBoxFor(m => Model.PeopleList[i].FirstName, new { @class = "row-index form-control"})
				</td>
				<td>
					@Html.HiddenFor(m => Model.PeopleList[i].LastName)
					@Html.TextBoxFor(m => Model.PeopleList[i].LastName, new { @class = "form-control" })
				</td>
				<td>
					@Html.HiddenFor(m => Model.PeopleList[i].Email)
					@Html.TextBoxFor(m => Model.PeopleList[i].Email, new { @class = "form-control" })
				</td>
				<td>
					<button class="btn btn-default" id="remove-person-@i"><i class="glyphicon glyphicon-minus"></i></button>
				

Open in new window

0
I need to recursively collect AD users for a list of groups but if I encounter a group that is a nested member that is in my $ExclusionList I do not want to add those to the $RecursiveMembers collection.

I know how to build the recursive collection but how can I add only the users in the non excluded groups to the collection, how do I append the collection ?
0
I need some examples of how to do advanced grouping and formatting using GemBox and C#.
We use MVC

Thank You!
0
I want to implement the Webhook APIs from zoom.us using ASP .NET Core 2.1 Web API, but I'm not sure how to configure this to test in Visual Studio 2017 IDE. Since it requires me to configure an application URL where it will send callbacks to my APIs, how can I set this up locally for debugging when IIS Express uses localhost as the site name? Will I need a public facing webserver/site to publish my code to?
0
Exploring SharePoint 2016
LVL 12
Exploring SharePoint 2016

Explore SharePoint 2016, the web-based, collaborative platform that integrates with Microsoft Office to provide intranets, secure document management, and collaboration so you can develop your online and offline capabilities.

I am writing code and implementing the code sample in the below url from Silicon Expert.

https://www.siliconexpert.com/apidocs/content/list-part-search

The sample code produced error:  "The request was aborted: Could not create SSL/TLS secure channel."

Searching I found that the below code should be implemented.
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
ServicePointManager.ServerCertificateValidationCallback += new RemoteCertificateValidationCallback(AllwaysGoodCertificate);

Open in new window

Below is the full example.  
String username = "MyUserName";
String password = "MyPassword";

ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
ServicePointManager.ServerCertificateValidationCallback += new RemoteCertificateValidationCallback(AllwaysGoodCertificate);

string url = "https://app.siliconexpert.com/SearchService/search/authenticateUser?login=" + username + "&apiKey=" + password;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Credentials = CredentialCache.DefaultCredentials;
CookieContainer cookieContainer = request.CookieContainer = new CookieContainer();
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
String searchUrl = 

Open in new window

0
Hi,

I wanted to develop print solution for my web app : Web app to Desktop print appl using microsoft stack.

when someone press print button on web app, web app may send something like push notification as COMMAND to desktop application (User specific) and upon receipt of command Desktop print app can print the documents. If case of failure Desktop Print Application can send back information to web app about print failure.

To send push notification from web app to Desktop app,
can i use SignalR for sending user specific push notification ?

Please suggest :

1.Am i going in right direction.Whether the industry standards use same process like Google Print or PrintNode.

If not what technology/Process i can use for such application.
Initialy developing for one customer but need for multiple users.

regards,
0
This how i am planing to synchronize my desktop  application with my website.

1. I have created a text file.
2. every time a user inserts or updates a record - the sql statement is added to the text file.
3. On closing the application or when the user desires that text file is uploaded to the ftp on the website domain

The when the websites is opened , it check if there any new files.
It runs the statements in text file, executing one at a time to update the website database.
The the website user can view data and also run reports.

I have a feeling there are likely to be better ways i can do this, help please

Anthony
0
I'm trying to read, and later hopefully write, the rating value on an MP3 file. I'm using the TagLibSharp library and everything I've found so far indicates that this should work but it doesn't seem to. Here's the code I'm currently using:
			TagLib.Id3v2.Tag.DefaultVersion = 3;
			TagLib.Id3v2.Tag.ForceDefaultVersion = true;
			TagLib.File mp3File =TagLib.File.Create(@"C:\Users\Russ\Downloads\Precious - copy.mp3");
			TagLib.Tag tag = mp3File.GetTag(TagLib.TagTypes.Id3v2);
			TagLib.Id3v2.PopularimeterFrame frame = TagLib.Id3v2.PopularimeterFrame.Get((TagLib.Id3v2.Tag)tag, "Windows Media Player 9 Series", true);
			// at this point, frame.Rating is always 0. Why?;

Open in new window

Here is a screenshot of the properties window of the MP3 file showing that the rating currently is set at 4 stars.
MP3 RatingI'd like to accomplish 2 goals.
1. I'd like to be able to read the rating value correctly. I know frames can have different values depending on the user. I'm specifically looking for the one that is displayed here by the Windows system properties.
2. Once I have the correct frame, I want to be able to write a different value back to the file. Say, go from 4 to 5 stars.

Neither of these options are working right now because as you can see by the comment in the code above, the Rating value for the frame is always zero. What am I missing?
0
Hi Expert,
I'm start learning  ASP.net MVC ,But I understand there is ASP.net core MVC, Which one you guys think i have to study
0
We have a multilingual application. One is Polish and we want to export data to excel. We get this error

System.ArgumentException: Input string was not in a correct format.Couldn't store <4 488,67> in 2 Column. Expected type is Decimal. ---> System.FormatException: Input string was not in a correct format

I tried this
var test = Convert.ToDecimal("4 488,67");

Open in new window


But still get an error....same one.

Anyway to convert a value like that to Decimal?
0

.NET Programming

133K

Solutions

39K

Contributors

The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.