External ".xsd" file not included in release folder - c#

I am a WPF newbie. I have my first WPF project which is developed with C# and VS 2013. At the root of the project, there is an external XML schema file with ".xsd" extension that is used in my project codes. Inside VS 2013 environment, I code and run the project without seeing any issue.
Recently, I have built that project for Release. However, the built folder does not include that external ".xsd" file. As a result, on running that project outside VS 2013 environment, I get an exception that tells it could not find out that ".xsd" file. Please tell me how I solve that issue. Thank you in advance.

Make sure the file is set to be copied to output folder on compilation via the property window.

Related

how to make a standalone exe file

I started learning c# a couple days ago and want to send my first program to my friend but as a standalone exe file that can be shared through google drive.
I've found several solutions but I coudln't understand any of them. Is there a simple solution to compile an exe file or a standalone app in visual studio 2019 that would just work when you open it
One annoying thing with .NET Core is that when you build it in Visual Studio it makes lots of separate files, which is annoying for portability.
A fix to this is to right-click on your project in Solution Explorer and click Publish. Select Folder Profile, give it a name and save it.
After that, you will need to edit the target runtime option, and set it to win-x86. After that, you should see a dropdown box at the bottom of the dialog, expand it and check 'Produce a single file'.
Then you can hit Publish and it should produce a single file.
NOTE: This does not work in .NET Framework, only .NET Core.
All you gotta do is simply build the project within Visual Studio, once that's done. Go to your projects folder and go into bin/Release (or Debug if you've selected debug build)/myprogram.exe. It should make a standalone .exe file!
Maybe this could also help you.
Official Documentation: Compiling Building in Visual Studio

Not able to build Q#/C# project in Visual Studio Code

I have written Q# code inside a C# project in VS Code. When I would click on Debug -> Start Without Debugging it would give a whole slew of build errors as shown in the images below.
Can someone please help me out with this
To run the vs code I have installed: .NET Core SDK 3.0 or later & VS Code extension
system: Mac osx 10.13.3
The errors in your screenshot are coming from a generated .cs file inside the /obj folder, indicating that duplicate assembly attributes are being found while attempting to build your project. Because the build fails, it cannot proceed to run and debug your program.
First thing to try would be to delete the bin and obj folders and try again. Files in these folders will get regenerated on the next build attempt.
If that doesn't work, can you please share the contents of your Hello_world.csproj file?

C# web service recompile and update

I was just handed a C# web service project and first time doing C# and ASP.NET. The web service and .cs, asmx, and asmx.cs files are located in wwwroot dir of the IIS server. I am writing a PHP SOAP client that calls those asmx files via SOAP. I would like to change some of the hard coded settings in those asmx.cs and .cs files. I have tried the aspnet_compiler and Visual Studio would not load the project. Is there any way to update the code/logic in those files without Visual Studio or recompiling. This project was compiled before. When using VS 2010 - it tries to open the project, converts it and nothing happens. If I have to us VS - any clues why it is not loading those files? It opens them if I open the .cs files individually but then I can't rebuild the project.
Any help/hints would be appreciated.
Thanks
It seems that your project file (.csproj) is interrupted. Refer to other correct project file and fix it manually.
ASP.NET website will auto compile cs and run when asmx first requested. Compiled code is put at bin folder, while cs code is put at app_code folder. Make sure asmx code behide puts to cs file in app_code.
Sorry but it turned out be a Windows profile issue. VS could not load those project files due to my profile being full. Hope it helps someone else in the future :)

Is Visual Studio 10 expected to compile C# files that are not part of the solution?

Got a Visual studio 10 solution for ASP.NET web site, and VS seems to compile *.aspx.cs files that are in the web site folder, that used to be part of the solution but were excluded (I no longer see these files in the solution explorer). Is it expected? If not, how could I fix it? Rebuilding solution does not help.
Also, is it expected that I cannot find the binaries for *.aspx.cs files?
If your website is a Web site project as opposed to a Web application project (see Web Application Projects versus Web Site Projects in Visual Studio) then IIS will perform the compilation at runtime for you instead of Visual Studio - in this case the .csproj file is not used to determine what is and isn't compiled.
There is no project file (.csproj or .vbproj). All the files in a folder structure are automatically included in the site.
I'm not sure where the compiled binaries go, but I believe that it is a temporary folder somewhere, so you shouldn't necessarily expect to see those binaries in the web site folder structure.
If you want explicit control over what is compiled and when it is compiled then you may be better off converting your project to a web application project.
Short answer: No. It only compiles whatever is is included in the .csproj marked as 'compile' (in the file properties window).
Try to refresh the project, open the .csproj as a file text and check if those files are referenced there.
Lastly, it might be a dependent project that references those files.
If you can't find the solution, paste the exact error given by VS
For clarification, solutions files (.sln) contains project files (.csproj); .csproj files are the ones that contain references to the files to build.

Creating Sharepoint Web Part manifest file and dwp files

Could anyone please help me to understand the following for creating Sharepoint web part please?
Manifest.xml
a. What is the purpose of this file?
b. What happens if we specify the wrong *.wpd file as below?
<DwpFiles>
<DwpFile FileName="WebPart1.dwp"/>
c. How do I create file in Visual Studio as I can't see any template
*.wpd
What is the purpose of this file?
How does this loads the proper dll?
How do we create using Visual studio, any template exists?
If we have webpart project and it references to the dll on another project. Does another project's dll has to be signed?
What are the best mechanisms to deploy the Sharepoint Web Parts?
I use the WspBuilder Visual Studio templates. They are a little quirky but it makes creating the structure of SharePoint projects very simple.
It uses the convention of following the SharePoint folder layout for specifying file locations in the project. Take a look - it might help you get moving. Note there are two versions - one for Visual Studio 2008 and a beta for Visual Studio 2010.
To try to answer your specific questions:
If the file can't be found, no action is taken. It's an error but not one that will bring down SharePoint.
I thought WPD was the old package style. Maybe I'm wrong on this?
Should be same as WSP - a package containing files to be deployed.
Whatever DLL is contained in the package is deployed to the GAC if it's signed.
Take a look at previously mentioned WSP Builder project.
Anything that's loaded by SharePoint and leads to rendered content needs to be signed and possibly added to the SafeControls entry in the web.config (deploying WSPs created from WSPBuilder does this automatically)
"stsadm -o addsolution" then use Central Admin to deploy or continue with "stsadm -o deploysolution"

Categories

Resources