Tag Archives: .net

Error while trying to run project:unable to start debugging.the debugger is not properly installed. run setup to install or repa

Error while trying to run project:unable to start debugging. the debugger is not properly installed. run setup to install or repair the debugger。

Solution 1: Run the Visual Studio .NET Add/Remove feature from “Control Panel > Add or Remove Programs”, by selecting the correct version of Visual Studio and clicking on “Change/Repair” button. In my case this solution did not fix the problem.

Solution 2: Reinstall .NET Framework debugging services.

Open command prompt
Type “cd /d %windir%/Microsoft.NET/Framework/”
regsvr32.exe mscordbi.dll
Unfortunately, this solution did not fix my problem either.

Solution 3: Manually register mdm.exe.

Open command prompt
Type “%CommonProgramFiles%/Microsoft Shared/VS7Debug/mdm. exe” /regserver
This solution did not work for me either.

Add and addmodelerror in modelstate

ModelState ModelState1 = new ModelState();
modelstate1. Errors. Add (“cannot be empty”);

//Add a property that does not exist in the key of modelstate
modelstate. Add (“123”, modelstate1);

//Add an error to the property

Modelstate. Addmodelerror (“123”, cannot be empty “);

A method of generating subtitle file for MP3

In the current cloud computing, big data and artificial intelligence are so hot, all kinds of cloud services providing voice recognition are emerging. Recently, I tried to make a tool based on IBM Watson Speech to Text Service to help generate English MP3 subtitle files, I think it is good, and I share it as follows.
The tool is compiled in C#, and the specific idea is as follows:

Step 1: Use the embedded WebBrowser to access the relevant IBM service website: https://speech-to-text-demo.ng.bluemix.net/. The interface will look like this:

In this step, you need to manually click the “Upload Audio File” button of the webpage and select the MP3 Audio File to be subtitled. After the upload is successful, the site will start the automatic recognition process. Once you have identified the words, manually click on Word Timings and Alternatives at the bottom to see the sequence of the words you identified and the corresponding start time.

Note :(1) The save button at the top of the interface can save the identified webpage content to local HTM file, and you can click the load button to load it directly next time, without repeating the identification process.
(2) When clicking the “Next” button at the bottom of the interface, the program will automatically scan the web content to generate a dictionary list of words and time information, denoted here as lstDict, of type List< KeyValuePaire< string, string> > , each element in the list is a key-value pair, the Key stores the word, the Value stores the time information.

Step 2: Load the English manuscript. If the original is not available, copy the identified text from the Step 1 site under the Text TAB. The interface is shown below:

In this step, the original text as far as possible to meet the following requirements:

(1) Completely corresponding to audio text.

(2) Each line contains words as long as possible, which can improve the matching rate.

(3) Avoid non-English characters, especially Chinese or non-half-corner symbols.

Step 3. Generate the subtitles. The program will sequentially input the original line by line and the first step to identify the word time dictionary to match, in order to get the beginning time of each line of subtitles. The general idea is as follows:

(1) Word segmentation: Use regular expressions to split the current line into an array of words. The code is as follows:

string[] a = Regex.Split(value, @"\s+");

(2) Denoising: remove or replace symbols that do not conform to English habits in each word in the array to symbols that conform to English specifications.

(3) Match: Match the array with the word time dictionary identified in the first step, lstDict, to get the start time of the subtitle for that line.

The following figure shows the interface of recognition result:

At this time, notice that the time marked in red in the figure is obviously incorrect, you can manually select the corresponding time through the “Correct” function at the top of the interface. The interface is shown below:

At this point, the subtitle information is matched, you can click the Save button at the bottom of the file to save the corresponding format of the subtitle file, currently provides support for.lrc and.smi formats.

Note: Click the play button at the top of the interface to select the audio file to play in real time and view the generated subtitle effect.

Finally, the download address is attached:
https://download.csdn.net/download/alvin_2005/10530316

VTK series: installation and introduction of VTK

Due to the need to do some three-dimensional things, learn some D3D, this thing is too low-level, what function should be realized by their own, then found the VTK toolkit, in the industry response is good, and there is a.NET version, so I decided to try.
I use VS2008, there are a lot of tutorials on the Internet, according to the tutorial to do, to the end of the toolbox are VTK controls, full of joy thought that can be successful, drag a control up a debug results prompt that the specified module can not be found. I can follow the tutorial but still make mistakes is a little puzzled. The net searched for a long time, still did not solve, want to despair. I saw a friend’s QQ in the Visualization Lab forum, added him, he is very nice, asked questions immediately back to me, the key is to help me to solve the problem. In the heart that thank ah, I can not say. The main problem is to put all the downloaded DLLs under the program’s “dubug” and it will work fine. There is a problem with the VTK control that is pulled from the Toolbox. The first time it is displayed, the form will not load when the project is closed and the second time it is opened. This problem is not solved.
After several days of hard work, I finally saw a HelloWord program. Everything is difficult at the beginning, so I can only take it slowly.
Here are a few good links, a good tutorial to get started with VTK.
http://ooplab.org/post/624.html VTK installation tutorial, which also have a step to c:/VTK file to add to the system environment variables.
http://www.cadcaecam.com/Forum/viewthread.php?tid=14832& extra=& page=1
C3P forum, but only wrote a small part of it.
http://hi.baidu.com/ophir/blog/category/%D7%CA%D4%B4%CF%C2%D4%D8%C7%F8 is good too.
Thanks to the articles written by these authors, it is really a great help for beginners.

How to solve the problem that lightningchart is completely black

LightningChart.net is fully GPU-accelerated and optimized for displaying massive amounts of data in real time — over 1 billion data points. LightningChart includes a wide range of 2D, Advanced 3D, Polar, Smith, 3D Pake/Doughnut, Geographic Maps and GIS charts as well as volume mapping capabilities for science, engineering, medicine, aviation, trade, energy and other fields.
LightningChart.net is now available for online order, SignalTools, 12 Months, WPF version for RMB3499 from RMB4105. Buy it now! Buy now> >
Click to download the latest trial version of LightningChart.NET
Question: With the WinForms program of LightningChart, for some reason I overwrite CreateParams in the Form class and put the LightingChart in the custom panel. Then the LightningChart will turn all black. Am I doing something wrong?The attached file demo project only overrides CreateParams and will show a black screen at startup and then go to the correct content, but in my program, it will always be black.
Start the

After normal startup for

Black

Lightning map all black
overwrites createParams code

protected override CreateParams CreateParams
{
    get
    {
        CreateParams cp = base.CreateParams;
        cp.ExStyle |= 0x02000000;
        return cp;
    }
}

We tried to reproduce this problem with the test items you shared, but were unable to produce a situation where the chart was completely black.
project has two forms, ReadData and Form1. Both can be added using CreateParams.
ReadData is black first and then displays the chart.

Form1 is first transparent and then displays the chart.

Did the problem occur in the test project on your computer?If so, will the chart display properly if you ignore createParams?This will indicate whether the reason is actually CreateParams.
The only known thing about a completely black chart is that it lacks some reference. In the test project, they seem to be correct, but just in case you can test adding arction.directXFiles.dll, directXInit.dll and arction.mathcore.dll.
As mentioned earlier, an all-black chart may appear if some references are missing. A complete reference list is provided in Chapter 29.1 of our user manual. All of these files are not necessarily needed at development time, for example, if DirectX-Files are already found somewhere on the computer. Referencing all listed parts solves the black chart problem.
However, if rendering DeviceType SoftwareD11 works, but Hardwared11 or Hardware D9 does not, then there may be a problem with the drivers themselves because they may be faulty or outdated. Therefore, it helps to update the driver to the latest version.
In general, you can listen to a ChartMessage-event immediately after building a LightningChart and call the checkEngineResult () – method in it to catch RenderingEngine errors. Such as:

private void _chart_ChartMessage(ChartMessageInfo info)
        {
            info.ToString(); //= log message
 
            if (info.MessageType == MessageType.RenderDeviceCreateFailed || info.MessageType == MessageType.MemoryAllocationError)
            {
                CheckEngineResult();
            }
       }
 
 
private void CheckEngineResult()
        {
            var results = _chart.GetLastEngineInitResults();
 
            foreach (var engineInitResult in results)
            {
                string sLog = string.Format("Engine {0}. Success:{1}", engineInitResult.DeviceType, engineInitResult.Success);
 
                foreach (var exception in engineInitResult.Exceptions)
                {
                    sLog = string.Format("{0}\n Exception: {1}", sLog, exception.Message);
                }
                System.Diagnostics.Debug.WriteLine(sLog);
            }
       }

We did some more research on this issue and may have recreated it. When using CreateParams, does the following happen in the application?
After launching the application, WinForms controls such as buttons will be drawn, but the diagram will remain black (left image below). After a short time, the diagram is drawn (the image below is on the right).

What is the diagram behavior you are trying to accomplish?Should you draw both controls and charts?In this case, you will most likely have to defer the drawing of the control in some way. This can be done by rewriting the OnPaint method or by using SuspendLayout and Resumelayout. One solution, however, is to hide the control until the diagram is drawn. In other words, set the Visible property of all controls to false by default, and then set it to true in the Paint event of the diagram. The sample code below shows all the buttons only after the diagram is drawn.
_chart.Paint += _chart_Paint;

private void _chart_Paint(object sender, PaintEventArgs e)
{
    _chart.Paint -= _chart_Paint; // Do this only once.
    foreach (var b in this.Controls.OfType<Button>())
    {
        b.Visible = true;
    }
}

If you have any questions, please contact customer service for more information.

Visual Studio 2005 — Error code 1603 for this component means “Fatal error during installation.

 

Visual Studio 2005 — Error code 1603 for this component means “Fatal error during installation.
 
These days, because a project needs and want to install VS2005, Do not know how to return a responsibility, install to Microsoft Document Explorer 2005 prompt installation failure, how also continue not to go down, looked up a lot of data on the Internet, tried a lot of methods did not solve, on the difference reinstall the system, ha ha. In the last ready to give up suddenly because of a Qihoo 360 accidental system vulnerability repair installation failed to think of the reason, and then try, always successfully installed!
Now on the Internet on the installation of VS2005 Microsoft Document Explorer 2005 installation failure reasons and their own experience experience summary, previous lessons, hope to help others:
Before you start, please make sure that you have carefully reviewed the installation instructions of MS and tried the method. The official documentation is still very important.
 
The first recruit:
1. Empty all previous installations (including components from all previous versions), including the contents of the Windows /temp folder. 2. Open a vs cd-rom, have a file of Windows granted entry into the vs/wcu/msi31 folder, and install it. 3. Restart the computer and close the anti-virus software and firewall. 4. Modify the programe file and temp folders so that the programe program has sufficient permissions — in fact, you can login in and install 2005 with administrator.

5, now you can directly install.
(If this doesn’t work, see below)
 
The second recruit:
1. Open the VS2005 installation disk and enter the directory VS/WCU /DExplore
 
2. Manually run DExplorer. Exe
 
3. Run the VS2005 installation program again.
 
Three recruit:
1. Fix the.NET Framework 2.0
 
2. Remove a file named rgstrtn. LCK, which may be in
“%APPDATA%/Microsoft Help” or %temp% or directory under %temp% or
“/Documents and Settings/All Users{.windows}/Application Data/Microsoft Help”.
 
3, Then, see if ANY directories exist under “APPDATA%/Microsoft Help” or
“/Documents and Settings/All Users{Windows}/Application Data/Microsoft Help”, they need to be moved to another directory for this error to go away, a rename to another name will not work, The code is checking the Existance of ANY Directory of Name and the directories “APPDATA%/Microsoft Help” or “/Documents and Settings/All Users/Application Data/Microsoft Help” having ANY directory under it will not resolve this error.
All folders under Microsoft Help will be removed or renamed, pay attention to the path is good.
 
4. Ensure that you log in as Administrator and have sufficient permissions to operate the installation.
 
5. Install VS2005 again
(The above three tips are basically enough to solve most of these problems, if you are not good, you may be in the same situation as me, then try the following tips, hehe)
 
The fourth recruit:
1. Open your installer’s temp directory. Mine is /Documents and Settings/ Luocl (the username you logged in to) /Local Settings/ temp.
 
2. Remove the Temp folder’s encryption attribute: Click the Temp file’s attribute — & GT; Conventional – & gt; Advanced, uncheck the “encrypt Content to Protect Data” TAB, and click OK.
 
3. Reinstall VS2005.
 

Visual SVN server provider failed to perform the attempted operation 0x80041024 after win7 upgraded win10

After win7 upgraded win10, the VisualSVN Server provider was unable to perform the attempted operation 0x80041024

VisualSVN Server.msc can be found under the bin folder of the installation directory to add shortcuts. VisualSVN is recommended to install to disk C.

Error when opening VisualSVN Server: the provider was unable to perform the attempted operation (0x80041024), as shown below

Fix it by “fixing” the source file:
1. Find the installation source of VisualSVN, double-click, and select Repair (Repair) to complete the Repair.
In fact, VisualSVN official website also provides the cause of the problem analysis and repair methods
It mainly includes:
1. TCP/IP port is occupied;

2. Conflict with third-party anti-virus software or firewall;
3. The parent folder of the VisualSVN installation folder cannot be accessed (it is recommended to install to disk C).
4. The root folder of the version library cannot be accessed;
Through the Windows event viewer, the log information of the VisualSVN Server can be viewed to determine the cause of the failure:

SOE deployment error ClassFactory cannot supply requested class

The original link: http://www.cnblogs.com/myyouthlife/p/3284291.html

Problem description:
An error message appears when the deployed SOE is enabled for a service. If the newly deployed SOE is enabled for SampleWorldCities, the error message is as follows:
service failed to start
SampleWorldCities.MapServer:

ClassFactory cannot supply requested class
 
Causes:
This error message usually appears in.NET SOE because.NET extension support was not enabled when ArcGIS Server was installed.
Solutions:
Fix arcGIS Server, enable.NET support. The screenshot below

==== dividing line ===
Update 9.29 days
In addition to the above, there is another situation in which the arcobjects SDK that is adopted by the opening of SOE is issued with the wrong version and the arcobjects SDK that is owned on the deployment machine. For example, the ARcobjects SDK for.NET 10.2 is adopted for soe development and deployed on a 10.1 Server machine, and only the Arcobjects SDK for.NET 10.1 is on the machine. The above error will also occur

Some problems encountered in the development of ReportViewer

http://blog.csdn.net/hebeijg/article/details/7329019

1. The number of rows displayed per page is determined by the Report’s Interactivesize-height attribute. The rule is Height = row number *0.63492 row Height
2. How to display the table header, choose to open the report file in XML format, in
< TablixRowHierarchy>
& lt; TablixMembers>
& lt; TablixMember>
& lt; KeepWithGroup> After< /KeepWithGroup>
& lt; RepeatOnNewPage> true< /RepeatOnNewPage> // Just add this sentence.
<
<
<
<
< /TablixMember>
& lt; TablixMember>
& lt; Group Name=”Details” />
& lt; /TablixMember>
& lt; /TablixMembers>
& lt; /TablixRowHierarchy> PageCountModel property
has two values, Actual and Estimate, after adding the ReportView control to the page.
Actual is the Actual number of pages
Estimate is also the estimated page, with a question mark
4. If through the page loaded so
< LocalReport ReportPath = “Rdlc \ CopyRecordRdlc Rdlc” & gt;
& lt; /LocalReport>
is in the upper right corner of the page with control points triangular load RDLC files, so there is no problem in winform, but there is no data problem will appear in the Web, the correct way is to load in query button rvCopyRecord. LocalReport. ReportPath = @ “RDLC \ CopyRecordRdlc RDLC”;
so you don’t have that hint
5. Add parameters in the report,
increase total cost in the report, right-click under the parameter folder in the report toolbox, create a new parameter AllCost, drag this parameter into the report, pass the value on the page,
double AllCost =0;
ReportDataSource ReportDataSource = GetData(out allCost);
ReportParameter r = new ReportParameter(“AllCost”, allcost.tostring ());
rvCopyRecord. LocalReport. SetParameters (r);
this allows the total expenses to be passed into the report

6. Statistical function must be an int or a decimal field serving can be added, and other fields is first
the last line of the selected statements, increased Group of Blow in increase the bottom line, enter a meaningless in the GroupBy parameter, this will show only a line, if you choose meaningful field will appear many lines (don’t know why). Right click on the last column of the last row, select Fx, go to the expression page, go to Database, list all the fields that can be counted, int or Decimal is Sum and the rest is FIrst, double click on the Sum field, so an expression is automatically generated in the input box above, and the statistics function is generated.
 
7. Pie chart percentage,
Percentage in the pie chart shows the time display, the default is to display the decimal (vs2010) as 0.2, but want to show the percentage, the series label a Number attribute in the propertys, inside can set the percentage attributes, but don’t know what is Microsoft’s bug or I did not study, anyway setting percentage is not successful, each open again into a default value, namely the decimal,
Provide two ways to display percentages,
1), select the percentage number on the PieChart, select series label propertys, select fx in the label Data and add as follows = FormatPercent(CountRows()/CountRows(“PieChart”),2) (PieChart is the name of your PieChart, default is Chart1). This will show the percentage.
2), select the number property in Series Label Propertys and it will become default every time it is opened, but it can be set in the bar chart. By comparing THE XML files, the difference is found. Open the XML file of the pie chart with XML format, and there is a ChartDataLabel node under the ChartDataPoint node, and add the following code inside
< Style >
& lt; Format> 0.00% & lt; /Format>
& lt; /Style>
This will show you as a percentage.
8. How to display links in pie charts
If you want to click open the page on each scale, then pass in a parameter
Select the label on the pie chart and then select Series Label Propertys, select action in the URL, select URL, click FX, write, =”http://www.baidu.com?Id=”+Fields! Paremare.Value.
Note that the following code must be added where the RDLC file is referenced when using the URL
rvCopyRecord.LocalReport.EnableHyperlinks = true;
Otherwise no error will be reported at compile time, but no error will be reported at run time
9. How do I get the pie percentage to be on the outside of the pie and show the lines
Select the dataLable on the pie chart, then select the property on the right, CustomerAttirbutes inside, and set Pielabelstyle =outside, Pielablecolor =”color” to do the job
10. Problem with subReport control, place a subReport control in the parent report and set the reportName property to the name of the child report to be displayed.
Data retrieval failed for the subreport, ‘Subreport1’, located at: D:\Work\ ReportService\ReportService.Web\Rdlc\ProductDetail. Rdlc. Please check the log files for more information.
The problem is that there is no data source for the subreport,
In display report events add reportViewer1. LocalReport. SubreportProcessing + = new SubreportProcessingEventHandler (LocalReport_SubreportProcessing);
Void LocalReport_SubreportProcessing (object sender, SubreportProcessingEventArgs e)
{
the DataSet DataSet = null;
Try
{
// Load the data from the XML file
ReportDataSource ReportDataSource = GetData ();
///Supply a DataTable corresponding to each report dataset. The dataset name must match The name in The main report stream
// (in The name attribute of) the < DataSets> \< DataSet> Element.
e.D ataSources. Add (reportDataSource);

} finally
{
if (the dataSet. = null)
the dataSet. The Dispose ();

}}
 

Mac – build. Net development environment

1。安装openssl

brew update
brew install openssl

2. Install.net core SDK

sudo install_name_tool -add_rpath /usr/local/opt/openssl/lib /usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.0.2/System.Security.Cryptography.Native.dylib 

3. Go to install vs code
install c# extension: open vs code, press command+p and enter

ext install csharp

Test

4.

mkdir HelloWorld
cd HelloWorld
dotnet  new
dotnet restore
dotnet run

effect

Project HelloWorld (.NETCoreApp,Version=v1.0) will be compiled because expected outputs are missing
Compiling HelloWorld for .NETCoreApp,Version=v1.0

Compilation succeeded.
    0 Warning(s)
    0 Error(s)

Time elapsed 00:00:01.4283528


Hello World!

5. Open the newly created HelloWorld with vs code, install the plug-in according to the prompts, the final effect is

Updating C# dependencies...
Platform: darwin, x86_64

Downloading package 'OmniSharp for OSX' (24653 KB) .................... Done!
Downloading package '.NET Core Debugger (macOS/x64)' (43967 KB) .................... Done!

Installing package 'OmniSharp for OSX'
Installing package '.NET Core Debugger (macOS/x64)'

Finished
Failed to spawn 'dotnet --info'
Warning: project.json is no longer a supported project format for .NET Core applications. Update to the latest version of .NET Core (https://aka.ms/netcoredownload) and use 'dotnet migrate' to upgrade your project (see https://aka.ms/netcoremigrate for details).

resources http://www.cnblogs.com/gk0124/p/6066857.html

http://blog.csdn.net/x_studying/article/details/52730913

Error 3002: Problem in mapping fragments | c# linq to entities

error display:

Error 3002: Problem in mapping fragments run at line 1330:Potential runtime activity of table FTPRuns’s keys (FTPRuns.ID):

Error 3002: Problem in line 1330:Potential runtime activity of table FTPRuns’s keys (FTPRuns.ID): Columns (ftpruns. ID) are mapped to EntitySet FTPRuns’s properties (ftpruns. ID) on the conceptual side but they do not form the EntitySet’s key properties (ftpruns. ID, ftpruns. LastRun)

reason analysis:

Your entity model has the combination of the two properties FTPRuns.ID and FTPRuns.LastRun as entity key while your table has only the column FTPRuns.ID as primary key. So in your model you specify that the combination of FTPRuns.ID and FTPRuns.LastRun must be unique while your database has the stronger requirement that FTPRuns.ID alone must be unique.

Just exclude the property FTPRuns.LastRun from the entity key. Maybe this happened accidentally or the Entity Framework could not get primary key information from the database and had to infer the entity key. For example views have no primary key and the Entity Framework will infer the entity key as the combination of all non-nullable columns.

entity is the compound primary key of two attributes ftpruns. ID and ftpruns. LastRun, while the database table only has one ftpruns. ID as the primary key. All your entities must specify a composite primary key for two properties, whereas the database requires only ftPRUNs. ID to be unique.

excludes the ftpruns. LastRun attribute from the entity primary key, which may happen accidentally, or EF cannot get the primary key information from the database and must notify the entity primary key. For example, if you look at a table that has no primary key, EF will tell the entity to use all columns that are not empty as its primary key