this is the files i have in the project folder :
i edited the 4 KB size file : Download Files c# Project file
then inserted the line :
<LangVersion>8.0</LangVersion>
near the end of the propertygroup :
then in the form1 it asked with a prompt window to save as... i chose save as but the error still say i need to change language to 8.0
Related
1- Put Book1.xlsx file to the Solution Explorer by following Add > Existing Item
2- Set properties of Book1.xlsx in the Solution Explorer like following ;
Build Action: Content
Copy to Output Directory: Copy Always
3- Run this project and see if Book1.xlsx file is copied to the the Debug folder
4- Close this project.
5- Open Book1.xlsx file manually by finding it in the Debug folder. Keep Book1.xlsx file open.
6- Run this project again and see the following error;
Could not copy
"C:\Users\onsuz\OneDrive\Desktop\WpfApplication1\WpfApplication1\Book1.xlsx"
to "bin\Debug\Book1.xlsx". Beginning retry 1 in 1000ms. The process
cannot access the file 'bin\Debug\Book1.xlsx' because it is being used
by another process.
As you can see if a curious person opens Book1.xlsx file manually before my application start then my application crashes.
Do you have any solution?
This is not your application crashing, this is your application failing to compile as it cannot overwrite this file. This particular issue will not happen at runtime as you will be deploying a pre-compiled version of your code.
I copy the form 1 to and paste it to become form2, and form3 again. But this error appears.
You can't copy them that easily, you need to go to the folder where the forms are in your file explorer (not solution explorer), copy them there, rename them there, then open them up in notepad (not visual studio), now you'll have multiple classes with the same name so you need to change the one mention of the class name at the top of each of the code sheets (notepad still!) and Include those files in your project, and you'll be good to go.
It's not as easy as copy and paste in solution explorer, remove what you've copied and do it inside file explorer.
I'm using Visual Studio Community 2015 and need to view the designer.cs file for one of my webforms. However, when I expand the aspx file in the solution explorer, it does not show up. How do I force Visual Studio to show me the designer.cs file?
Here's what I see in Solution Explorer:
Also, I seem unable to edit the project file (.csproj) by hand so that it will show the designer.cs file because I can't find the project file in the folder containing the code. Here's a screenshot of that folder:
Folder Contents
In order for a designer file to show up beneath a source code file within the Project Explorer, the project file (.csproj) must have an entry as follows:
<Compile Include="page.aspx.cs">
<DependentUpon>page.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="page.aspx.designer.cs">
<DependentUpon>page.aspx</DependentUpon>
</Compile>
Please open your ProjectName.csproj file and check to see that this pattern exists for your source file (.cs) and designer source file (.designer.cs).
You will have to unload and then reload your project from Visual Studio for changes to the Project File to take effect.
Per Dave in the comments above - It appears that your project is configured as a web site instead of a web application. I would recommend that you convert your project to a web application by creating a new project and re-adding the files. You can read up on the differences between the two models here on MSDN
I am currently using NSIS to create an installer for my app. My app is made using C# (with Unity3D) and I was wondering if there is an equivalent to the two following functions in C# that I am using to save files (save data and such) during the execution of my app, in Python.
I want to know the paths to the save files to be able to remove them in my uninstaller !
Here are the paths :
Save path :
Application.persistentDataPath
Image path (the user is able to save some pictures in his picture folder) :
Environment.GetFolderPath(Environment.SpecialFolder.MyPictures)
Is there a way to get these paths in Python ? Or in my .nsh file (where the uninstall files are listed) ?
The NSIS shell constants are listed in the help file (4.2.3 Constants). You are probably looking for $APPDATA\YourApp and $PICTURES...
Whenever I open an existing project in VS 2005, the designer.cs files do not show up under .aspx files, and due to this when I add controls in .aspx the designer.cs is not updated.
Below is how the structure looks:
+----AAAConfirm.aspx
. .
. ..AAAConfirm.aspx.cs
.
.----AAAConfirm.aspx.designer.cs
You need to "show all files" for the project, it most likely got removed from the project file by accident. When you see the file in Visual Studio, right click the file and select "Add to Project".
Or
Check the project file and make sure the designer file's compile tag has a child element called DependentUpon
The XML section specifying the file's inclusion in the project should look something like this
<Compile Include="AAAConfirm.aspx.designer.cs">
<DependentUpon>AAAConfirm.aspx</DependentUpon>
</Compile>
Also check that the markup page AAAConfirm.aspx has the correct codebehind and inherit reference in the <%Page> tag. Did you maybe change namespaces? Try setting the Inherits attribute value to the class name without the namespace.
Copy your project to some other folder and
Locate the corrupted aspx.designer.cs file through the Solution
Explorer Delete only the designer.cs file from your project
Rightclick your main aspx file and select “Convert to Web
Application“.
Ref : Tip: regenerate aspx.designer.cs files when corrupted