Questions tagged [net#]

414845 questions
1

votes
0

answer
263

Views

hosting MVC core Apllication without publishing

we started to work in a MVC core application. I have seen many web site about hosting Core application after publishing. can we host a MVC core web app without publishing,that is copy all files from local to server machine using ftp as we do in asp.net project.Since it is in development stage there...
rajin
1

votes
0

answer
249

Views

HTTP Error 502.5 - Process Failure in .Net core 1.1

It was not possible to find any compatible framework version The specified framework 'Microsoft.NETCore.App', version '1.1.2' was not found. Check application dependencies and target a framework version installed at: Alternatively, install the framework version '1.1.2'. I installed Windows (Server H...
Shah Niral
1

votes
0

answer
559

Views

details for project could not be loaded

My first attempt with F# has yielded with the following exceptions: Severity Code Description Project File Line Suppression State Error Error occurred while restoring NuGet packages: The operation failed as details for project ConsoleApp1 could not be loaded. Error Assets file 'C:\...
1

votes
1

answer
433

Views

ASP.Net Core 2 - How can I get Visual Studio Code to detect Razor Pages?

In Asp.net core 2, they introduced razor pages. Using visual studio code if I create a 'Pages' folder in the root of the solution and then add a new item 'Greeting.cshtml', then add an @page directive at the top followed by the content I want to display, I don't see anything when I navigate to http:...
User123
1

votes
1

answer
28

Views

Copying Clipboard text including tables to microsoft word (.docx) file

Dim objApp As Word.Application Dim objDoc As Word.Document objApp = New Word.Application() objDoc = objApp.Documents.Open('C:\Users\bn\Desktop\DCIM\lol.docx') objDoc.Activate() objApp.Selection.TypeText(My.Computer.Clipboard.GetText) objDoc.SaveAs('C:\Users\bn\Desktop\DCIM\lol2.docx') objDoc.Close()...
Kishan Gupta
1

votes
1

answer
199

Views

Package 'Faker.Net 1.0.3' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.0'

I'm new to .NET core tools and just ran into an issue while running the following command; I can see that it's just a warning but it's not creating the 'publish' folder even with 'sudo dotnet publish -o /publish' dotnet publish -o /publish As you can see there's no publish folders /home/joel/worksp...
pelican
1

votes
0

answer
254

Views

VB.net WPF and Win 10 Toast Notifications

I'm trying to show toast notifications in Win 10 from vb.net WPF app. 1. I added 10.0 to .vbproj file in the section. 2. I Added references to Windows.Data and Windows.UI 3. My code: Class MainWindow Private Sub BtnClick() Dim ToastN As ToastNotification = New ToastNotification('Test', 'This is tes...
RadiM
1

votes
1

answer
1.4k

Views

.NET Core 2.0 API with EF6 and .edmx file?

I want to build a API using .NET Core 2.0 that targets the full .NET framework so I can work with Entity Framework 6 and an .edmx file. Is this possible? How do I inject the DbContext generated by the .edmx file? I want to do this because my project works with a lot of stored procedures and I don't...
genzop
1

votes
1

answer
258

Views

jQuery UI Autocomplete in MVC modal window

I'm trying to implement the autocomplete jQuery UI function in a Bootstrap modal window, but it does not work. screenshot module console debug Take the steps of not returning a partial view, also already implement jQuery CSS styles, the truth works for me in full views, but why when calling a modal...
Fytito Ambiado
1

votes
1

answer
58

Views

Entity Framework - mapping one class to two tables with many to one relation

I have a class which represent a connection of a page and a tag and it looks more or less like this: public class TagLink { [Key] public int Id { get; set; } public int PageId { get; set; } public int TagId { get; set; } public string TagName { get; set; } } In my database I would like to have 2 tab...
krajol
1

votes
0

answer
482

Views

MVC Ajax, Post to Controller base64 string

In my project I send post json data object. One item of this object is base64 string. When base63 string is too long, my request doesnt reach to controller. In my opinion , due to length of parameter,it doesnt work. I couldnt find any solition. [HttpPost] [ValidateInput(false)] public ActionRe...
Çağrı Taçyıldız
1

votes
0

answer
475

Views

How to make Push Notification in Asp.Net Web App with Angular?

I need to make Push Notification for every user, when product's price is changed. Just like this: The thing is that I have a job, that runs in the background and checks all the prices and sends emails to everyone informing on changes. I want to add these desktop notifications, so javascript and html...
Nikas Žalias
1

votes
0

answer
53

Views

Prevent `using static` Directive with RequireQualifiedAccess

In F#, there is a .NET attribute that prevents programmers to use using static: Adding the [] attribute to a module indicates that the module may not be opened and that references to the elements of the module require explicit qualified access. For example, the Microsoft.FSharp.Collections.List modu...
MiP
1

votes
1

answer
197

Views

Entity Framework Core 2.0 Recreating all DB Tables

Every time I run dotnet ef migrations add the migration created recreates all the DB tables. When then trying to run the migration I obviously get a message that the table already exists. What am I missing? I am using the following packages; I also have this in the csproj;
Christopher Penkin
1

votes
1

answer
223

Views

Where does ASP.NET Identity store information about external authentication provider?

In my ASP.NET MVC application, I have enabled authentication using Microsoft and Google accounts. They both are working fine. i.e., I am able to login to my application using my hotmail and gmail both accounts. Once logged in (say, using Microsoft account), I am able to see following screen as well...
Nirman
1

votes
0

answer
88

Views

SignalR setup when separating out data access layer

Current setup has a single webapi with controllers, services, SignalR Hubs/server, data entity models and view models (say Project.Main). The thought is to create a separate project (Project.Data - webapi) for Data entity model, view models and services. Project.Main would reference Project.Data to...
Shyamal Parikh
1

votes
0

answer
26

Views

gruntfile taskrunner compilation error in angular js 2 project

I am working on asp.net project using angular js 2 in VS 2015. I am using webpack and gruntfile. I have a task in task runner which is giving error like this: Running 'ts:base' (ts) task Compiling... Using tsc v2.0.6 >> Compilation failed Warning: Task 'ts:base' failed. Use --force to continue. Abor...
Asif Hameed
1

votes
1

answer
259

Views

What's the best way to implement roles in a multi-tenant .net project?

My application is .NET 4.7 Web Api with Entity Framework 6. This is for a software as a service tool I am building. In my application there is a many to many relationship between AspNetUser and Company. A user can have many companies, and a company can have many users. A user needs to have a diffe...
Suren
1

votes
0

answer
48

Views

To find what kind of usb is connected to the port using vb.net

I have a com port and i want to send messages to it. I want to be certain that is port is of the type RS 485. How can i do that. I have searched online and the only way i see is through the win32 dll. is there any other way and if there isnt could you please point me to the win32 method. I have the...
TheNoob
1

votes
1

answer
103

Views

Serilog Seq package does not install on .NET Standard 2.0 library project

I created a .NET Standard 2.0 library project using Visual Studio and tried to install Seq as follows. Install-Package -Id Serilog.Sinks.Seq The top line of error says Unable to find package 'Serilog.Sinks.Seq' at source ''. Full detail is in this screenshot. Just as a comparison, installing the fo...
SamDevx
1

votes
0

answer
71

Views

Create Large PNG with .NET

I want to create a single large PNG file from a set of PNGs (max 25 files of 4080 x 800 pixels each). The result that I expect is a single PNG with all stacked images. I wrote this code: private void PngCreate(List imageListRef, string basePathPng, string filenamePng, int counter) { if (imageListR...
Cosma Iaffaldano
1

votes
1

answer
238

Views

OWIN AuthenticationMiddleware invoked twice per request

I have a trouble while using owin cookie authentication middleware: When I added cookie authentication middleware to my Startup.Configuration, all of my middlewares will invoke twice per request, and this is my code: public void Configuration(IAppBuilder app) { app.Use((context, next) => { // this c...
acmajia
1

votes
0

answer
61

Views

Roslyn compiler causes recycling of application pool during compilation

I have a fairly large ASP.NET website with Roslyn compiler installed. I have also app pool recycling enabled for 'private memory usage' (IIS 10, limit set to 4GB). I was wondering why my website recycles with event log message ID 5117 A worker process serving application pool 'pool_name' has reques...
mivra
1

votes
0

answer
55

Views

Finding device uniqueness using Canvas Fingerprinting

Currently I am using Canvas Fingerprinting and other device parameters to find the unique device. But in recent post i came to hear that Canvas Fingerprinting is going to be blocked by Firefox browser. So i need alternate solution for identifying devices effectively. Can anyone suggest me a effectiv...
Pravin Pravin
1

votes
1

answer
53

Views

html.beingform not generating appropriate url

I am using html.beingform to generate the url to post @using (Html.BeginForm('action', 'ctrl', new { id = 5, name = 'a' })) the url getting generated is but it should be generated as what is wrong with the syntax I am using?? EDIT I tried below syntax as per comments @using (Html.BeginForm('action',...
hr-tis
1

votes
0

answer
787

Views

How to use dependency injection in ActionFilter Web API?

I am trying to get work with dependency injection into the action filter, but it seems not working I've registered the type in UnityConfig public static void RegisterComponents(IUnityContainer container) { GlobalConfiguration.Configuration.DependencyResolver = new UnityDependencyResolver(container)...
M005
1

votes
0

answer
189

Views

Getting a 403 Forbidden Error while uploading a document using SharePoint 2013 REST API

I am working on a task to generate an on demand spreadsheet/document and upload the generated document to SharePoint 2013 (on-prem) from .net core 2.0 application. I am using Epplus.core libraries to generate the spreadsheet. Using CSOM is not an option for me as I didn't find any nuget libraries wh...
Naveen
1

votes
1

answer
726

Views

How to convert byte array to SKBitmap in SkiaSharp?

KBitmap.Bytes is read only, any suggestion on how to Marshal.Copy a byte array to the SKBitmap? I am using using below code snippet but it not working. Code snippet: SKBitmap bitmap = new SKBitmap((int)Width, (int)Height); bitmap.LockPixels(); byte[] array = new byte[bitmap.RowBytes * bitmap.Height]...
Parthi
1

votes
0

answer
175

Views

CORS issue with Okta - AngularJS controller call to .NET Core Controller

I currently have a .NET Core 2 web app which serves up data to the frontend via AngularJS 1.6.6 calls to the backend API. When users enter the first page of the site (index.html), an AngularJS controller does an HTTP Get to grab some data from the database to serve up in a table. I'm trying to inte...
thunder chunky
1

votes
0

answer
32

Views

Authorize attribute on a controller inside an area

I have an Area with a few controllers inside it, decorated with the [Authorize] attribute. I also have a few controllers outside the area. To default to the controller inside the area, I have updated my routes, to look like: routes.MapRoute( name: 'Default', url: '{controller}/{action}/{id}', defaul...
Sameer Anand
1

votes
1

answer
63

Views

Binded DataGridView only updating the currently selected row

I'm working on getting my DataGridView controls to auto update the values of my objects in my object model. I have object arrays that I'm binding to my DataGridView through the following code Dim bs As BindingSource = New BindingSource() bs.DataSource = aryJoints DataGridJoints.DataSource = bs I am...
RobotGuy
1

votes
0

answer
39

Views

Unsure how to list all records using MVC [duplicate]

This question already has an answer here: The model item passed into the dictionary is of type 'ViewModels.SiteModel', 1 answer The model item passed into the dictionary is of type .. but this dictionary requires a model item of type 3 answers I am still very new to MVC. I am trying to display al...
DForck42
1

votes
1

answer
29

Views

Update table from webpage

I'm using a stored procedure to update a table when the user clicks approve however I get message that it was approved successfully but the table wasn't updated. Update I'm now only able to update one item; even I select more than one item it is only updating one. Stored Procedure Update Requisitio...
1

votes
0

answer
698

Views

ASP.NET MVC Razor Sections and Partials

I'm relatively new to ASP.NET MVC and Razor. We've been modifying and developing based on existing code. Thus, there is a lot of duplication (ugh!). So I started looking at Partial pages and learning about Sections. I followed these tutorials but I'm still a bit confused. ASP.NET MVC 3: Layouts...
Patricia
1

votes
0

answer
45

Views

How to get table data from HTTPSConnection using python

I would like you to help me in getting the data from Httpsconnection since the webpage is ASP.Net and the data can not be retrieved from beautiful soup directory, I implement the code below: import http.client import requests from urllib.request import urlopen from bs4 import BeautifulSoup conn = h...
Hannah
1

votes
0

answer
113

Views

shared CSS and JS multiples projects Asp.net Core

I have a project which will have a framework for several projects, these projects will be done in asp.net core, several CSS files and JavaScripts will be shared between the projects, I would not like to copy and paste these files in each project, I would like to know how to share these CSS and JavaS...
Gabriel Fernando
1

votes
1

answer
92

Views

Working with google charts (want to get the value of column when click on the column)

I am working with Google charts. I want to get the value of column which is clicked. column name is showing in alert but I want get the percentage value also var chart = new google.visualization.ColumnChart(document.getElementById('divAgingReport')); chart.draw(data2, options); google.visualization...
1

votes
1

answer
169

Views

How to set the scheme for Authorize attribute from a .txt file?

My controller is protected with Authorize attribute. What I want to do is to tell the Authorize attribute to use Windows schema or no schema at all. How would I accomplish that? [Authorize(AuthenticationSchemes = AuthSchemes)] Case: AuthSchemes = 'Windows' Case: AuthSchemes = '' I want to change t...
TreeZ
1

votes
1

answer
507

Views

Combine ASP.NET MVC and Web API projects using identity

I am new to ASP.NET and I have to create an ASP.NET MVC project using the identity framework for authentication and authorization, but the access to the database (SQL Server) must be done in an independent web service project so I created a Web API project with also identity containing all services...
sam
1

votes
0

answer
100

Views

what is the Best way UrlRewriting in umbraco?

I want to change this http://localhost:65438/vehicle?id=12345 into http://localhost:65438/Make/Model/?id=12345 For this i am using following code for urlrewriting in umbracoUrlRewriting.config But the problem is that it is hitting the page load action of vehicle view continuously after a period of...
Plz Help

View additional questions