I have added Multilingual App Toolkit to a ASP.NET web form application, in this application is used TFS for version control.
My problem is that every time the application is build Multilingual App Toolkit need to update the files, but it does not check out files before compile and so generates an error:
"Update xliff build failed, one or more errors occurred, multilingual app toolkit build completed with errors"
If I check out the files he can build normally.
What can I do about it?
You should remove any generated files from source control.
It is bad practice to put either binaries or generated code under source control. Source control is for the configuration that is used to feed the generation. If you need to add custom changes to the code after it is generated you should use partial classes.
You should delete all of the generated files in the solution explorer and then checkin. Make sure that you remove the files from the projects and solution as well.
After that everything should build, and continue to build correctly.
Note: Always take a full backup of your files before you make changes.
Related
I work with project written in C#, I use Visual Studio 2019. There are .aspx views in the project. I need to exclude them from build but they should stay in the solution since some tests are linked to them. I use build action: none, according to official documentation that means: The file isn't part of the build in any way. https://learn.microsoft.com/en-us/visualstudio/ide/build-actions?view=vs-2022 . But after the build, when i navigate in browser to these pages - browser starts to download them, which means that they were included into build.
What am I doing wrong? How to exclude these files from the build?
The ASPX files are compiled at run-time from the original location in the source code for local debug/run scenarios (there are no copies for those). From developer's point of view these files already have "Build:none" for local debugging purpose. Changing action to "none" does not in any way impact the original content/location of the file so it will still be located at the same place at the run-time on dev box and render at run-time as if it still built.
Where you'll see an impact of "Build:none" is "published" version of the site - with "none" files will not show up in published version and hence will not work from "published" version.
I have created a custom control for my development team to utilize the CefSharp Chromium Web Browser. I have everything setup and working well. The only problem is having it run for projects that do not directly reference the chrome project in their solution.
I would like to find a way for when a developer drag and drops my custom control into their application, it will automatically copy ALL of the required files from the compiled control to their bin folder.
Currently, it only pulls the handle full directly referenced by the tool, but some are utilized at run time due to limitation of the utility for being able to compile for Any CPU efficiently.
Image of Files
I would like to have all of the files on the left hand side be copied automatically upon using the control from the tool box to the appropriate folder, or at the very least at run time.
Any information or ideas on where to look are greatly appreciated.
I managed to solve the problem, though this feels like back practice.
My issue what using CefSharp and getting all of the x64 and x84 files downloaded where ever require. I ended up adding a zip file of each content and then extracting them at run time as needed.
I have a working Android Project with a .Droid-Solution and a SharedProject. I started the App on my phone and it works great. Now, I just added a blank Windows 10 Universal Solution and did the instructions here: http://developer.xamarin.com/guides/xamarin-forms/platform-features/windows/installation/universal/
Anyway... I did nothing else. Just followed the instructions and tryed to start the Windows 10 Universal app, but I get this error:
"CS0103 C# The name 'InitializeComponent ' does not exist in the
current context."
I googled a few times, but didn't find something that helps.
I also tryed the example here: https://github.com/jamesmontemagno/Hanselman.Forms with the same error.
Does someone know this error with Xamarin.Forms and Windows 10 Universal Apps?
Everytime you create a .XAML page in Xamarin.Forms, you are using partial class definitions in three different places.
Your actual .xaml file will have a Class="" attribute on the root element that defines the namespace and class name.
The actual root element type will define the base class that your new .xaml page is subclassing. By default, that would be ContentPage.
You also get a .xaml.cs file that is linked which contains a partial class definition as well. This is your code behind file, where you put page specific code, this is also where the InitializeComponent() call is called from the constructor.
This call serves to parse the xaml contents and fill out the references to all the views you gave ids to using x:name="something" in xaml.
InitializeComponent() is automatically generated by xamarin, it is part of the output of your project and it should get re-generated each time you edit your .xaml file.
In order for this to happen, in the properties of your .xaml file Build Action needs to be set to "Embedded Resource" and the Custom Tool needs to be set to "MSBuild:UpdateDesignTimeXaml"
Now, even with these values set correctly, there are bugs in Xamarin which can lead to the file not getting generated and you getting the error.
The absolute first thing to try when you get this error is to right click the .xaml file and click on "Run Custom Tool".
You only need to do this once, on ONE xaml file, the tool will automatically run for all the .xaml files in your project.
This is somethign that I have to do about once a day during my normal development and it started when i switched to VS 2015. Your mileage may warry.
Another very important thing to check is the BuildTargets in your .csproj file.
The way Xamarin is able to do it's thing is by specifying build actions that call into it's DLL that you get when you install the Xamarin.Forms nuget package. Sometimes the build actions import line get's messed up and this causes all sorts of problems.
Unload your .csproj and find the line that imports Xamarin.Forms.targets.
It should look something like this:
<Import Project="..\..\packages\Xamarin.Forms.2.0.0.6484\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.2.0.0.6484\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" />
make sure that the version in here matches the version of Xamarin.Forms from your packages.config file, then make sure that you can actually navigate to your project's root folder, and find the actual file the important line is referring to. Ie, packages\xamarin...\Xamarin.Forms.targets
A common thing to do is to delete everything from \packages\ and let nuget re-download everything on your next build. Just make sure the version in your .csproj import and the version in packages.config is the same.
If all of these are done, you should have a valid generated partial class that implements InitializeComponent() and the errors should dissapear.
Just as an update to this:
New, clean Windows 10 Pro installation with all updates in a VM.
New, clean Visual Studio 2015 Community Edition installation with all options selected and all updates.
New project: Blank Xaml App (Xamarin.Forms.Portable) with nowt but generated code.
The project will not build as InitializeComponent in App.xaml.cs does not exist in the current context.
Opinion: this Xamarin add-on is a free add-on on top of a free product, but even so this kind of thing doesn't really inspire you to use it...
I am building a personal website using asp.NET's webforms in visual studio 2013 express for web and am following this tutorial:
http://www.asp.net/web-forms/overview/getting-started/getting-started-with-aspnet-45-web-forms/introduction-and-overview
My page is structured exactly the same as in the website, I have changed some minor stuff to make it my own but the structure in terms of the C# classes and how the interact with the HTML are exactly the same.
I got to section 5 of the tutorial "Display Data Items and Details" and everything was working fine. I've used git a lot in the past so I decided to create a repository for this project so I can access it at work if I feel like.
Suddenly now when I make changes to the C# classes it won't build. It's even stranger because I if I make a change on an HTML file the change is built. In section 3 of the tutorial we learnt how to make the 'product' classes which are displayed on the products page. If I want to change one of the product names for example, when I build the change is not there. Simultaneously I went and changed some info in the HTML for the contact page, IT CHANGES when I build. Why wont the C# changes take effect when I build any more?
I am relatively new to both asp.NET and visual studio. The HTML changes when I build and the C# does not. When I change either I can see in solution explorer that there is a red tick for pending changes. Why would only the HTML pending change be included in the build and not the C#? How do I ensure that the build is actually building the version I see in my editor window?
EDIT
I do not know if I found the original cause but I found a solution/workaround. I realized that the classes mentioned above were grabbed by the html page from the page's database. The .mdf file for the solution was not being rebuilt whenever I cleaned and built so I physically deleted it and rebuilt the solution and voilla my C# changes occurred. I am still fairly new to this whole thing, can someone explain what the .mdf file does and why it wasn't being rebuilt?
Check your .cs files properties on the properties window in visual studio to make sure their Build Action is set to "Compile", Things that are not set to "Compile" do not get compiled. How MSBuild treats project items depends entirely on their build action. CS files default to "Compile" when you make them, but if you changed them yourself that would be why it doesn't update. Also CS files placed in the App_Start folder default to "Content" and they are compiled by ASP.Net when the Application Starts, so if you changed something in App_Start you need to reset the site.
Not exactly sure what is the problem, but I would do a right mouse click on the solution in Solution Explorer->Clean Solution, then do another build and see if that helps.
I'm working on a windows form application in C# VS2010.
I found on the internet an implementation of a User-Control that I want to use in my project.
Problem: how can I import or include it so I will be able to see it in my Toolbox ?
I copied the UserControl directory into my project directory(see attached photo)
and then build the project and got this warning:
Error 1 Unable to create a manifest resource name for "RecessEditorControl.resx". Could not find file 'C:\Users\bassam\Desktop\comm\Projects\Thunder Archive\Thunder Archive\RecessEditorControl.cs'. Thunder Archive
any idea how it should be done?
Open the user control project separately (outside of your solution) and attempt to build it.
If the build fails, search for help from the control author(s) on what dependencies are needed and how you can build the control.
After you get it sucesfully built, there will be a .dll file in the bin/ folder (where config is most likely debug or release, depending on what configuration you used to build the project)
Reference this .dll from the windows desktop solution you are working on. Add it to the references section of your UI project.
It should automatically show up in the toolbox if it is properly coded as a user control.
There is the option of including the entire source project of your control in your win app solution, you can try this later if you verify that you are able to build the control on it's own.
Although I would not recommend this approach unless you intent to actively continue developing the user control.
You separately build user control to create a dll. After that include the dll in your app executable folder. When you switch to designer, you will see the control appears on the toolbox with the control name. Just drag n drop...